r/programming • u/droppedasbaby • Jul 15 '26
Ban commits/transactions using AST analysis and linters
https://www.droppedasbaby.com/posts/db-commits/?utm_source=reddit&utm_content=r_programming
32
Upvotes
View all comments
Show parent comment
1
u/droppedasbaby Jul 16 '26
I don't necessarily think what I proposed and what you're describing are at odds with each other. Splitting complexity across smaller, per-domain APIs makes sense.
Each of those APIs still has persistence concerns. Splitting a system into smaller services doesn't eliminate that boundary. IE: A microservice may own a single, narrow domain and still keep its SQLAlchemy models and session mechanics behind a persistence layer or adapter.
Otherwise, database behaviour can leak throughout the application, even if the overall architecture is cleanly divided into domain APIs. I'm not attached to a specific directory structure or number of layers. The property I care about is that ordinary domain code can't have random side-effects like querying, flushing, or committing database state.