Search code examples
cachingignitedistributed-caching

How to use Apache Ignite as a layer between Spring Boot app and MongoDB?


I have a Spring Boot application that uses MongoDB. My plan is to store data in a distributed caching system before it gets inserted into Mongo. If the database fails, the caching will have a queue and send to the DB once it is up. So, the plan is to make the caching layer in between the application and Mongo.

Can you suggest some ideas on how to implement this using Apache Ignite?


Solution

  • Take a look at write-behind cache store mode. It retries writing to the underlying database if insertion to the underlying DB fails. Let me know how it works for you.

    You can also implement a custom CacheStore for an Ignite cache that will do the caching and enable write through for it. If the connection is lost, then you'll be able to collect entries in a buffer, while retrying to establish the connection back.

    See more: https://apacheignite.readme.io/docs/3rd-party-store