Distributed Transactions
Distributed transactions는 분산 시스템 전반에 걸쳐 atomicity, consistency, isolation, durability를 유지하기 위해 여러 리소스에 걸친 업데이트를 조정합니다.
Distributed transactions는 단일 논리적 작업을 완료하기 위해 여러, 종종 이기종인 리소스에 걸친 업데이트를 조정합니다. 이들은 공통 datastore를 공유하지 않는 resource managers 전반에 걸쳐 ACID properties를 보존하는 것을 목표로 합니다. 일반적인 조정 접근 방식에는 two-phase commit (2PC), three-phase commit (3PC), 또는 long-running workflow를 위한 compensating transactions (Sagas)가 포함됩니다. 주요 고려 사항에는 coordination blocking, single points of failure, latency, 그리고 rollback 또는 compensation을 통한 partial failures 처리가 있습니다. 실제 설계에서는 종종 transaction manager와 XA/JTA 또는 DTC와 같은 표준화된 인터페이스를 지원하는 resource managers를 사용하며, auditability를 위해 outbox patterns, idempotent operations, 그리고 logging을 활용할 수 있습니다. 현대의 microservice architectures에서는 가용성과 latency를 개선하기 위해 compensating actions를 통한 eventual consistency와 강력한 global ACID가 종종 거래됩니다.
graph LR
Center["Distributed Transactions"]:::main
Rel_decentralized_derivatives_pricing_models["decentralized-derivatives-pricing-models"]:::related -.-> Center
click Rel_decentralized_derivatives_pricing_models "/terms/decentralized-derivatives-pricing-models"
Rel_transaction_sharding["transaction-sharding"]:::related -.-> Center
click Rel_transaction_sharding "/terms/transaction-sharding"
Rel_decentralized_exchange_dex_order_book["decentralized-exchange-dex-order-book"]:::related -.-> Center
click Rel_decentralized_exchange_dex_order_book "/terms/decentralized-exchange-dex-order-book"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 5살도 이해할 수 있게 설명
Generated ELI5 content
🤓 Expert Deep Dive
Generated expert content
❓ 자주 묻는 질문
What is a distributed transaction?
A transaction that spans multiple networked resources and coordinates to appear atomic across all participants.
What does ACID mean in this context?
Atomicity, Consistency, Isolation, and Durability, applied across multiple resources through coordination protocols.
What is two-phase commit (2PC)?
A protocol with a prepare phase and a commit phase to ensure all participants commit or roll back together.
What about sagas and compensating actions?
Sagas sequence local transactions with compensating actions to achieve long-running distributed transactions without locking all resources.
What are common failure modes?
Coordinator failure, participant failure, network partitions, and lock contention can lead to blocking or partial commits.
When should you use 2PC vs sagas?
Use 2PC for short, strongly consistent, bounded transactions; use sagas for long-running processes requiring high availability and eventual consistency.
What are alternatives to strict ACID?
Eventual consistency models, compensating actions, and idempotent design patterns.