Introduction
The Load Balancer is an optional component in the Andera ecosystem. Workers can operate independently, and the Load Balancer is only required if you need advanced features such as persistent task queues, centralized routing, or a monitoring dashboard.
Use the Load Balancer to manage clusters of Workers, prioritize and persist tasks, and monitor your system in real time. For simple deployments or single-Worker scenarios, you can interact directly with your Workers without the Load Balancer.
The code for both the Load Balancer and Base Worker is written in TypeScript for reliability and maintainability. However, Workers are technology-agnostic: your TypeScript code can interact with binaries, call Python scripts, or use any other technology required for your business logic.
What is the Load Balancer?
The Load Balancer receives incoming tasks, prioritizes and routes them to available Workers, and exposes a dashboard for real-time monitoring. It is built for performance, flexibility, and ease of use.
- Routes and prioritizes tasks based on group, function, contract, and priority
- Manages a dynamic list of available Workers
- Provides a dashboard and BullMQ interface for monitoring
- Handles task queuing and retry logic
- Displays tags sent by Workers in the dashboard for enhanced monitoring
Key Concepts
- Groups: The Load Balancer can manage groups of Workers with the same functions and the same contract versions. When
/task
is called, it selects the best Worker for the job. - Task Routing: Directs tasks to the right Worker based on availability and contract.
- Priority Queues: Supports task prioritization and queueing with BullMQ.
- Worker Discovery: Dynamically updates the list of available Workers.
- Dashboard: Visual interface for monitoring Workers and tasks, including tags sent by Workers.