Microservice Patterns | Design Patterns | Centralized Isolated State Database


Microservice and Containerization Patterns > State & Data Access Patterns > Centralized Isolated State Database
Home > Design Patterns > Centralized Isolated State Database

Centralized Isolated State Database (Erl, Naserpour)

How can solution-wide state be consistently provided when each microservice has its own dedicated state database?

Centralized Isolated State Database

Problem

Microservices that are part of or comprise a greater solution will commonly have dedicated state databases. Because state data is distributed in this manner, it can be challenging to access an accurate and current view of solution-wide state data for reporting and event notification purposes

Solution

An additional, centralized state database is introduced. All microservices feed their respective state data into the centralized state database, thereby establishing a “single source of truth.”

Application

The centralized “single source of truth” state database is deployed in its own containerized and isolated environment, capable of scaling with its usage requirements. The Microservice Layers pattern can be further applied to better organize the microservices providing input to the centralized state database.

A master state repository is positioned as the “single source of truth” because all microservices publish their state data to it in addition to recording it locally. This establishes an effective state tracking system that is isolated and resides outside of other microservice boundaries.

Centralized Isolated State Database: The microservices write the changes of the state updates in the external source of truth, which can track entire state changes and does not belong to any one microservice. All state updates are available in a location that can be queried in realtime, and can now be used to query the state of individual microservices or the solution as a whole.

The microservices write the changes of the state updates in the external source of truth, which can track entire state changes and does not belong to any one microservice. All state updates are available in a location that can be queried in realtime, and can now be used to query the state of individual microservices or the solution as a whole.

This pattern can be applied in conjunction with the Microservice Layers pattern as explained in the complete pattern description.

Module 10: Advanced Microservice Architecture & Containerization.

This pattern is covered in Module 10: Advanced Microservice Architecture & Containerization..

For more information regarding microservice and containerization courses and accreditation,
visit the Microservice Architect Certification program page..