spring-boot-saga-pattern

Solid

Provides distributed transaction patterns using the Saga Pattern for Spring Boot microservices. Use when implementing distributed transactions across services, handling compensating transactions, ensuring eventual consistency, or building choreography or orchestration-based sagas with Kafka, RabbitMQ, or Axon Framework.

AI & Automation 278 stars 32 forks Updated 5 days ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
81
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Spring Boot Saga Pattern ## Overview Implements distributed transactions across microservices using the Saga Pattern. Replaces two-phase commit with a sequence of local transactions and compensating actions. Supports choreography (event-driven) and orchestration (centralized coordinator) approaches with Kafka, RabbitMQ, or Axon Framework. ## When to Use - Building distributed transactions across multiple microservices - Replacing two-phase commit (2PC) with a more scalable solution - Handling transaction rollback when a service fails - Ensuring eventual consistency in microservices architecture - Implementing compensating transactions for failed operations - Coordinating complex business processes spanning multiple services **Trigger phrases**: distributed transactions, saga pattern, compensating transactions, microservices transaction, eventual consistency, rollback across services, orchestration pattern, choreography pattern ## Instructions ### 1. Design Transaction Flow Map the sequence of operations and their compensating transactions: ``` Order → Payment → Inventory → Shipment ↓ ↓ ↓ ↓ Cancel Refund Release Cancel ``` **Validation**: Verify every forward step has a corresponding compensation. ### 2. Choose Implementation Approach | Approach | Use Case | Stack | |----------|----------|-------| | Choreography | Greenfield, few participants | Spring Cloud Stream + Kafka/RabbitMQ | | Orchestration | Complex workflows, brownfield | ...

Details

Author
giuseppe-trisciuoglio
Repository
giuseppe-trisciuoglio/developer-kit
Created
7 months ago
Last Updated
5 days ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category