Redis: locking vs transactions
Nov. 6th, 2012 10:27 pmSuppose we need to load data from Redis, change it, and save it back. Looks easy. Here's the pseudocode.
Now, we notice that several threads (processes, execution contexts, whatever) may access the same data, and overwrite it! So, let's use transactions.
( Read more... )
data = redis.get(id); do_stuff(data); redis.set(id, data);
Now, we notice that several threads (processes, execution contexts, whatever) may access the same data, and overwrite it! So, let's use transactions.
( Read more... )