The outer architectural building blocks are playing far more important role than the inner architecture of each microservice itself.
- In-memory database - a database system primarily residing in memory (SQL or NOSQL).
- In-memory data grid - distributed computing based caching system usually having KV (key-value) storage.
Note that to sustain data stored in in-memory database during deployments, a backup approach with file-system based storage is required.
- Pattern A - IMDB per microservice, where each microservice having its own storage
- Applicability: Greenfield development where you have opportunity to do microservices based architecture first
- Pros: Independent (inclusive of deployment flexibility) & completely in adherence to microservices principles
- Cons: Duplication of data across services
- Pattern B - IMDB as a shared component across multiple Microservices having common storage
- Applicability: Brownfield development where you are on a path to refactor monolith application to microservices
- Pros: Practical approach when you have shared data across services
- Cons: Not completely aligned with Microservices principles
- Pattern C - Hybrid of Pattern A or B (some microservices having shared database)
|Microservices Architecture - In-memory database design patterns|
- Microservices architecture - It promotes independence and less dependency for linear scalability (cluster of instances of microservice but clustering at layer level is not recommended).
- In-memory data grid - It relies on cluster of nodes (data layer) for horizontal scalability (nodes can be added/removed on need basis for scalability).
- Pattern A - In-memory data grid as event/messages store
- Applicability: Primarily for inter-microservice communication, this pattern can be leveraged.
- Pattern B - In-memory data grid as shared data
- Applicability: To store shared data such as backend system response (cached data), response data, content data, etc.
- Pattern C - In-memory data grid as storage
- Applicability: To store data in grid for a microservice and use partition approaches to separate data for each microservice
In-memory database & In-memory data grid solutions
|In-memory database & In-memory data-grid solutions|