thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Advanced

Two-Phase Commit (2PC)

A protocol that coordinates a distributed transaction: participants first vote to prepare, then all commit or all abort.

Definition

In phase 1 the coordinator asks every participant to prepare and vote; in phase 2 it tells them to commit only if all voted yes. 2PC provides atomicity across systems but blocks if the coordinator fails, so microservices often use sagas instead.

Exam tip

2PC is a blocking protocol; saga-based compensation is the usual alternative in microservices.

Related terms