TaskMesh
Distributed Workflow Orchestration Engine
Role
Lead Engineer: queue topology, consumer groups, worker pool, idempotency engine
Primary Stack
Python · FastAPI · Redis Streams · PostgreSQL · Prometheus · Docker
“Process arbitrary background tasks across concurrent workers without dropping a single job during traffic spikes or partial worker crashes on a single low-cost node.”
Had to run efficiently on a single low-cost VPS without heavy clustering software
No external message broker cluster available: build lean from scratch
Zero tolerance for task loss under worker crash or node reboot
Why Redis Streams over RabbitMQ / Celery?▼
RabbitMQ requires a separate Erlang runtime, complicated cluster persistence setup, and memory overhead we could not spare on a constrained VPS. Redis Streams gave us Consumer Groups, message acknowledgement (XACK), and a durable append-only log with sub-millisecond dispatch within the existing Redis instance.
Why PostgreSQL for state transitions vs. Redis alone?▼
While Redis is ultra-fast, Redis memory is volatile without heavy AOF syncing. State transitions (PENDING to PROCESSING to COMPLETED to FAILED) require ACID compliance and idempotency keys to ensure that crashed workers never execute duplicate side effects upon restart.
Distributed System Architecture
Explore the multi-tier topology below. Switch between the interactive blueprint canvas, standard Mermaid.js flowcharts, and the step-by-step request simulator.
Event-driven distributed task execution pipeline with Redis Streams message broker, stateless worker consumer groups, and PostgreSQL ACID idempotency verification.
Engineering Post-Mortem & Next Iteration
I would add dead-letter queues from day one because we lost 3 hours debugging a poison pill message causing cascading consumer failures. I would also expose metrics via OpenTelemetry instead of raw Prometheus scraping, and add per-task replay capability.