Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Payment business logic implemented in the Saga ...

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

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.

#jawspankration
#jawspankration2024
#jawsug

Kazuki Miura

August 24, 2024
Tweet

More Decks by Kazuki Miura

Other Decks in Technology

Transcript

  1. Payment business logic implemented in the Saga pattern using AWS

    Step Functions KAZUKI MIURA 2024/8/25 01:20 (JST) #jawspankration #jawspankration2024 #jawsug JAWS PANKRATION 2024 JAWS PANKRATION 2024 TT-42
  2. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug AWS

    Community Hero AWS User Group Leader AWS Samurai 2019 JAWS-UG Sapporo Committee Media-JAWS Committee Kazuki Miura Japan Working at TV Station
  3. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug API

    Gateway AWS Cloud Amplify Hosting Amplify Backend AppSync DynamoDB Lambda Step Functions Momento Cache
  4. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Cart

    Purchase flow inventory check Postage Calculation Address input Check
  5. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Cart

    Purchase flow Complete inventory check Postage Calculation Payment Arrangements Address input Check
  6. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Cart

    Purchase flow Complete inventory check Postage Calculation Payment Arrangements Address input Check ☝️ HERE!
  7. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Saga

    Pattern AWS > Documentation > AWS Prescriptive Guidnce > Cloud design patterns, architectures, and implementations https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/saga.html
  8. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug State

    Machine Simplify Temporary stock hold CartTable Delete Create Purchase history
  9. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Temporary

    stock hold CartTable Delete Create Purchase history Payment Error Return to temp stock Payment Success
  10. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Temporary

    stock hold CartTable Delete Create Purchase history Payment Error Return to temp stock Payment Success Compensation Transactions
  11. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Temporary

    stock hold CartTable Delete Create Purchase history Error Return to temp stock Payment Success Create a refund Error Update Success Update Success Error Revert CartTable
  12. JAWS PANKRATION 2024 JAWS PANKRATION 2024 CartTable Delete Create a

    refund #jawspankration #jawspankration2024 #jawsug Temporary stock hold Create Purchase history Error Return to temp stock Payment Success Error Update Success Update Success Error Revert CartTable Commission fees. Credit card status cannot be reversed.
  13. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Temporary

    stock hold CartTable Delete Create Purchase history Error Return to temp stock Payment Success Create a refund Error Update Success Update Success Error Revert CartTable
  14. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Temporary

    stock hold CartTable Delete Create Purchase history Error Return to temp stock Payment Success Update Success Update Success Make it work no matter what.
  15. JAWS PANKRATION 2024 JAWS PANKRATION 2024 CartTable Delete #jawspankration #jawspankration2024

    #jawsug Temporary stock hold Create Purchase history Error Return to temp stock Payment Success Update Success Update Success SNS SNS
  16. JAWS PANKRATION 2024 JAWS PANKRATION 2024 CartTable Delete #jawspankration #jawspankration2024

    #jawsug Temporary stock hold Create Purchase history Error Return to temp stock Payment Success Update Success Update Success SNS SNS Compensation Transactions with human
  17. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration Business logic was

    implemented using AWS Step Functions, referring to the orchestration types of the saga pattern. Cases exist where reverting straight back in a compensation transaction is not acceptable to the business. The decision was made to include a compensation transaction that includes the human system's response. #jawspankration2024 #jawsug Summary
  18. JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Nagababu

    Medicharla Slash Costs & Boost Efficiency: Karpenter's Secret to Kubernetes Scaling TT-43