Serverless Orchestration / Saga Pattern with AWS Step Functions

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ค. 2024
  • How to implement Serverless orchestration with AWS Step Functions is the subject of this episode of "Serverless Patterns". Orchestration, commonly called State Machine or Saga Pattern gives a different approach to solving problems.
    In this video, I present a step-by-step diagram, I go through the use case, the benefits and considerations should you choose to implement it using AWS Step Functions, Lambda function, DynamoDB, API Gateway, and more...
    👋🏻 Hey everyone - I'm getting a lot of DMs with all kinds of questions and demands for mentorship.
    I love the idea, so I started building a community for Cloud enthusiasts regardless of their background - Join Us Now: tinyurl.com/win-the-cloud 🚀
    → Use the index below to navigate
    00:00 intro
    00:28 Introduction to State Machines
    00:41 Use cases
    03:08 Benefits
    03:43 Considerations
    04:32 Practical use case: Banking system
    09:39 Architecture diagram
    11:18 Outro
    → AWS Step Functions: aws.amazon.com/step-functions...
    → Idempotence: en.wikipedia.org/wiki/Idempot...
    #Orchestration #Saga #AWS #Serverless
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 32

  • @tusharanand4059
    @tusharanand4059 3 ปีที่แล้ว +4

    Good One. Can we look at some cost efficient architectures and suggestions you make to customers day in and day out. What sort of pitfalls, hacks are there to make your architecture more cost effective. Some use cases around these would help. Thanks & Regards

    • @WinTheCloud
      @WinTheCloud  3 ปีที่แล้ว +3

      Yes, definitely - I'll think about a way to incorporate this

  • @ivanatora
    @ivanatora 7 หลายเดือนก่อน

    One very good application of SFNs is if you need to delay a Lambda execution.
    Put a Wait task before a Lambda:Invoke task and you have it.
    You need jitter? Add a Pass task before the Wait and make it output waitTime = States.MathRandom(0, 30), then use waitTime as a source for the Wait task.

  • @shadiddev4448
    @shadiddev4448 ปีที่แล้ว +1

    Thanks!

  • @ved8798
    @ved8798 3 ปีที่แล้ว +3

    This is a great intro. But I'm curious to see how you can evolve this when your states are not pre-defined. e.g think about an app like turbo tax - where your flow transitions are dictated by what you've answered previously. And it can get complicated if there are user/customer specific steps that the state machine have to take into consideration e.g. if the user navigating this flow is a premium user, then prompt the user to the 'Concierge' service step before proceeding to the ReserveFlight step

  • @mexicanmax227
    @mexicanmax227 3 ปีที่แล้ว +3

    Awesome video! The pattern I would wanna see next vid is scenarios that you have solved involving chattiness (protocols, caching, or auditing) and how you would came to the solution.

    • @WinTheCloud
      @WinTheCloud  3 ปีที่แล้ว +3

      Sounds good! I have the two next patterns ready to go, but I'll think about a couple for what's coming next

  • @ismile47
    @ismile47 3 ปีที่แล้ว +2

    Thanks you for the efforts

  • @gran6782
    @gran6782 2 ปีที่แล้ว +3

    Hey, thanks for the video! I'm really curious on how you would design your SAGA state machine to guarantee the rollback in case of failure of one of the inner action of the parallel block that you mentioned in 08:32 (Check Address, Verify Identity Documents). The state machine presented in 09:55 presents a solution for sequential steps only.
    E.g. What happens if the address is checked and I save something in a DynamoDB, but my Verify Identity Documents fail? How do I know I should run a compensating action for Check Address?

    • @WinTheCloud
      @WinTheCloud  2 ปีที่แล้ว +2

      Hey Gran, so the step that writes to DynamoDB should return an ID of some sort, you add that ID to the common state, and you build a new step "reconciliation" that gets triggered if an error happens. The reconciliation step uses the DDB ID that was passed to it in the state and can then delete that item from the table. Does this make sense?

  • @oluwaseyioni5263
    @oluwaseyioni5263 2 ปีที่แล้ว +2

    Thanks for this. Did you ever do a deeper dive as promised ?

    • @WinTheCloud
      @WinTheCloud  2 ปีที่แล้ว +3

      Not yet, unfortunately, it's still in the pipeline though

  • @jackishere
    @jackishere 3 ปีที่แล้ว +2

    Keep further .. !

  • @somedude31
    @somedude31 3 ปีที่แล้ว +3

    i've loved the SAGA pattern since learning about it. however, i never did manage to find out what SAGA stands for lol.
    As for pattern suggestions, can you cover anti-patterns or, perhaps, patterns that are good but that turned out not to be great in a serverless framework? I work primarily with serverless technologies and, when I architect, I go straight for serverless designs. However, I do wonder if I'm trying to force every problem to be solvable by the same tool (serverless). Also, I'm afraid I just don't know the names of the serverless patterns and, so, can't suggest ones for you to cover.

    • @WinTheCloud
      @WinTheCloud  3 ปีที่แล้ว +3

      I have no idea what SAGA stand for either haha, I just tweeted asking for it, let's see if someone can enlighten us with an answer.
      Covering anti-patterns is a great suggestion, I'll look into it!
      You're right in your reasoning: Serverless is not the solution for everything. Recursive calls, long running processes, batch processing, to name a few, are a to avoid - which gives me an idea for an episode: I'll do some digging and present some use cases that are not suited for Serverless. Hope this can help!

    • @somedude31
      @somedude31 3 ปีที่แล้ว +1

      @@WinTheCloud Thanks! Hopefully, someone knows :)

  • @hkaur10
    @hkaur10 3 ปีที่แล้ว +2

    Awesome Video. Very informational. I am very interested in a WebHook pattern if you can cover that.

    • @WinTheCloud
      @WinTheCloud  3 ปีที่แล้ว +1

      Noted! It's already part of the plan ;)

    • @hkaur10
      @hkaur10 3 ปีที่แล้ว +1

      @@WinTheCloud Can't wait! :)

  • @johnrobert7696
    @johnrobert7696 2 ปีที่แล้ว +2

    Thank you ilyas for this usefull content, I just have a question even its out of context, what music name u used in the outro ?

    • @WinTheCloud
      @WinTheCloud  2 ปีที่แล้ว +3

      Thank you John ! The music is called "Bounce" by Simon Petterson

  • @ayabak6434
    @ayabak6434 3 ปีที่แล้ว +2

    👏👏👏👏👏

  • @WinTheCloud
    @WinTheCloud  3 ปีที่แล้ว +3

    Great news, AWS Step Functions new drag-n-drop workflow editor is out: aws.amazon.com/blogs/aws/new-aws-step-functions-workflow-studio-a-low-code-visual-tool-for-building-state-machines/

  • @tejasgaware8234
    @tejasgaware8234 3 ปีที่แล้ว +4

    I have decided to Go for AWS as my career after I finish my bachelor's degree. I have learned html, css and basics of JavaScript. Should I directly start learning aws or complete my web development knowledge.Pls help me with the path what should I do first and what not? (I will be doing my bachelor's degree)

    • @kellymoses8566
      @kellymoses8566 3 ปีที่แล้ว +3

      Learn boto3 and python

    • @tejasgaware8234
      @tejasgaware8234 3 ปีที่แล้ว +1

      @@kellymoses8566 thanks

    • @kellymoses8566
      @kellymoses8566 3 ปีที่แล้ว +3

      @@tejasgaware8234 with boto3 you can make some really cool stuff with AWS remarkably easily.

    • @tejasgaware8234
      @tejasgaware8234 3 ปีที่แล้ว +1

      @@kellymoses8566 thanks I will surely do it

  • @NoemieMiss1995
    @NoemieMiss1995 3 ปีที่แล้ว +3

    Are you uploading a new video every week ?

    • @WinTheCloud
      @WinTheCloud  3 ปีที่แล้ว +2

      I'll try, although no promises ^^

  • @ayabak6434
    @ayabak6434 3 ปีที่แล้ว +2

    👏👏👏👏👏