Caches are introduced in performance conversations and then live forever in correctness ones.
Ask the product question first
How long may this be wrong? For a product catalogue, minutes. For an account balance, not at all. For a permissions check, the honest answer is usually "never, and yet we cache it anyway", which is how people keep access after being removed from a group.
Write the staleness budget in the ticket, next to the latency target. They constrain each other.
Invalidation is hard because it is really a distributed consensus problem wearing a friendly name. Prefer short time-to-live over clever invalidation when you can afford it: a cache that expires is boring and predictable, while a cache that is invalidated has a bug you have not found yet.
1 Comments
Leave a comment
Sign in to leave a comment.
Signing in is unavailable right now.







Yara Mansour
January 28, 2025The permissions example is uncomfortably specific. We had exactly that incident last year.