Database per Service
ELI5 — The Vibe Check
Database per service means each microservice gets its own private database that nobody else can touch. No shared tables, no direct queries across services. If you need data from another service, you ask nicely through its API. Good fences make good neighbors.
Real Talk
A microservices pattern where each service owns and exclusively manages its own database, with no direct cross-service database access. This ensures loose coupling, allows each service to choose the optimal database technology (polyglot persistence), and eliminates tight data coupling. Cross-service queries use API composition or events.
When You'll Hear This
"Database per service means the order service can use PostgreSQL while the search service uses Elasticsearch." / "The hardest part of database-per-service is implementing queries that previously were simple SQL joins."
Related Terms
API Composition
API composition is when one service calls several other services and smooshes the results together into one response.
Microservice
Microservices is an architecture where instead of one big app, you have many tiny apps that each do one thing.
Shared Database
Shared database is when multiple services all read from and write to the same database.