CoursesDistributed Reliability

Transactions Across Services

A saga of local transactions with compensations, the state machine that lets it resume after a crash, why two-phase commit is the last resort, and the anomalies a saga lets through that a transaction would not.

Lessons
6
Exercises
35
Minutes
39

Start A Saga of Local Transactions

  1. 1

    A Saga of Local Transactions

    After this lesson you can turn a business operation that spans three services into a saga of local transactions, write the compensation for each step, and say which step is the point of no return.

    DebugFill blankMultiple choice
    5 exercises
    6 min
  2. 2

    The Saga That Survives a Crash

    After this lesson you can persist a saga's state so it resumes after the orchestrator dies, and choose between an orchestrator and choreography for a given number of steps.

    DebugCode orderMultiple choiceTrace
    5 exercises
    6 min
  3. 3

    Two-Phase Commit, and Why It Is Last

    After this lesson you can describe what two-phase commit promises, what a coordinator failure does to the participants, and when its cost is worth paying instead of a saga.

    Multiple choiceShort answerTrace
    5 exercises
    6 min
  4. 4

    What a Saga Lets Through

    After this lesson you can name the anomalies a saga permits that a transaction would not, and add the semantic lock or the pending state that keeps them from reaching a customer.

    DebugMultiple choiceTrace
    5 exercises
    6 min
  5. 5

    Checkpoint: Transactions Across ServicesCheckpoint

    Sagas, state, 2PC and anomalies for a system you have not seen before.

    DebugMultiple choice
    7 exercises
    6 min
  6. 6

    Boss: The Trip Booking SagaBoss

    One design carried from the ask to the incident: the question, the estimate, the steps and their pivot, the orchestrator's row, the partner that timed out, the customer billed for a cancelled hotel, the revised saga, and the tradeoff you have to defend.

    Code orderMultiple choiceShort answerTrace
    8 exercises
    9 min