Docker Community Forums

Share and learn in the Docker community.

Caching data for speed of access

In a more monolithic application, you can have a data cache for speed of access of data. So you can have three services withing the application reading and writing to the same caches.

But if I break it down into thee services. For a CurrencyExchange application I have say a client service , that contains client funds. I have a second service that reads in and stores currenyExchanges for clients. And I have a 3rd service that does the matching.

In a monolithic application I would have a cache of clientFunds and a cache of currenyExchange. The data would be persisted to a database or to the cloud. But there is no need to access a data storage apart from start up.

But with the three microservices, It looks that everytime the matching service is run it will have to load the currenyExchanges and ClientFunds from storage into a local cache for the lifetime of that container.

I have read that there is the idea of volumes, volumes is to persist data but can it be used as a cache, is reading and writing to a volume faster than reading and writing to another storage

I worked out the architecture, use a 3rd party cache such as Redis and load it as a image that your image can communicate with.