![]() |
VOOZH | about |
A NoSQL originally referring to non SQL or nonrelational is a database that provides a mechanism for storage and retrieval of data. In this article, we will see NoSQL transactions. There are some features of NoSQL:
Here transactional semantics are described in terms of ACID properties:
NoSQL database maintains all these properties, Here in Consistency database provides various different consistency policies. At one end application can specify the absolute consistency which actually guarantees that all reads return the most recently written value for a given designated key. wherever at the other end application has the capability to tolerate the inconsistent data and can specify weak consistency.
Isolation's main aim is to ensure that an operation is independent of other concurrent operations and even has the capability of optimistic/pessimistic locking.
Durability mainly tells us that data is stored in a case when the system failure occurs. In durability the data is durable enough if the disk fails the data can be stored in any other case memory even the memory sometimes can be crashed but if data is durable the data can be saved anywhere and can be fetched when it is to be used.
These all acid transactions we read above have to ensure the highest possibility for reliability and integrity of data. These acid transactions ensure that our data never falls into an inconsistent state because the operation or task is only partially completed or cannot be completed. ACID properties provide correctness and consistency to our database.
We discuss the working of ACID transactions by taking the example :
We have to send 50 from S1 to S2 so we have to know here how the ACID transaction works in such an operation:
1. Atomicity: The atomicity ensures that the full operation takes place or is aborted back. It ensures that both operations take place or neither even one cannot take place.
2. Consistency: Consistency property ensures that the integrity of transactions is maintained properly. Such as:
3. Isolation: Isolation ensures that if the two transactions are going on no other transaction can be accessed between them. It means two operations can be done at one time and no other operation or task can interfere with them.
Such as if two operations such as A - 50 and B + 50 are working no third transaction can interfere with them.
4. Durability: As we discussed above one time it completes the operation cannot be reversed after it. If all transactions are completed it cannot go back to its previous steps.