Skip to main content

Architecture

This document describes the architecture of the Timer service.

Goals

  • Precise scheduling with low drift
  • Scalable timers for millions of users
  • Fault-tolerant execution

High-Level Diagram

Components

  • Scheduler: manages timer creation, updates, cancellations
  • Queue: durable timer events (e.g., RabbitMQ/Kafka)
  • Workers: consume due timers and execute callbacks/webhooks
  • DB: persistence, deduplication, idempotency keys
  • API: create/list/cancel timers, WebSocket for real-time status

Non-Functional

  • At-least-once execution with idempotent callbacks
  • Dead-letter queue for failures
  • Observability with metrics on due vs executed