What is a transaction?
A GQL transaction is a sequence of operations that either all succeed or all fail as a unit, ensuring no partial changes are made to the GQL catalog or graph data.
Types of transactions in databases
Databases offer various transaction types:
- Serializable transactions: Only one transaction executes at a time in a strict serial order. This ensures data consistency and prevents issues such as dirty reads and phantom reads. Due to their strict requirements, they come with higher performance costs. They are commonly used in banking systems to prevent problems such as double-spending.
- Concurrent transactions: Multiple transactions run simultaneously, offering better performance. They rely on different concurrency control mechanisms to maintain data correctness based on the scenarios. For example, in banking transactions, the database should enforce a serializable isolation level to ensure correctness when multiple operations attempt to modify...