SET
The Redis command that stores a value under a key, optionally with an expiry or only if the key does not exist.
In more detail
Writing the new value with SET during invalidation can race with another writer and leave an older value cached; deleting with DEL cannot lose that race. With its only-if-absent option, SET is also a conditional write.
Related terms
- DEL — The Redis command that deletes one or more keys.
- Redis — A very fast in-memory data store used for shared caches, rate-limit counters, session data and pub/sub messaging.
- conditional write — A write that only succeeds if the current value still matches a stated condition, such as the key being absent.
Taught in
- Cache Invalidation And The Three Hard Cases — Scalable System Design & Distributed Architecture