Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

ADR-001: Persist Quartz scheduling state in PostgreSQL

The Scheduler System uses PostgreSQL as the authoritative durable store for Quartz schedules, trigger state, coordination, and execution diagnostics.

October 27, 2026AcceptedData

1. Context & Problem

Background schedules—such as recurring maintenance and batch processing triggers—must survive service restarts and deployments. Storing schedules only in a service’s temporary memory would erase job definitions, timing state, and run history every time the service restarts, leaving teams unable to recover or diagnose missed runs. In addition, deployments with multiple scheduler instances need a reliable shared coordination mechanism so due jobs are claimed cleanly without collisions.

2. Business Value

  • Operational continuity: Scheduled work and trigger timings survive deployments and unexpected restarts without manual reconfiguration.
  • Safe multi-instance scaling: Multiple scheduler instances can run concurrently using shared coordination locks so jobs are neither missed nor double-triggered.
  • Faster incident diagnostics: Operations teams can review recent execution and missed-run history after restarts to investigate delayed or failed triggers.
  • Clear data ownership: Keeps internal scheduling mechanics isolated from business domain systems.

3. How It Works

  1. All job definitions, trigger schedules, instance check-ins, coordination locks, and recent execution and missed-run histories are persisted in a dedicated relational database owned by the scheduler system.
  2. When multiple scheduler instances run together, they coordinate through shared database locks so only one instance claims each eligible trigger firing.
  3. All schedule updates must go through the scheduler’s supported management interfaces rather than editing underlying storage directly, protecting coordination and lock integrity.
  4. The scheduler store is the authority on when a job was eligible to run and whether the scheduler attempted to fire it—not on whether the downstream business task ultimately succeeded.
  5. Execution history is retained for 30 days (up to 100,000 entries per scheduler) to support operational diagnostics while bounding storage growth.

4. Trade-offs & Lessons Learned

  • Database availability becomes mandatory: The scheduler cannot start or run without its database, introducing ongoing responsibilities for schema migrations, availability, capacity planning, and access control.
  • Diagnostic evidence, not an indefinite business ledger: The 30-day / 100,000-entry retention window limits how far back operators can inspect history, and a recorded firing does not prove a downstream system finished its work.
  • Strict ownership boundaries: Other systems must never query internal scheduler tables to infer business state, and operators must avoid direct storage edits that could bypass trigger and lock rules.
  • Alternatives considered:
    • Store schedules only in process memory: Avoids a database dependency, but loses schedules, trigger state, and coordination on restart and cannot support shared multi-instance state.
    • Use the scheduler database to record downstream business outcomes: Blurs system boundaries; receiving systems own validation, queues, and durable business outcomes.
    • Edit scheduler tables directly: Risks bypassing supported state transitions and locking behavior.

5. Technical Reference

  • Decision status: Accepted (2026-10-27)
  • Persistent store: Scheduler DatabaseContainerv1.0.0Scheduler DatabaseAuthoritative PostgreSQL database owned by the Platform bounded context for Quartz.NET job definitions, cluster locks, e...Ownerplatform-engineering-teamDiagramOpen docs (PostgreSQL database owned by Scheduler SystemSystemv1.0.0Scheduler SystemInternal Quartz-based platform system that persists schedules, coordinates recurring jobs, and dispatches background wor...Ownerplatform-engineering-teamDiagramOpen docs)
  • Authoritative Quartz state: Job details, triggers, fired triggers, scheduler check-ins, locks, execution history, and misfire history.
  • History retention: 30 days, up to 100,000 entries per scheduler, as documented by the Scheduler Database resource.
  • Operational constraints:
    • Quartz tables are implementation-owned infrastructure; schedule modifications must use the Scheduler’s supported management APIs/surface rather than direct SQL edits.
    • Quartz persistence is the source of truth for schedule eligibility and recorded execution lifecycle, not for downstream business completion or target-system queues/outboxes.