Data ownershipmedium3-5 years
"Orders with customer names" used to be one JOIN. Once orders and customers are separate services with separate databases, what are the actual options for that query, and why isn't "let orders read the customers table directly" one of them?
A service owns its data and nobody else reads its tables — the moment a second service reads customers directly, that schema becomes an interface nobody declared, and a column rename or a new index added for one service's workload can break or slow the other at any time, with neither team able to deploy independently anymore. The real options are all more work than a JOIN: the order service holds its own copy of the customer's name, kept current by consuming the customer service's events; the caller composes the two services' APIs at read time; or a read model is built from both services' events specifically to answer this kind of cross-entity query.
PreviousA mobile app currently calls eleven different service hosts directly, each with its own certificate and auth flow. What does putting an API gateway in front of them actually buy, and what's the test for whether a piece of logic belongs there?Next A topic named `SendInvoiceEmail` is consumed by both the `email` service and an `audit` service. What's wrong with this design, and how do you tell an event from a command in general?