wtf( )unctionsystem design, drawn
← all problemsArchitectureHard

Two services, one table

Orders and Billing were split into separate services with separate deploys and separate teams. Both still read and write the orders table, because that was the fastest way to ship the split.

A column Billing needed was added by Orders. A migration by Billing broke Orders at 3am. Neither team can change the schema without the other, which is the thing the split was supposed to end.

Give Billing a way to get what it needs that doesn't reach into another service's storage.
Components — tap one, then tap a slot on the diagram
!A migration by one team broke the other service at 3am. Neither can change the schema alone.

Boundaries, outermost first: Orders service: Orders (owns the data) Billing service: Billing (reaches into it; FAILED: coupled) Outside every boundary: orders table, an empty slot for the how Billing learns about orders Connections: Orders calls orders table — sole owner (step 1) Orders publishes to how Billing learns about orders — publishes (step 2) how Billing learns about orders publishes to Billing (step 3) Billing must NOT reach orders table — no direct access

Ordersowns the data
orders table
Billingreaches into itcoupled