Data Management

Data Management

Keep data accurate, consistent, and accessible

Enforceable guidelines from our catalog

Distributed Transactions Must Implement Saga Patterns

Distributed transactions must use saga patterns with compensating actions implemented using Spring State Machine, Axon Framework, or custom orchestration rather than two-phase commit (JTA) to ensure data consistency while maintaining system availability and fault tolerance.

Compensating Actions Must Be Idempotent

Each saga step must have corresponding compensating actions that are idempotent and can be safely retried using @Retryable annotations or custom retry logic to ensure reliable transaction rollback in distributed systems.

Event-Driven Systems Must Handle Duplicate Events Idempotently

All event handlers using @EventListener, @KafkaListener, or @RabbitListener must be idempotent to handle duplicate message delivery, implementing deduplication strategies using database constraints, Redis sets, or event sourcing patterns based on event IDs or business keys.

Sign up for free
and get unlimited access to our guidelines catalog