Mimir

Acme Commerce System Architecture

architecture
authentication
55c6e6dbd55f

architecture/system-architecture.md

Acme Commerce System Architecture

Acme Commerce is a modular commerce platform composed of five core services: Authentication, Checkout, Billing, Inventory, and Notification. The services communicate over HTTPS for synchronous reads and publish domain events to the platform event bus for asynchronous workflows.

The Authentication Service owns identity, sessions, OAuth provider integration, and JWT signing. Checkout validates carts, reserves inventory, calculates tax, and coordinates payment authorization. Billing captures payment, generates invoices, and emits settlement events. Inventory tracks stock counts, reservation leases, and warehouse synchronization. Notification sends customer email, SMS, and internal incident notifications.

Critical dependencies are Postgres for transactional state, Redis for short-lived locks and checkout carts, and the event bus for service-to-service propagation. The architecture favors explicit service contracts, service-level runbooks, and incident review documents for every Sev2 or higher outage.

Reliability Principles

  • Checkout never captures payment until Inventory confirms a reservation.
  • Billing is idempotent on payment_intent_id and invoice_id.
  • Authentication publishes key-rotation events 24 hours before active signing keys change.
  • Notification is non-blocking for order completion.