2023-03-18 18:28:31

Intially the database should be shared with the monolithic application and microservice, but over time database should be decomposed so that elements for the microservice are migrated into the microservice's own database.

Shared Database

  • This allows rollback to the monolithic version of the capability of new microservice goes wrong.
  • Sharing database is only short-term to evaluate new microservice.
  • Long-term all microservices should have their own database.
  • The easier approach is to decompose monolith into microservices first and then decompose the database at the end.

Decomposing the database is one of the most complex and challenging activities faced during the microservices transitioning strategy.

Using Shared database via abstraction the microservice accesses the existing database via database views and stored procedures. This forces us to think about exactly how our microservice uses the shared database.

Tip. Assign the new Views and Stored Procedures to a Schema particular to the microservice. If this is not possible the names with the initials of the microservice.

Copyright © 2025 delaney. All rights reserved.