Under what circumstances might a team deliberately choose NOT to fully split a database per service, or to relax strict data ownership boundaries, and what risk are they accepting by doing so?
answer
- benefit only materializes with real team/scaling divergence
- modular monolith / shared schema as a deliberate stepping stone
- shared reporting DB is fine if read-only, clearly derived
- premature split is expensive to walk back too
- enforce no-direct-query rule even while sharing a schema
basics
~20 sA small team with just a couple of services and no need for independent scaling might keep things simpler by sharing one database for now, accepting that they'll have some hidden coupling that could cause pain later if the team or system grows.
solid answer
~50 sStrict database-per-service pays off when services are owned by different teams, need independent deploy cadences, or need very different scaling or storage profiles — but that payoff comes with real cost, operational overhead, eventual consistency, duplicated infra, that isn't worth it for every situation. Teams reasonably relax the rule for: a small system where one team owns several services and premature splitting just adds distributed-systems tax without a coupling problem to solve; a shared read-only reporting database explicitly fed by CDC and clearly labeled as derived, not authoritative; or an early-stage product where domain boundaries are still shifting and locking in a hard schema split would be more expensive to later merge than to split out once boundaries stabilize. The risk accepted is exactly what the pattern defends against: schema changes becoming cross-team events, and a slow slide from a temporary shared table to full implicit coupling that's expensive to unwind later.
go deeper
Can recognize that not every project needs separate databases from day one and give a simple reason, such as a small team having less to manage.
Names at least one legitimate reason to share a schema temporarily, small team, evolving domain, reporting, and one risk of doing so.
Describes concrete guardrails, no direct cross-service queries, database grants, contract-like access rules, that keep a shared-schema period from becoming permanent coupling.
Makes and defends the build-vs-defer-the-split call for a real organization, weighing team topology, migration cost, and how to structure the eventual extraction so it isn't a multi-quarter rewrite.
## When the pattern actually pays Database-per-service is a tool aimed at a specific problem — letting different teams, or services with different scaling, reliability, or technology needs, evolve independently without coordinating on a shared schema — and like any tool, it pays for itself only when that problem is actually present. Its benefits, independent deployment, freedom to pick storage technology per service, fault isolation between services' data layers, materialize specifically when services are owned by different teams with different release cadences, or genuinely need different scaling profiles or storage engines. When those conditions aren't yet true, the pattern's real costs, operating and monitoring many databases instead of one, losing the ability to join or transact across services, and having to build and reason about eventual consistency for any cross-service view, can outweigh benefits that haven't kicked in yet. ## Three situations that justify relaxing the rule Three situations commonly justify deliberately relaxing the rule. 1. **The first is a small team** running a handful of logically-separate services that are, in practice, still one team's concern and deploy together or nearly together; splitting the database here adds distributed-systems overhead, network calls, eventual consistency, more infrastructure to run, to solve a coordination problem that doesn't yet exist, since there's no second team to coordinate with. This is the reasoning behind starting with a **modular monolith**, separate modules with disciplined internal boundaries sharing one deployable and often one schema, and splitting out services later once real organizational or scaling pressure appears. 2. **The second is a shared, explicitly read-only reporting or analytics database**, fed by CDC or ETL from each service's own database, used purely for dashboards and offline analysis; because nothing treats it as a live source of truth for runtime decisions and no service writes through it, it doesn't reintroduce the coupling the rule exists to prevent. 3. **The third is an early product stage** where the domain's real boundaries are still being discovered — locking in a hard database split along boundaries that turn out to be wrong is often more expensive to undo later than temporarily sharing a schema with disciplined access rules, since re-merging split databases and migrating their consumers back is a much bigger project than tightening access to an already-shared one. ## The trade-off runs both ways The trade-off of relaxing the boundary runs in both directions. | Direction | What it holds | |---|---| | What you gain | less operational overhead for a small team, the ability to run ad hoc joins and reports easily, lower cognitive load while the system and domain model are both still small and changing quickly, and avoiding real distributed-systems complexity, network partitions, message ordering, eventual-consistency bugs, before the system actually needs to pay for it | | What you risk | the exact coupling problem the pattern exists to prevent creeps back in gradually | Convenient direct queries become de facto contracts that nobody wrote down; the longer a shared schema lives, the more application code accumulates around it, so the eventual split gets harder, not easier, the longer it's deferred. ## How it goes wrong in practice The way this goes wrong in practice usually isn't a single bad decision but an accumulation: - a temporary shared table used by two services stays around because it always works, until the day both teams deploy conflicting schema migrations against it in the same week and cause an outage neither expected; - or a read-only analytics replica, originally meant only for dashboards, quietly becomes a dependency for a live feature when someone decides it's basically the same data and queries it for a real-time decision, silently recreating the integration-database problem through a side door; - or a team simply waits too long: by the time they actually need to split out a service for real scaling or ownership reasons, hundreds of queries across the codebase touch the shared tables directly, and the eventual migration needs a multi-phase project, temporary dual writes, backfills, contract tests, instead of a clean cutover. ## A pattern that keeps the later split cheap A concrete pattern that avoids most of this: a three-person startup runs Orders, Users, and Payments as separate deployable processes sharing one database instance and schema in year one, deliberately, because splitting into three managed databases isn't worth the overhead yet and the domain boundaries are still shifting weekly, but they enforce one rule throughout: **no process queries or writes another process's tables directly**, only in-process function calls that mirror what a future API would look like. A year later, when a second team is hired specifically to own Payments, partly for compliance-driven isolation, extracting Payments into its own service and database is mostly an infrastructure migration, because the application-level coupling that would have made it painful was never allowed to form in the first place.
- If a team shares a database schema across services during early development, what's the one rule they should still enforce to keep a later split feasible?No service, or its code, should query or write another service's tables directly — all cross-boundary access should go through an in-process API or method call that mirrors what a future network API would look like. Enforcing that logical boundary via code review, database grants, or module boundaries means the eventual physical split is mostly an infrastructure or migration exercise instead of a rewrite of scattered ad hoc queries.
- Is a shared analytics/reporting database that many services feed into via CDC a violation of database-per-service?Not typically, as long as it's explicitly read-only, clearly understood as a derived copy rather than a source of truth, and no service makes live business decisions by querying it. It becomes a violation only if a service starts treating it as a live dependency for transactional decisions, effectively turning the analytics store into an unversioned, ungoverned integration database.
- What's the risk of waiting too long to split a shared schema once real scaling or team divergence appears?The longer a shared schema lives, the more application code, queries, and habits accumulate around direct table access, so the eventual split requires untangling a much larger surface area, often needing a multi-phase migration, dual writes, backfills, contract tests, rather than a clean cutover. The team also risks an incident where two teams' uncoordinated migrations against the shared schema collide, which is exactly the coupling failure the pattern is meant to prevent.
Like a young company sharing one office floor before renting separate offices per department: it's cheaper and easier to coordinate while the org chart is still shifting, as long as everyone agrees not to walk into each other's filing cabinets uninvited. The risk is that habits form, people start relying on walking over instead of sending a request, and untangling that later, once departments actually need to move to separate buildings, is harder than if they'd never shared space.
saying these in an interview costs you the question
- Claims database-per-service should always be applied on day one regardless of team size or maturity
- Treats a shared reporting/analytics database as automatically fine even when other services start querying it for live decisions
- Has no enforcement mechanism in mind for a shared schema, relies purely on informal trust between teams
- Thinks relaxing the rule has no downside as long as it's 'just for now'
- Can't describe what makes the later split easier or harder based on how the shared period was managed