Refactoring the Database
In the previous chapters, we explored how to use CQRS and event sourcing to break apart a monolithic application, allowing services to align with specific bounded contexts in a microservices architecture. However, while separating application logic is a crucial step, the database itself often remains a bottleneck, tightly coupled and shared across services. For a true transition to microservices, database refactoring is essential to ensure that each service has control over its own data and operates independently.
In this chapter, you’ll learn about the primary patterns for database refactoring, each addressing different strategies for managing and partitioning database tables to support service-specific ownership. We are going to cover how to do the following:
- Clearly identify and align domain boundaries to support independent service evolution
- Apply common table ownership strategies to manage data shared across multiple services...