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,

preguntada hace 2 años49 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas