cachingredismemcachedspring-cache

Once data is cache , make it available for other microservice


There are multiple microservice that consume common data. So if i microservice is accessing data then it should be cache at 1 place and other microservice can refer to that cache data . Please help me with architecture design. Is there any other way we can keep common data. ( data will be decided at runtime it is not static data ) Thanks

There is an option for a centralized cache but I am not sure how that will be the architecture and which cache will be suitable


Solution

  • All you need is a centralized storage engine. There are multiple options you can choose from:

    For your microservices architecture, you can implement a data access service in front of your data storage to avoid direct connections from multiple services, protecting your data by not exposing the data source to all services. All other services will then request data from the data access service to access the shared data.

    Alternatively, if simplicity is not a concern, you can directly connect to the data source with all microservices in need

    enter image description here