ACID

효딩딩·2022년 10월 25일
0

ACID 란?

  • ACID 는 안전한 트랜잭션 수행 환경을 제공함

1. 원자성 (Atomicity)

  • 트랜잭션과 관련된 작업들이 모두 수행되었는지 아니면, 모두 실행이 안되었는지를 보장하는 능력
  • 트랜잭션 내의 모든 명령은 반드시 완벽히 수행되어야 하며, 모두가 완벽히 수행되지 않고 어느하나라도 오류가 발생하면 트랜잭션 전부가 취소되어야 함

2. 일관성 (Consistency)

  • 트랜잭션이 실행을 성공적으로 완료하면 언제나 일관성 있는 데이터베이스 상태로 유지하는 것
  • 시스템이 가지고 있는 고정요소는 트랜잭션 수행 전과 트랜잭션 수행 완료 후의 상태가 같아야 함

3. 독립성, 격리성 (Isolation)

  • 트랜잭션을 수행 시 다른 트랜잭션의 연산 작업이 끼어들지 못하도록 보장하는 것. 즉, 트랜잭션 밖에 있는 어떤 연산도 중간 단계의 데이터를 볼 수 없음을 의미한다.
  • 수행중인 트랜잭션은 완전히 완료될 때까지 다른 트랜잭션에서 수행 결과를 참조할 수 없음

4. 영속성, 지속성 (Durablility)

  • DBMS가 사용자에게 트랜잭션 커밋 응답을 했을 경우, 설사 데이터베이스 객체에 대한 해당 변경 사항이 디스크에 반영되기 전에 시스템 장애가 발생하였더라도 해당 트랜잭션의 커밋은 보장 되어야 한다는 속성

출처:
https://karice.tistory.com/236
https://velog.io/@ebiny/TIL-2112162
https://velog.io/@issac/DB-%ED%8A%B8%EB%9E%9C%EC%9E%AD%EC%85%98-Transaction%EC%9D%98-ACID-%EC%86%8D%EC%84%B1%EA%B3%BC-%EB%B6%84%EC%82%B0%EC%8B%9C%EC%8A%A4%ED%85%9C-BASE-%EC%86%8D%EC%84%B1
https://velog.io/@jeb1225/ACIDvsBASE


(영문 해석)

What is ACID?

  • In computer science, ACID (atomicity, consistency, isolation, durability) is a set of properties of database transactions intended to guarantee data validity despite errors, power failures, and other mishaps.
  • In the context of databases, a sequence of database operations that satisfies the ACID properties (which can be perceived as a single logical operation on the data) is called a transaction. For example, a transfer of funds from one bank account to another, even involving multiple changes such as debiting one account and crediting another, is a single transaction.

ACID properties of transactions

In the context of transaction processing, the acronym ACID refers to the four key properties of a transaction: atomicity, consistency, isolation, and durability.

Atomicity

  • All changes to data are performed as if they are a single operation. That is, all the changes are performed, or none of them are.
  • For example, in an application that transfers funds from one account to another, the atomicity property ensures that, if a debit is made successfully from one account, the corresponding credit is made to the other account.

Consistency

  • Data is in a consistent state when a transaction starts and when it ends.
  • For example, in an application that transfers funds from one account to another, the consistency property ensures that the total value of funds in both the accounts is the same at the start and end of each transaction.

Isolation

  • The intermediate state of a transaction is invisible to other transactions. As a result, transactions that run concurrently appear to be serialized.
  • For example, in an application that transfers funds from one account to another, the isolation property ensures that another transaction sees the transferred funds in one account or the other, but not in both, nor in neither.

Durability

  • After a transaction successfully completes, changes to data persist and are not undone, even in the event of a system failure.
  • For example, in an application that transfers funds from one account to another, the durability property ensures that the changes made to each account will not be reversed.

Source:
https://www.databricks.com/glossary/acid-transactions
https://www.ibm.com/docs/en/cics-ts/5.4?topic=processing-acid-properties-transactions
https://en.wikipedia.org/wiki/ACID

profile
어제보다 나은 나의 코딩지식

0개의 댓글