Embra-Connect-ETL / Embra-Connect-ETL/Development

Setup distributed job processing system with dynamic worker scaling

Open
#52 0 comments 0 reactions 1 assignee Claimed by @irfanghat View on GitHub
devops infrastructure
Dominant language
JavaScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## System Overview

1. **Client requests a long-running job** via an API.
2. The request is **pushed to a queue** (e.g., RabbitMQ, SQS, Kafka).
3. A **Worker Manager Service** picks jobs from the queue.
4. The **Worker Manager** **scales workers** dynamically based on queue length.
5. Workers **process jobs asynchronously**.
6. Once done, the **worker sends a notification** (Webhook, WebSocket, Slack, Email).
7. The client can **poll the status** or get the final response.

----------

## ** Key Components**

### 1️⃣ **Client API (Request Submission)**

- A **REST API** or **GraphQL** endpoint for clients.
- Pushes job details to a queue (e.g., AWS SQS, Redis Queue, Kafka).
- Returns a **job ID** for tracking.

### 2️⃣ **Message Queue**

- **Purpose:** Decouples job requests from execution.
- **Options:**
- AWS SQS (Managed)
- RabbitMQ (Self-hosted)
- Apache Kafka (Streaming & event-driven)
- Redis (Simple in-memory queue)

### 3️⃣ **Worker Manager Service**

- **Listens to the queue** and **dynamically scales** workers.

- **Scaling logic:**
- More jobs in the queue → Spawn more workers.
- Few jobs → Scale down workers to save costs.

- **Deployment options:**
- Nomad (Alternative to Kubernetes)

### 4️⃣ **Worker Nodes**

- Execute tasks **asynchronously**.

- Process the job **based on workload type** (CPU-bound, I/O-bound).

- **Returns results** to a database, object storage, or the client directly.

### 5️⃣ **Notifications System**

- **When a job completes**, notify the client via:
- **WebSockets** (Realtime UI updates)

- **Webhooks** (Client provides a callback URL)

- **Email/SMS/Slack** (For user notifications)

### 6️⃣ **Status Tracking & Response**

- A **database stores job progress** (Redis, PostgreSQL, DynamoDB).

- Clients can **poll for job status** via API.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.