Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 618 Bytes

22-6-25---transactions-in-redis.md

File metadata and controls

17 lines (11 loc) · 618 Bytes

###Transactions in Redis

June 26th 2022

https://redis.io/docs/manual/transactions/

  • MULTI:

    • A Redis Transaction is entered using the MULTI command. The command always replies with OK.
    • redis queues all the commands u entered
    • Finally executed -> when EXEC is called
  • EXEC : returns an array of replies

  • DISCARD : to abort a transaction

  • WATCH: to provide a check-and-set (CAS) behavior to Redis transactions.

    • WATCHed keys are monitored in order to detect changes against them. If at least one watched key is modified before the EXEC command, the whole transaction aborts