[Paper Review] Accompanist: A Runtime for Resilient Choreographic Programming
Accompanist provides a resilient runtime for Choral choreographic programs by deploying sidecars that replay computations to mask faults, enabling decentralized saga transactions with formal correctness guarantees.
In service-oriented architecture, services coordinate in one of two ways: directly, using point-to-point communication, or indirectly, through an intermediary called the orchestrator. Orchestrators tend to be more popular because their local state is a 'single source of truth' for the status of ongoing workflows, which simplifies fault recovery and rollback for distributed transactions that use the 'saga' pattern. But orchestration is not always an option because of hardware constraints and security policies. Without a central orchestrator, resilient saga transactions are hard to implement correctly. A natural idea is to use choreographic programming, a paradigm that brings the 'global view' of orchestrators to a decentralised setting. Unfortunately, choreographic programming relies on strong assumptions about network reliability and service uptime that often do not hold. Recent work weakens some of these assumptions with 'failure-aware' language features, but these features make programs more complex. We propose a complementary approach: to co-design the programming interface with a customizable runtime that can replay computation to mask faults. Our approach keeps programs simple, does not require modifying the compiler, and lends itself to a clean separation of concerns in formal proofs. We present Accompanist, a resilient runtime for the Choral choreographic programming language. With Accompanist, programmers can implement decentralised saga transactions as choreographic programs and deploy the compiled code to 'sidecars' that run alongside services in a pre-existing codebase. Our key assumptions are that choreographic programs should be deterministic, transactions within a saga should be idempotent, and messages should be written to a durable message queue. Based on these assumptions, we present a formal model and prove that target code is correct-by-construction.
Motivation & Objective
- Motivate the need for resilient coordination in service-oriented architectures where orchestration is not feasible due to latency, security, or locality constraints.
- Introduce Accompanist as a runtime that co-designs the programming interface with a fault-tolerant execution model for Choral choreographies.
- Show that choreographic sagas implemented with Accompanist are deadlock-free, terminate under bounded restarts, and maintain consistency via compensating transactions.
- Provide a formal model and correctness results that separate choreography proofs from network-level bisimulation proofs.
Proposed method
- Present a formal model for decentralized, correct-by-construction saga transactions in choreographic programming.
- Describe the Accompanist runtime architecture with sidecars that run Choral-generated code and communicate via programmable channels.
- Define session-based execution mapped to lightweight virtual threads with per-session state and buffering for out-of-order messages.
- Implement durable messaging using an inbox/outbox pattern to enable at-least-once fault-tolerant replay and idempotent transactions.
- Introduce a fault-tolerant mode that restarts sessions and replays from initial state, leveraging deterministic and idempotent assumptions.
- Demonstrate how saga transactions are expressed via a Transaction interface and compensating actions, ensuring rollback when failures occur.

Experimental results
Research questions
- RQ1How can choreographic programming be made practical in real systems without requiring compiler changes or intrusive language extensions?
- RQ2Can a runtime replay-based approach provide resilience for decentralized choreographies while preserving correctness properties like deadlock-freedom and saga safety?
- RQ3What is the performance impact of fault-tolerant replay in Accompanist compared to traditional saga orchestration?
- RQ4How can decentralized choreographies be proven correct-by-construction and related to network-level behavior via bisimulation?
- RQ5What mechanisms (e.g., message headers, session management) are necessary to support reliability and observability in sidecar-based choreographies?
Key findings
- The default Accompanist mode improves end-to-end latency in distributed deployments, particularly across zones or regions.
- In fault-tolerant mode, Accompanist achieves substantial latency improvements (5.9× median end-to-end latency) over a mature industry-grade saga orchestration framework.
- The approach delivers principled correctness results: deadlock-freedom, termination under bounded restarts, and agreement on success or compensating actions among participants.
- A formalization of decentralized correct-by-construction saga transactions is provided, including a bisimulation result between choreographies and compiled choreographies and replay equivalence under restarts.
- The architecture supports integration with pre-existing polyglot codebases by using sidecars that communicate with workers via RPCs, avoiding the need to rewrite applications.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.