Skip to content

Kritagya123611/Adaptive-Control-Plane

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptive Control Plane (Helios)

A Distributed Control Plane for Background Job Execution with Runtime Configuration

Helios is not another job queue. It is a control-plane–first backend system that cleanly separates intent, state, and execution.
It is designed to model how modern infrastructure platforms (Kubernetes, Airflow, Temporal, AWS control planes) actually work under the hood.


Why Helios?

Most backend systems tightly couple:

  • API request handling
  • Execution logic
  • Runtime behavior

This coupling makes systems fragile, hard to scale, and difficult to modify without redeployments.

Helios deliberately breaks this coupling.

It introduces a Control Plane Architecture where:

  • APIs only capture intent
  • Workers only execute state
  • Runtime behavior is controlled dynamically

This design enables high availability, safer concurrency, and operational flexibility.


Core Architecture Philosophy

Helios is built around two orthogonal planes:

Global Control Plane

Responsible for:

  • Job ingestion
  • Persistent state management
  • Lifecycle tracking
  • Ownership arbitration

This plane is the source of truth.

Execution Plane (Workers)

Responsible for:

  • Polling and claiming work
  • Executing jobs
  • Respecting runtime policies

Workers are stateless and replaceable.

Runtime Feature Plane

Responsible for:

  • Dynamic configuration
  • Live operational controls
  • Behavior tuning without redeployments

System Flow

The system abandons traditional Request → Response execution in favor of an event/state-driven model.

graph LR
    Client -->|Intent| API[Ingress API]
    API -->|Persist State| DB[(PostgreSQL)]
    Worker[Worker Node] -->|Poll & Claim| DB
    Worker -->|Read Runtime Config| Config[Feature Flag Engine]

    subgraph "Execution Plane"
        Worker
    end

    subgraph "Control Plane"
        API
        DB
        Config
    end
Loading

Key Concepts & Features

Intent Capture Pattern

  • The API never executes jobs
  • Requests are acknowledged immediately
  • Jobs enter the system in a CREATED state

This guarantees:

  • Fast ingress
  • High availability
  • Backpressure resistance

Dynamic Runtime Configuration

Workers read runtime flags from a local Feature Flag Engine to control behavior at runtime:

  • Concurrency limits
  • Artificial delays
  • Maintenance mode toggles
  • Kill switches

All without:

  • Code changes
  • Redeployments
  • Restarts

Atomic State Transitions

Job claiming is performed using ACID-compliant SQL transactions:

  • Prevents double execution
  • Safely handles concurrent workers
  • Uses the database as a synchronization primitive

This mirrors how real-world schedulers and control planes operate.


Resilient Polling Model

Workers are designed to be fault-tolerant and self-healing:

  • Automatic backoff on empty queues
  • Graceful handling of database pressure
  • Safe recovery after crashes

No centralized coordinator is required.


Tech Stack

Layer Technology
Runtime Node.js, TypeScript
Database PostgreSQL (pg)
Infrastructure Docker, Docker Compose
Architecture Monorepo (api, worker, shared)


Roadmap & Future Work

Performance & Scalability

  • Redis hot queue (LPUSH / BRPOP)
  • Hybrid database + Redis scheduling model

Fault Tolerance

  • Distributed leasing with heartbeats
  • Zombie job detection
  • Automatic job re-queuing

Control Reconciliation

  • Janitor process to repair inconsistent state
  • Periodic audits of job ownership

Observability & Control

  • React-based dashboard
  • Live job state visualization
  • Feature flag toggling UI

What This Project Demonstrates

  • Control Plane vs Data Plane separation
  • Real-world scheduler design patterns
  • Safe concurrency using SQL
  • Operationally flexible backend systems
  • Backend architecture beyond CRUD

This project intentionally avoids heavy frameworks and abstractions, focusing instead on fundamental system design principles that scale to distributed systems.


Author

Built by Kritagya
Backend • Systems • Distributed Architecture

“Execution is temporary. Control is permanent.”

About

Adaptive Control Plane : Distributed Control Plane & Job Execution Engine A distributed system separating intent (API) from execution (Workers), powered by a runtime feature flag engine. Demonstrates observability-driven development, dynamic reconfiguration without redeploys, and resilient state management using TypeScript, Redis and PostgreSQL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors