Synthetic Technical Case

Order Events: Requests, Ownership, and Delivery

Arrows indicate layer grouping only. Node text defines specific dependencies, event routes, and data ownership.

Entry

Storefront

Synchronously calls the order service to create an order.

Payment Platform

Synchronously calls the callback service with a callback ID.

Layer grouping only
Services

Order State and Event Publishing

Order service: writes Order DB; publishes OrderCreated asynchronously; consumes PaymentConfirmed, committing payment status and consumed event ID together.

Callback Deduplication and Events

Callback service: writes Callback DB; acknowledges after commit; deduplicates by callback ID; publishes PaymentConfirmed asynchronously.

Inventory Reservation and Deduplication

Inventory consumer: receives OrderCreated asynchronously; commits reservation and consumed event ID together.

Layer grouping only
Resources

Order DB

PostgreSQL; only the order service reads and writes it. Order and outbox commit together; stores consumed event IDs.

Callback DB

Separate PostgreSQL; only the callback service reads and writes it. Callback ID and outbox commit together.

Inventory DB

Separate PostgreSQL; only the inventory consumer reads and writes it. Stores reservations and consumed event IDs.

Business Event Queue

At-least-once delivery. OrderCreated → inventory consumer; PaymentConfirmed → order service.