architecture is an architectural pattern that arranges an application as a collection of loosely coupled, fine-grained services, communicating through lightweight protocols. One of its goals is to enable teams to develop and deploy their services independently. Wikipedia DB1 DB2 DB3 App1 App2 App3 Microservice1 Microservice2 Microservice3 Application アプリケーションを、疎に結合された複数の小さいサービスの集合体として構成するアーキテクチャ
多種のデータベースに適用可能 ◦ 他のアプローチよりも高速な場合が多い • 欠点 ◦ アプリケーションが補償トランザクションを定義する必要がある ◦ 独立性(分離性)、原子性の補償がない ◦ アプリケーションを冪等にする必要がある ◦ 実装とデバッグが困難 8 Start Create an order Update credit usage Update the order End Cancel the order Undo credit usage Cancel the order Cancel
• 30-year-old 2PC approaches are not an option. • Modern 2PC approaches are definitely an option. Reference: QCONSF 2017 - ACID Is So Yesterday: Maintaining Data Consistency with Sagas
Management (e.g., Oracle MicroTx XA, Atomikos XA) Single-level Transaction Management (e.g., ScalarDB) TM (Coordinator) Abstraction Abstraction TM Abstraction TM DB1 Global Transactions Local Transactions DB2 TM: Transaction Manager TM (Coordinator) Abstraction DB1 Global Transactions Local Transactions DB2 CC: Concurrency Control No CC is required No CC is required Read this paper for details about this approach.