Tuesday, November 22, 2016

Why In-memory computing plays an important role in Microservices Architecture?

Microservices is the new architecture paradigm everyone is talking about, but it comes with its own set of complexities. As our industry gets more matured about using Microservices architecture, one of the key learnings coming out as:
The outer architectural building blocks are playing far more important role than the inner architecture of each microservice itself.
I will be sharing my perspective on microservices' outer architectural building blocks (In-memory computing & caching, API Gateway, Containers, DevOps & Cloud Computing) in a series of upcoming blog posts. This blog post is focused on "in-memory computing technology", which plays an important role in microservices architecture.

In-memory computing, in itself, is a vast technology domain but in the context of microservices architecture, I would like to keep it focused on following solution offerings:
  • 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.

In-memory database (IMDB)
In-memory database plays a collaborative role in microservices architecture as usually it can be deployed independently and provides highly efficient storage support to microservices. 

Note that to sustain data stored in in-memory database during deployments, a backup approach with file-system based storage is required.

These are following key design patterns, which can be applied in the context of in-memory database:
  • 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

In-memory data grid (IMDG)
In-memory data grid relies on distributed computing using clustering as underlying approach and provides a shared component (grid) for CRUD operations using memory.

As microservices architecture recommends independent deployable units with minimal shared data, in-memory data grid is not completely aligned to this architectural approach. However, in-memory grid products can provide independent cache nodes to respective microservice with variation of distributed cluster to store backup data in the grid.
In nutshell, conceptually these are different approaches:
  • 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).

Because of the above reason, vendor like Oracle has started their cloud roadmap with less emphasis on Oracle Coherence for microservices architecture and more on cloud based offering for Cache-as-a-service, which can be easily integrated with microservices Architecture. However, this is also similar to common grid solution with variance that cloud is now playing the common grid. Also, In-memory grid solution is still relevant and playing its role behind the scenes (to support cloud's cache-as-a-service). 

From applicability perspective, following patterns can be leveraged for microservices architecture along with in-memory datagrid solution:
  • 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

To conclude, in-memory computing plays a significant role for Microservices architecture as an underlying storage mechanism for each microservice. Also, in-memory grid computing offers an alternative solution, which respects microservice's principle of independence up to certain extent and provides a out-of-the-box solution to solve inter-communication & storage challenges for microservice architecture.


 In-memory database & In-memory data grid solutions
In-memory database & In-memory data-grid solutions


  1. There are some internal grid implementations that operate like clouds (these were built as greenfield implementations), but I'd bet that you could count on the fingers of one finger the number that have done anything similar for more general purpose systems. Most large enterprises cannot even count how many servers they've got deployed, let alone what they're used for (if anything) or pay as you go.

    create a private cloud

  2. Insightful information shared. One can also get the list of top 20 architecture colleges in india only at SMMCA Nagpur. Thanks for posting.

  3. I think that thanks for the valuabe information and insights you have so provided here. how to activate sim card online

  4. Really good information to show through this blog. I really appreciate you for all the valuable information that you are providing us through your blog. Google cloud computing online training

  5. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.

    aws training in chennai

    advanced aws training in chennai

  6. It was so nice article. I was really satisfied by seeing this article. google cloud online course Hyderabad

  7. Thorough and insightful as always :)

    wireless network solutions in dubai

    wireless network solutions in dubai

  10. This comment has been removed by the author.

  11. Thanks for sharing nice information and nice article and very useful information.....
    Microservices Online Training
    Microservices Training in Hyderabad

  12. I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts.
    Cyber Security Projects for Final Year

    JavaScript Training in Chennai

    Project Centers in Chennai

    JavaScript Training in Chennai

  13. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    best angular js online training

  14. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    workday studio online training