site-logo

JAWS PANKRATION 2024

Payment business logic implemented in the Saga pattern using AWS Step Functions

Lv300

Lv300

8/24/2024 16:20 (UTC)

Session Info

Here is a look inside the payment business logic actually running in the production environment.

This is part of the e-commerce service that handles payment, inventory calculation, etc.

This is an implementation of the orchestration model in the Saga pattern, where one process manages the workload state and calls the appropriate services in turn, implemented with AWS Step Functions.

The Saga pattern is a model of orchestration in the Saga Pattern.

Kazuki  Miura

Kazuki Miura

- AWS Heroes -

- AWS User Community Leaders -



Session Category
Container


AWS Services
AWS Step Functions



Session Summary (by Amazon Bedrock)
    The speaker, Miura from Japan, introduces himself as a Community Hero and Samurai award recipient. He discusses the implementation of microservices in their online shopping service. The architecture includes a frontend using Next.js, with multiple interactions handling customer data, purchases, and inventory. The backend uses AWS Step Functions, Lambda, and Stripe for payment processing. Miura explains the typical customer shopping process, from adding items to the cart to completing the purchase. He emphasizes the importance of inventory checks, shipping calculations, and payment processing. The speaker then focuses on the Step Functions implementation, which handles various tasks in the purchase process. He mentions the AWS documentation available for reference and compares event-driven architecture with orchestration-based approaches. Miura presents a simplified version of their Step Functions workflow, highlighting key steps such as inventory management, payment processing, and error handling. He discusses the challenges of maintaining data consistency and handling failed transactions. The team initially considered reversing all actions in case of errors but decided against it due to potential issues with payment processors and customer complaints. Instead, they implemented a system where successful payments are guaranteed to complete, with failed subsequent steps being sent to SNS and Slack for manual intervention. In conclusion, Miura emphasizes that the specific implementation may vary depending on each service's requirements and encourages discussion within teams to determine the best approach.

©JAWS-UG (AWS User Group - Japan). All rights reserved.