educative.io

What is a global cache?

Can you give an example for a global cache?

Hi @Yaron_Kufert, imagine an environment where you must keep tracking of user sessions and you have a cluster of servers managing this user sessions (let’s say 5 servers). Every time a user access your site, the request can be handled by anyone of the 5 servers. If you don’t have any session control (i.e. LB with sticky session or a global cache) the user has 80% (4/5) of chances to authenticate again and loose the data (i.e. the shop basket). A global cache will be caching all requests of all servers, so don’t matter which server will be handling your requests, it just have to check the global cache to see if the user has already a session stablished. Hope this helps.

Artur Baruchi

How is this distinct from a distributed cache? (they are mentioned as 2 distinct solutions without explanation in the text)

1 Like