Architecture Overview

August 24, 2026 ยท View on GitHub

QuantDinger v5 separates HTTP request handling, long-running trading, scheduling, finite background jobs, and database migration into explicit process roles. PostgreSQL coordinates durable ownership; the two Redis tiers serve different reliability requirements.

Runtime ownership

SurfaceOwnsMust not own
backendAuthentication, validation, queries, durable command submissionTrading loops and long-running schedules
trading-workerStrategy runtimes, broker sessions, orders, leases, reconciliationPublic HTTP request handling
scheduler-workerPortfolio, deployment, payment, and notification schedulesGeneral Celery work
celery-workerFinite, serializable, retryable jobsPersistent trading runtimes
migrationOrdered schema updatesConcurrent API serving

State and coordination

  • PostgreSQL is the source of truth for commands, leases, heartbeats, audit records, strategies, and trading state.
  • redis is an evictable cache and must not hold durable queue state.
  • redis-jobs is the Celery broker/result tier, uses AOF and noeviction, and must be monitored for memory pressure.
  • Idempotency keys, database claims, renewable leases, and fencing tokens protect duplicate or stale execution.

Read by task

TaskDocument
Understand package and process ownershipBackend architecture
Preserve dependency directionModule boundaries
Change concurrent or durable workConcurrency model
Decide which process owns workProcess roles
Add routes, adapters, tasks, or servicesExtension guide
Change an HTTP contractAPI conventions

Before a large change, identify the owner process, source of truth, retry and idempotency behavior, and the test that proves the boundary remains intact.