Distributed Transaction for Cron Jobs with Saga Pattern

0

The Saga Pattern is a preferred way to do distributed transaction with Lambdas. The orchestration will work with lambdas.

Please review the picture in the above link as well as this image.

My question is about if I use a Cron Job instead of one of the Lambdas to process ProcessPayment. Please see this image. This Cron Job will retrieve the customers who have a flight and rental car and charge them every 5 hours instead of immediately. This 5 hours delay in the steps would block the whole function to be delayed for more than 5 hours. If that happens for a few hundreds customers, we will have* hundreds of transactions waiting to be committed or rolled back*.

What is the right way to add distributed transactional ability with Saga Pattern & Step functions if we use functions that don't run in sequential order and immediately?

  • I am not sure what you are trying to do. You can't really change one of the tasks to a cron job. You might have a task to create a cron job with a task token so the state machine will wait, but you can achieve it much simpler by just adding a Wait state.

    Please try to explain your use case better,

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠