Powered by Redis: StackOverflow Caches
Posting about this Redis-based StackOverflow demo/clone, reminded me that StackOverflow is actually using Redis for site-level and global caches:
- A “local cache,” which can only be accessed from 1 server/site pair
- Contains things like user sessions, and pending view count updates
- This resides purely in memory, no network or DB access
- A “site cache,” which can be accessed by any instance (on any server) of a single site
- Most cached values go here, things like hot question id lists and user acceptance rates are good examples
- This resides in Redis (in a distinct DB, purely for easier debugging)
- A “global cache,” which is shared amongst all sites and servers
- Inboxes, API usage quotas, and a few other truly global things live here
- This resides in Redis (in DB 0, likewise for easier debugging)
It is kind of impressive to read engineers expressing feelings like (nb: when they know what they are talking about):
Redis is so fast that the slowest part of a cache lookup is the time spent reading and writing bytes to the network. This is not surprising, really, if you think about it.
Original title and link: Powered by Redis: StackOverflow Caches (NoSQL databases © myNoSQL)