Backend architecture for sensitive data
Boundaries and verification
Where each decision lives and how it gets checked: hexagonal architecture, value objects and tests that break the build.
1 article
A business rule that lives in the endpoint needs the app and the database to be checked; one that lives in the domain is checked in memory, with nothing running. This topic is about where each decision lives and how you verify it holds.
Start with hexagonal architecture in FastAPI, which gives the structure. Then what that structure doesn’t guarantee: the hexagonal boundary is not the trust boundary, the right identifier can arrive in the wrong parameter, and a PDF generator is an interpreter and should be treated as one.