O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up our distributed caching using redis

To understand the caching mechanism let's take a practical example and implement distributed caching. We will evolve around the shopping cart example. As dividing business capabilities in to different services is a good thing, we are dividing our inventory service and checkout service into two different services. So whenever a user adds anything to cart, we will never persist the data, but rather store it temporarily as this ain't permanent or functionality changing data. We would persist such kind of ephemeral data into Redis as its read efficiency is super awesome. Our solution for this problem would be divided in to following steps:

  1. First we focus on setting up our redis client. Like everything ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required