Architecture

📖 1 min read 📄 Part 3 of 10

Resource Allocation Service - System Architecture

High-Level Architecture

┌─────────────────────────────────────────────────────────┐
│                  Client Applications                     │
└─────────────────┬───────────────────────────────────────┘
                  │
        ┌─────────▼─────────┐
        │   API Gateway     │
        │  (Load Balancer)  │
        └─────────┬─────────┘
                  │
    ┌─────────────┼─────────────┬─────────────┐
    │             │             │             │
┌───▼────┐  ┌────▼───┐  ┌─────▼──┐  ┌───────▼────┐
│Allocator│ │Allocator│ │Allocator│ │ Allocator  │
│ Node 1  │ │ Node 2  │ │ Node 3  │ │  Node N    │
└───┬────┘  └────┬───┘  └────┬───┘  └──────┬─────┘
    │            │           │             │
    └────────────┴───────────┴─────────────┘
                 │
        ┌────────▼────────┐
        │ Resource State  │
        │  (etcd/Redis)   │
        └────────┬────────┘
                 │
        ┌────────▼────────┐
        │  Metrics Store  │
        │  (Prometheus)   │
        └─────────────────┘

Core Components

Allocation Manager

Responsibilities:
- Process allocation requests
- Apply scheduling policies
- Track resource usage
- Handle preemption
- Enforce quotas

Resource Tracker

Tracks:
- Available resources
- Allocated resources
- Resource utilization
- Tenant quotas
- Historical usage

Scheduler

Policies:
- Fair share scheduling
- Priority-based allocation
- Gang scheduling
- Backfilling
- Preemption logic

This architecture provides scalable, fair, and efficient resource allocation across distributed systems.