Transaction

2025. 7. 31. 23:54·Computer Science/Database

A transaction in a database refers to a unit of work that performs a single logical function,

which is a group of multiple queries bundled together.


In databases, a transaction is a series of operations or queries that form a single logical unit of work.

These operations ensure the database remains consistent by following the ACID properties:

  • Atomicity
  • Consistency
  • Isolation
  • Durability

Atomicity (원자성)

Atomicity guarantees that all the operations in a transaction are completed successfully or none are.

For example, if a transaction is committed but an error occurs requiring a rollback,

atomicity ensures that none of the partial changes persist.


Consistency (일관성)

Consistency means data must only be changed in allowed, valid ways.

All data must satisfy defined rules and constraints.

For example, if Hongchul has 10 million KRW and Beomseok has 0 KRW,

Beomseok cannot transfer 5 million KRW to someone else (assuming no overdraft).


Isolation (격리성)

Isolation ensures that concurrently running transactions do not interfere with each other.

Multiple parallel transactions should behave as if they run sequentially.

 

Isolation has several levels to guarantee this:

  • Phantom Read: When the result of the same query differs within the same transaction.
  • Non-repeatable Read: When the same row returns different values on multiple reads within a transaction.
  • Dirty Read: When a transaction reads data that another transaction has modified but not yet committed.

Durability (지속성)

Durability guarantees that once a transaction is successfully committed,

its changes are permanent—even in the event of a system failure.

Databases support durability with mechanisms such as:

  1. Checksum
  2. A simple *integrity check to protect data accuracy during transmission.
  3. Journaling
  4. Logging changes before committing them to the database, enabling recovery.

*Integrity (무결성)

Integrity means maintaining data accuracy, consistency, and validity,

ensuring stored data correctly represents real-world values.

'Computer Science > Database' 카테고리의 다른 글

ERD  (0) 2025.07.25
Elements that make up the database  (0) 2025.07.21
'Computer Science/Database' 카테고리의 다른 글
  • ERD
  • Elements that make up the database
JTB
JTB
웹/앱 개발 정보를 공유하고 있습니다.
  • JTB
    JTechBlog
    JTB
  • 전체
    오늘
    어제
    • All About Programming;) N
      • Computer Science
        • Terminology and Concepts
        • Network
        • Operating System
        • Database
        • Data Structure
      • Frontend
        • Javascript Essentials
        • Perfomance Optimization
        • JS Patterns
        • Next.js
        • Flutter
      • Backend
        • Node.js
      • DevOps
        • Docker & Kubernetes
      • Coding Test N
        • LeetCode N
        • Programmers
      • Tech Books & Lectures
        • Javascript_Modern JS Deep d..
        • Network_IT 엔지니어를 위한 네트워크 입문
      • Projects
        • PolyLingo_2025
        • Build Your Body_2024
        • JStargram_2021
        • Covid19 Tracker_2021
        • JPortfolio_2021
      • BootCamp_Codestates
        • TIL
        • TILookCloser
        • Pre Tech Blog
        • IM Tech Blog
        • Daily Issues and DeBugging
        • First Project
        • Final Project
        • Sprint Review
        • Good to Know
        • Socrative Review
        • HTML & CSS
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • 글쓰기
    • 관리
  • 공지사항

  • 인기 글

  • 태그

    자바스크립트 딥다이브
    testing
    스코프
    Threads and Multithreading
    딥다이브
    프론트엔드 성능 최적화 가이드
    leetcode
    Data Structure
    VoiceJournal
    polylingo
    Binary Tree BFS
    mobile app
    js pattern
    CPU scheduling algorithm
    How memory manage data
    TCP/IP
    need a database
    Operating System
    자바스크립트
    이벤트
    Shared resources
    Network
    커리어
    indie hacker
    structure of os
    DOM
    JavaScript
    Time complexity and Space complexity
    모던 자바스크립트 Deep Dive
    database
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
JTB
Transaction
상단으로

티스토리툴바