redis, transaction

 

 

In many Internet product applications, some scenarios need to be locked, such as: spike, global incremental ID, floor generation, etc. Most of the solutions are implemented based on DB. Redis is a single-threaded mode, using queues to turn concurrent access into serial access, and there is no competition between multiple clients connecting to Redis.

 

 

Redis commands are executed serially, do one by 

 

 

http://blog.csdn.net/preterhuman_peak/article/details/40619857

 

Redis transaction: mulit, command1, command2, ... exec transaction is equivalent to concatenating multiple commands together in sequence and will not be interrupted by other requests

The transaction will only execute the queued request when it encounters exec

 

======================

 

Transactions look beautiful, but in the real environment, the company uses codis to improve the capacity, performance and stability of redis, and codis does not support transactions! ! !

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326958439&siteId=291194637