I'm working on a platform where I need to place a hold on a customer's card about three days before a scheduled booking. Our backend is on ECS, and I'm considering using EventBridge to automate the job that places this hold and updates the database. I have the option to either use AWS Lambda or Fargate tasks for this process. Lambda seems appealing because of its quicker cold start times and the fact that the job is short-lived. But I'm wondering if Lambda is commonly used for critical functions like payment processing, or if it's better suited for less essential tasks.
3 Answers
If you're concerned about Lambda’s response time while waiting for bank confirmation, it’s worth considering how you're billed. You might be charged for idle time while waiting on that response. For state management and retries, consider using Step Functions, but do keep the cost in mind as they can get pricey at scale. On another note, using SQS might help manage failures more efficiently than EventBridge alone.
Yes, Lambda is fast and super reliable! We’ve successfully integrated it with our payment systems, running 100% serverless without a hitch.
Absolutely, Lambda is reliable and there's no need to stick with ECS for this. Many people use it for payment solutions without any issues.

That makes sense! I want to avoid double-processing payments, so using a state database sounds smart.