In addition to the default cache functionality (like
set), Scrapbook comes with a
few neat little features. These are all implemented in their own
little object that implements KeyValueStore, and wraps around a
KeyValueStore. In other words, any feature can just be wrapped
inside another one or on top of any adapter.
BufferedStore helps reduce requests to your real cache. If you need the request the same value more than once (from various places in your code), it can be a pain to keep that value around. Requesting it again from cache would be easier, but then you get some latency from the connection to the cache server.
TransactionalStore makes it possible to defer writes to a later point in time. Similar to transactions in databases, all deferred writes can be rolled back or committed all at once to ensure the data that is stored is reliable and complete. All of it will be stored, or nothing at all.
A cache stampede happens when there are a lot of requests for data that is not currently in cache, causing a lot of concurrent complex operations. Stampede protector will make sure only the first process executes and the other processes just wait, instead of crippling the server.
When you have too much data for (or requests to) 1 little server, this'll let you shard it over multiple cache servers. All data will automatically be distributed evenly across your server pool, so all the individual cache servers only get a fraction of the data & traffic.