Redis is an amazing global datastructure server. The fact that it’s global, makes it ideal for a multi-process or multi-threaded system, to get some concurrency action going. This also means, that a lot of the cautions that need to be taken while working in a shared memory system also apply to a situation where redis is operating in a concurrent/distributed environment. In this article, I am going to glaze over a couple of gotcha’s to watch out for when working with Redis.
I’d say it slightly different: even if Redis is single-threaded, if you’re not using Redis MULTI/EXEC, there can be a lot happening on the Redis server between two client operations. The answer to concurrency is either immutability, locks, or atomic operations/transactions.
The Hacker News discussion
Original title and link: Concurrency and Redis ( ©myNoSQL)