Reader small image

You're reading from  Learning Redis

Product typeBook
Published inJun 2015
Reading LevelIntermediate
Publisher
ISBN-139781783980123
Edition1st Edition
Languages
Right arrow
Author (1)
Vinoo Das
Vinoo Das
author image
Vinoo Das

Vinoo Das has 16 years of experience in the software industry and has worked in various domains, such as telecom, banking, payment gateways, information management, and so on. He is highly motivated and loves to work on new and upcoming technologies. He is currently architecting a platform for an information technology giant, which will enable the company to position the platform at an enterprise level as well as a cloud solution.
Read more about Vinoo Das

Right arrow

Transactions in Redis


Redis as a NOSQL data store provides a loose sense of transaction. As in a traditional RDBMS, the transaction starts with a BEGIN and ends with either COMMIT or ROLLBACK. All these RDBMS servers are multithreaded, so when a thread locks a resource, it cannot be manipulated by another thread unless and until the lock is released. Redis by default has MULTI to start and EXEC to execute the commands. In case of a transaction, the first command is always MULTI, and after that all the commands are stored, and when EXEC command is received, all the stored commands are executed in sequence. So inside the hood, once Redis receives the EXEC command, all the commands are executed as a single isolated operation. Following are the commands that can be used in Redis for transaction:

  • MULTI: This marks the start of a transaction block

  • EXEC: This executes all the commands in the pipeline after MULTI

  • WATCH: This watches the keys for conditional execution of a transaction

  • UNWATCH: This...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Redis
Published in: Jun 2015Publisher: ISBN-13: 9781783980123

Author (1)

author image
Vinoo Das

Vinoo Das has 16 years of experience in the software industry and has worked in various domains, such as telecom, banking, payment gateways, information management, and so on. He is highly motivated and loves to work on new and upcoming technologies. He is currently architecting a platform for an information technology giant, which will enable the company to position the platform at an enterprise level as well as a cloud solution.
Read more about Vinoo Das