Node-Boot Framework
  • πŸ‘‹Welcome to Node-Boot
  • πŸ’‘Why Node-Boot?
    • No CLI
    • No Boilerplate
    • Standardisation at its core
    • Spring-Boot Features Parity
  • πŸ₯‡Mission
  • πŸš€Getting Started
  • Letter to Developers
    • πŸ“Letter to Node.Js Developers
    • πŸ“Letter to Web3 Developers
    • πŸ“Letter to Spring-Boot Developers
    • πŸ“Letter to Node.Js Framework Developers
  • Fundamentals
    • 🧩Architecture
      • Overview
      • Bootstrap
      • Lifecycle
      • Application Context
    • πŸͺ„Core Features
      • Dependency Injection
      • Bean and Configuration
      • Configuration Properties
        • Static Configuration
        • Reading Configuration
        • Writing Configuration
        • Defining Configuration
        • Configuration Properties
      • Controller
        • Available Decorators
        • Custom Decorator
        • Versioning
      • Service
      • Component
      • Logging
      • Error Handling
      • Transactions
        • Transaction Principles
        • Transactions vs Concurrency
        • πŸ™ˆUsing Transactions
      • Middleware/Interceptors
      • Authorization
      • Marshalling vs Unmarshalling
    • πŸ—οΈAuto-Configuration
    • πŸ”Security
  • Servers
    • πŸš‚Servers Concept
    • πŸšƒAvailable Servers
      • Fastify
      • Express
      • Koa
    • πŸ”ŒIntegrate Server?
  • Starters
    • πŸ—οΈStarters Overview
    • 🎁Available Starters
      • Persistency
      • Validations
      • Actuator
      • Open API
      • Redis
Powered by GitBook
On this page
  1. Fundamentals
  2. Core Features
  3. Transactions

Transactions vs Concurrency

PreviousTransaction PrinciplesNextUsing Transactions

Last updated 1 year ago

Concurrency issues arise only when multiple transactions operate on the same data item. If transactions work on different data items, concurrency is not a problem. However, when multiple transactions are executed concurrently in an unpredictable manner, several issues can occur. Database transactions primarily involve two major operations: "Read" and "Write." Effectively managing these operations during concurrent transaction execution on the same data item is crucial to maintaining data consistency in the database.

Dirty Read

A transaction reads shared data that has been modified by another transaction but that transaction is not yet committed (Uncommitted data is read).

Phantom Read

When a user reads a set of records, and then another transaction inserts or deletes rows in the dataset being read. When the user reads the same set of records again, they may find new "phantom" rows that were not present during the initial read.

Non-repeatable read

Before transaction A is over, another transaction B also accesses the same data. Then, due to the modification caused by transaction B, the data read twice from transaction A may be different.

The difference between Phantom read and Non-repeatable read:

The key to non-repeatable reading is to modify: In the same conditions, the data you have read, read it again, and find that the value is different. The key point of the phantom reading is to add or delete: Under the same conditions, the number of records read out for the first time and the second time is different.

Isolation levels are used to solve various problems related with transactions concurrency. Check Node-Boot isolation levels for more details.

πŸͺ„
Transactions Concurrency.
Dirty Read
Phantom Read