berkeli / immersive-go

Creative Commons Zero v1.0 Universal
10 stars 0 forks source link

Distributed Systems Section 2 #22

Open berkeli opened 2 years ago

berkeli commented 2 years ago

Read the doc

berkeli commented 2 years ago

Questions:

berkeli commented 2 years ago
illicitonion commented 1 year ago

Good insights!

  • What is a TTL used for in caching?

    • Time to live, the amount of time cache should be kept in memory after which it will be removed from memory.

"removed from memory" is interesting phrasing here. There are two different styles of TTLs: "remove this from memory after this time" and "consider this entry invalid (but don't necessarily remove it from memory) after this time" - can you think when each may be more useful?

Also, can you think of a strategy for bounding the size of a cache which doesn't involve a TTL?

  • Why should we cache in a standalone cache service, as opposed to within our application?

    • Our application can potentially have many deployments, updates and all of them would refresh cache when code is deployed and machine restarts.

This is a good reason - can you think of others?