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

Caching and error handling

In order to have maximum optimization and performance, caches are often introduced in distributed systems. Redis has seen a huge increase as it is lightweight and can serve the purpose of cache very well. Further, in some business capabilities, stale data can be tolerated in the age of offline first. API Gateway can take care of this part, providing a cached response if the microservice is down or to prevent too many database calls. The golden rule while designing a cache mechanism can be those service calls which never actually need to be made should be the fastest calls. For example, consider the Avengers 4 page is updated in IMDB. It's getting more than 20,000 hits per second.

The database is hammered with these ...

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