分散トランザクション
分散トランザクションは、複数のリソースにわたる更新を調整し、分散システム全体で原子性、一貫性、分離性、耐久性を維持します。
分散トランザクションは、単一の論理操作を完了するために、しばしば異種混在する複数のリソースにわたる更新を調整します。共通のデータストアを共有しないリソースマネージャー間でACIDプロパティを維持することを目的としています。一般的な調整アプローチには、ツーフェーズコミット(2PC)、スリーフェーズコミット(3PC)、または長時間実行ワークフローのための補償トランザクション(Sagas)が含まれます。主な懸念事項には、コーディネーションブロッキング、単一障害点、レイテンシ、およびロールバックまたは補償による部分的な障害の処理が含まれます。実用的な設計では、多くの場合、トランザクションマネージャーと、XA/JTAまたはDTCなどの標準化されたインターフェースをサポートするリソースマネージャーを使用し、アウトボックスパターン、冪等操作、および監査可能性のためのロギングを活用することがあります。現代のマイクロサービスアーキテクチャでは、可用性とレイテンシを向上させるために、補償アクションによる最終的な一貫性(eventual consistency)と引き換えに、強力なグローバルACIDはしばしばトレードオフされます。
graph LR
Center["分散トランザクション"]:::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.