Skip to content

Youbey/2-Phase-Commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Two-Phase Commit (2PC) in Microservice Architecture 📌 Objective

This project demonstrates how to implement and simulate a distributed transaction using the Two-Phase Commit (2PC) protocol across three microservices:

Order Service (localhost:8081)

Payment Service (localhost:8082)

Coordinator Service (localhost:8080)

🏗️ Architecture Overview

  1. Order Service

    Manages order placement.

    Exposes:

     POST /prepare_order
    
     POST /commit_order
    
     POST /rollback_order
    
  2. Payment Service

    Handles payment processing.

    Exposes:

     POST /prepare_payment
    
     POST /commit_payment
    
     POST /rollback_payment
    
  3. Coordinator Service

    Orchestrates the 2PC protocol.

    Steps:

     Sends prepare to services.
    
     If all succeed, sends commit.
    
     If any fail, sends rollback
    

About

an implementation to simulate a distributed transaction using the Two-Phase Commit (2PC) protocol across three microservices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors