Articles | Open Access | DOI: https://doi.org/10.37547/tajet/Volume07Issue06-18

Optimizing Distributed Transactions in Banking APIs: Saga Pattern vs. Two -Phase commit (2PC)

Kishore Subramanya Hebbar , Independent Researcher Atlanta, Georgia, USA (Currently employed as a Senior Software Engineer at Intercontinental Exchange Inc.)

Abstract

As financial institutions increasingly migrate their core platforms to microservices-based architectures, the challenge of managing distributed transactions has gained critical importance. Banking APIs typically require atomicity and consistency across multiple services—such as account management, fraud detection, notifications, and audit trails all of which operate independently with isolated data stores. In such an ecosystem, ensuring consistency, performance, and fault tolerance becomes a balancing act that traditional and modern transaction patterns attempt to resolve differently.  This paper explores and contrasts two dominant approaches to distributed transaction management: the Two-Phase Commit (2PC) protocol and the Saga Pattern, particularly in the context of mission-critical banking applications. 2PC has long been considered the gold standard for ensuring atomicity and strong consistency in distributed systems. However, its blocking nature, reliance on a centralized coordinator, and vulnerability to network partitions make it less suitable for high-throughput, globally distributed systems common in modern fintech platforms.  On the other hand, the Saga Pattern, an eventual consistency model that orchestrates a sequence of local transactions with compensating rollback operations—offers better fault tolerance and non-blocking behavior. Yet, its trade-offs include the complexity of compensating logic, lack of strict ACID guarantees, and potential for data anomalies if not carefully implemented. To ground the discussion in real-world reliability needs, I introduce a chaos engineering-based simulation that demonstrates the behavior of both 2PC and Saga under controlled failure scenarios, such as inter-service latency spikes and partial service outages. We benchmark recovery times, resource locking, system availability, and data reconciliation behavior using a representative banking microservice architecture deployed in a containerized environment.  My findings reveal that Saga outperforms 2PC in terms of availability and fault recovery, making it suitable for user-facing, latency-sensitive operations. However, 2PC remains superior for operations demanding immediate consistency and compliance with strict audit requirements, such as core ledger updates. Based on this analysis, we propose a hybrid transaction strategy that applies 2PC to core financial operations and Saga to surrounding auxiliary services, striking a balance between performance and correctness. This study offers practical design insights for architects building resilient, scalable, and regulation-compliant financial systems. It also highlights the need for adaptive orchestration platforms capable of dynamically selecting transaction models based on context and SLA requirements.

Keywords

Distributed Transactions, Saga Pattern, Two-Phase Commit (2PC), Banking APIs, Microservices Architecture, Eventual Consistency, Strong Consistency, Chaos Engineering, Fault Tolerance, Financial Compliance, Resilient System Design, Transactional Integrity, CAP Theorem, Hybrid Transaction Strategy, Latency Optimization

References

J. Gray and A. Reuter, Transaction Processing: Concepts and Techniques, Morgan Kaufmann, 1993.

P. A. Bernstein, V. Hadzilacos, and N. Goodman, Concurrency Control and Recovery in Database Systems, Addison-Wesley, 1987.

G. Weikum and G. Vossen, Transactional Information Systems: Theory, Algorithms, and the Practice of Concurrency Control and Recovery, Morgan Kaufmann, 2001.

M. Fowler, “Saga Pattern”, martinfowler.com, 2017. [Online]. Available: https://martinfowler.com/articles/sagas.html

P. Helland, “Life Beyond Distributed Transactions: An Apostate’s Opinion”, ACM Queue, vol. 5, no. 3, 2007.

J. Chen, Y. Hu, and D. Lin, “Design Patterns and Chaos Engineering in Microservices”, IEEE Software, vol. 35, no. 5, pp. 55–61, 2018.

European Banking Authority, “Revised Directive on Payment Services (PSD2),” 2018. [Online]. Available: https://www.eba.europa.eu

European Union, “General Data Protection Regulation (GDPR),” 2018. [Online]. Available: https://gdpr.eu/

U.S. Securities and Exchange Commission (SEC), Sarbanes-Oxley Act of 2002. [Online]. Available: https://www.sec.gov/sox

Amazon Web Services, “Chaos Engineering on AWS,” 2020. [Online]. Available: https://aws.amazon.com/builders-library

JPMorgan Chase, “Modern API Banking Architecture,” Whitepaper, 2021.

Kubernetes Project, “Production-grade Container Orchestration,” Kubernetes Documentation, 2023. [Online]. Available: https://kubernetes.io/docs/home/

Cloud Native Computing Foundation, “Prometheus and Grafana: Observability Tools for Cloud-Native Systems,” 2022. [Online]. Available: https://www.cncf.io/projects/

Article Statistics

Copyright License

Download Citations

How to Cite

Kishore Subramanya Hebbar. (2025). Optimizing Distributed Transactions in Banking APIs: Saga Pattern vs. Two -Phase commit (2PC). The American Journal of Engineering and Technology, 7(06), 157–169. https://doi.org/10.37547/tajet/Volume07Issue06-18