-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Persistence Best Practices for Java Applications
By :

The use of microservices architecture has become increasingly popular because it allows you to create scalable and flexible systems. This approach involves breaking down applications into smaller, independent services that can be developed, deployed, and scaled individually. However, despite its many advantages, sharing databases across multiple services can pose challenges and disadvantages.
The following figure illustrates a sample where three applications share the same database. In the short term, we can imagine that this will save us some power resources, but in the long term, we start wondering about the price. If we create an inconsistent data event, how do we know which application contains the bug? We may also have security issues, such as unauthorized data access:
Figure 10.4: Shared database in a microservice
Multiple microservices sharing a database can introduce several challenges and drawbacks. These...