Microservices Distributed Caching

In this article, we are going to talk about Microservices Distributed Caching for Microservices Architectures. As you know that we learned practices and patterns and add them into our design toolbox. And we will use these pattern and practices when designing e-commerce microservice architecture.

By the end of the article, you will learn where and when to use Microservices Distributed Caching into Microservices Architecture with designing e-commerce application system.

Step by Step Design Architectures w/ Course

I have just published a new course — Design Microservices Architecture with Patterns & Principles.

In this course, we’re going to learn how to Design Microservices Architecture with using Design Patterns, Principles and the Best Practices. We will start with designing Monolithic to Event-Driven Microservices step by step and together using the right architecture design patterns and techniques.

Microservices Distributed Caching

We are going to talk about Microservices Caching. Caching is one of the important topic when you want your application faster.

Caching can increase performance, scalability, and availability for microservices. The main idea is reducing latency with cache and makes application faster. When the number of requests are increased, caching will be really important for accommodating whole requests with high availability.

If application request mostly comes for reading data that is not changes so frequently, then Caching will be so efficient. For example reading product catalog from e-commerce application can be cached in the architecture.

Caching also provide to avoid re-calculation processes. If one operations calculate by one server, then other application can consume calculated data from cache. In Microservices architectures are typically implement a distributed caching architecture.

Look at the above image. You can see that this is similar our microservice architecture. An API Gateway accommodate requests and invoke several internal backend microservices and aggregate them into 1 response.

So how we can increase the speed of this use case ?

Of Course we should use The distributed cache. The distributed cache increases system responsiveness by returning cached data.

Additionally, separating the cache server from the microservices, gives ability to independently scale up cache services. This can be very useful when increased traffic of requests.

You can also use in-memory cache in our microservices, but it is not efficiency like distributed cache due to scalability issues. So now we can use distributed cache in our e-commerce design.

Design the Architecture — Microservices Distributed Caching

We are going to design our e-commerce application with the Microservices Distributed Caching. We will iterate the architecture design one by one as per requirements.

As you can see that now we have used Distributed Caching in our e-commerce architecture. Now lets decide to Technology Stack in this architecture.

Of course we should pick; Redis.

Redis, which stands for Remote Dictionary Server, is a fast, open-source, in-memory key-value data store for use as a database, cache, message broker, and queue. Redis is Fast, open source in-memory data store for use mostly as a database and cache. So its good to use Redis in our architecture.

So we should evolve our architecture with applying other Microservices Data Patterns in order to accommodate business adaptations faster time-to-market and handle larger requests.

Step by Step Design Architectures w/ Course

I have just published a new course — Design Microservices Architecture with Patterns & Principles.

In this course, we’re going to learn how to Design Microservices Architecture with using Design Patterns, Principles and the Best Practices. We will start with designing Monolithic to Event-Driven Microservices step by step and together using the right architecture design patterns and techniques.

--

--

Design microservice systems using the right architecture design patterns and techniques. Handle millions of request with designing system for high availability, high scalability, low latency, and resilience to network failures on microservices distributed architectures.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mehmet Ozkaya

Software/Solutions Architect, Udemy Instructor, Working on Cloud-Native and Serverless Event-driven Microservices Architectures https://github.com/mehmetozkaya