Data in Microservices
Managing data across multiple independent services is fundamentally different from monolithic architectures. Each service needs its own data storage, boundaries, and consistency mechanisms. This section covers the key patterns for handling data in distributed systems.
📄️ Database Per Service
Isolate service data with dedicated databases to maintain independence and prevent tight coupling.
📄️ Transaction Boundaries and Sagas
Coordinate distributed transactions across services using choreography and orchestration patterns.
📄️ Outbox, Inbox, and Change Data Capture
Ensure reliable event publishing and delivery with outbox, inbox, and CDC patterns.
📄️ CQRS and Read Models
Separate read and write models to optimize for different access patterns and enable flexible data transformation.
📄️ Event Sourcing
Store the complete history of changes as immutable events rather than storing only the current state.
📄️ Data Replication, Sharding, and Partitioning
Scale data storage horizontally by distributing data across multiple databases and replicas.
📄️ Schema Evolution and Versioning
Evolve data schemas safely without breaking clients as systems change over time.