Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

INTRODUCTION OF OWN SERVICES INTRODUCTION OF OWN SERVICES

Slide 4

Slide 4 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug

Slide 5

Slide 5 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Purchase flow AWS Step Functions Amazon DynamoDB AWS Lambda

Slide 8

Slide 8 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Cart Purchase flow

Slide 9

Slide 9 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Cart Purchase flow inventory check Address input

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

WHAT IS SAGA PATTERN? WHAT IS SAGA PATTERN?

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Saga Pattern Saga choreograpy Saga orchestration

Slide 16

Slide 16 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Saga Pattern Saga choreograpy

Slide 17

Slide 17 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Saga Pattern Saga choreograpy

Slide 18

Slide 18 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Saga Pattern Saga orchestration

Slide 19

Slide 19 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Saga Pattern Saga orchestration

Slide 20

Slide 20 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Saga Pattern Saga orchestration

Slide 21

Slide 21 text

STATE MACHINE DETAIL STATE MACHINE DETAIL

Slide 22

Slide 22 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug State Machine

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Temporary stock hold CartTable Delete Create Purchase history

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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.

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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.

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

SUMMARY SUMMARY

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

NEXT SESSION IS... NEXT SESSION IS...

Slide 36

Slide 36 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug Nagababu Medicharla Slash Costs & Boost Efficiency: Karpenter's Secret to Kubernetes Scaling TT-43

Slide 37

Slide 37 text

#jawspankration #jawspankration2024 #jawsug JAWS PANKRATION 2024 JAWS PANKRATION 2024 THANK YOU THANK YOU ありがとう ありがとう

Slide 38

Slide 38 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug

Slide 39

Slide 39 text

JAWS PANKRATION 2024 JAWS PANKRATION 2024 #jawspankration #jawspankration2024 #jawsug