...

Big Data - Redis

Back to Course

Lesson Description


Lession - #1184 Redis Transaction


Redis Transactions permit the execution of a gathering of orders in a solitary advance, they are based on the orders MULTI , EXEC , DISCARD and WATCH . Redis Transactions make two significant ensures: All the orders in an exchange are serialized and executed successively.

Redis transcations permit the execution of a gathering of orders in a single step. Following are the two properties of Transactions.

  • All orders in an transcation are sequentially executed as a solitary secluded activity. It is not possible that a request issued by one more client is served in the execution of a Redis transcation.

  • Redis transcation is additionally nuclear. Nuclear means either the orders in general or none are processed.



    Example

    
    redis 127.0.0.1:6379> MULTI 
    OK 
    redis 127.0.0.1:6379> SET tutorial redis 
    QUEUED 
    redis 127.0.0.1:6379> GET tutorial 
    QUEUED 
    redis 127.0.0.1:6379> INCR visitors 
    QUEUED 
    redis 127.0.0.1:6379> EXEC  
    1>
    OK 2>
    "redis" 3>
    (integer>
    1