Settings

Theme

How Etsy caches: hashing, Ketama, and cache smearing

codeascraft.com

58 points by micahgoulart 8 years ago · 2 comments

Reader

stevekemp 8 years ago

Cache smearing seems like it would suffer from the obvious problem of invalidation. The solution they come up with is rather than having a piece of data associated with one cache key "foo" it is associated with "foo0, foo1, foo.., foo8".

If you have one key you can just delete it, but now you have to do that on all the possible versions of the key.

(Of course if they're relying upon TTL settings for expiration then this doesn't matter.)

  • metabrew 8 years ago

    if you delete the key near the code that sets/smears it, it's easy to just delete the range of keys: key1, key2, key3.. as needed

    You can send all such commands to memcached at once, so you don't suffer more than one round-trip to multi-delete.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection