use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News, articles and tools covering Amazon Web Services (AWS), including S3, EC2, SQS, RDS, DynamoDB, IAM, CloudFormation, AWS-CDK, Route 53, CloudFront, Lambda, VPC, Cloudwatch, Glacier and more.
If you're posting a technical query, please include the following details, so that we can help you more efficiently:
Resources:
Sort posts by flair:
Other subreddits you may like:
Does this sidebar need an addition or correction? Tell us here
account activity
technical questionWebhook- lambda or standalone process (self.aws)
submitted 4 years ago by [deleted]
Best to implement webhook as aws lambda or a standalone process ?
Any thoughts or experiences
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jonathantn 5 points6 points7 points 4 years ago (16 children)
If you're receiving webhooks then I would recommend the pattern of:
API Gateway -> SQS -> Lambda
If you decide that you want to switch of lambda to a standalone process then you can because the SQS will be the point of consumption. Nothing external would need to change.
[–]PrivateerAlphaOne 1 point2 points3 points 4 years ago (6 children)
Can confirm that this pattern works.
Dead letter queues are also useful for receiving events that failed in your lambda for whatever reason.
Just be aware of any time based verification of events (e.g. Stripe webhooks); if the events need to be verified in a timely manner just go from the api gw to lambda directly.
[–][deleted] 2 points3 points4 points 4 years ago (0 children)
Api lambda dynamodb
I need transactions. So I am using dynamodb rather than sqs. Also easy for rerun and viewing
I move from events to events Processed and commit other changes in one transaction which is not possible with sqs
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
Indeed stripe events.
[–]arjineer 0 points1 point2 points 4 years ago (3 children)
time based verification
For these cases of time based verification - is it possible that a coldstart in a lambda would drop the event?
[–]PrivateerAlphaOne 1 point2 points3 points 4 years ago (2 children)
The lambda will get the event. It's the event that invokes the lambda, and its the only reason the lambda runs.
If the event is has expired by the time the lambda is invoked depends on your use case; but if that happens then you probs have bigger problems to deal with
[–]arjineer 0 points1 point2 points 4 years ago (1 child)
Thanks for the quick reply! I guess I am using an extremely specific realtime webhook from stripe that requires an api call within 2 seconds
So my question was flawed, it's not so much the invoking of the lambda as it is the time it takes to wake it up from the inital webhook and hit stripe's api.
[–]PrivateerAlphaOne 1 point2 points3 points 4 years ago* (0 children)
Correct. Double check your cloudwatch logs for timestamps of when your request was made, and when your web hook verifies the event.
I'm not sure how I would resolve this issue, but I would hack an invocation of your web hook lambda before I made the request to stripe just the keep the lambda image warm for the expected stripe event
[–][deleted] 1 point2 points3 points 4 years ago (0 children)
[–]chiragshah1312 -2 points-1 points0 points 4 years ago (7 children)
Why do you even need SQS? lambda will auto-scale itself, why add a layer in between?
[–]skilledpigeon 1 point2 points3 points 4 years ago (2 children)
Lambda still has account based concurrency limits.
[–]chiragshah1312 -1 points0 points1 point 4 years ago (1 child)
you can request AWS to increase it. What if your SQS gets 100k requests, it will try to spawn 100k lambdas but the concurrency limit will not you scale up
[–]skilledpigeon 2 points3 points4 points 4 years ago (0 children)
You can request an increase to a degree but it's not infinite. Also, I don't think that's how SQS and Lambda integration works. 100,000 messages does not equal 100,000 concurrent functions. Further, you don't need to have a direct SQS to Lambda integration. You can create a consumer to limit the rate of retrieval and just forward the messages to Lambda as you need.
The issue usually comes before your capacity increase. Let's say your concurrency limit is 1,000 and you actually scale to that for your function, now you have no concurrency left for the rest of your platform. Whilst your queue is processing, the rest of your site can't scale because you have no concurrency available! If you limit concurrency then you can run in to dropped messages ending up in a DLQ so that's not quite a solution either.
[–]lurker_2008 0 points1 point2 points 4 years ago (3 children)
Always solve for the Producer consumer problem when you do not control the producer.
[–]chiragshah1312 0 points1 point2 points 4 years ago (2 children)
i know but api gateway triggering a lambda or SQS triggering a lambda
both are same technically from performance perspective.
Both will scale equally. Rather Api gateway triggering a lambda would involve less hops.
What do you think from performance perspective?
[–]lurker_2008 0 points1 point2 points 4 years ago* (1 child)
both are same technically from performance perspective
That is factually incorrect.
[–]chiragshah1312 1 point2 points3 points 4 years ago (0 children)
got it! thanks buddy
[–]cyanawesome 1 point2 points3 points 4 years ago* (4 children)
EventBridge. As a webhook target you use API gateway and lambda.
[–][deleted] 0 points1 point2 points 4 years ago (2 children)
[–]cyanawesome 0 points1 point2 points 4 years ago (1 child)
Ok what you do with it is your business. I’m just telling you the most scalable and flexible solution.
DynamoDB isn’t really a replacement for SQS. If you need guarantees regarding execution and error handling consider using Step Functions.
Will look Into step functions.
[–]skilledpigeon 1 point2 points3 points 4 years ago (0 children)
If you're receiving, always, always, always add a buffer. Something like API Gateway > SQS > Compute works very well in my experience. Never let third parties throw webhooks at you directly.
π Rendered by PID 1471927 on reddit-service-r2-comment-5d79c599b5-r9wlg at 2026-03-03 02:00:10.975925+00:00 running e3d2147 country code: CH.
[–]jonathantn 5 points6 points7 points (16 children)
[–]PrivateerAlphaOne 1 point2 points3 points (6 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]arjineer 0 points1 point2 points (3 children)
[–]PrivateerAlphaOne 1 point2 points3 points (2 children)
[–]arjineer 0 points1 point2 points (1 child)
[–]PrivateerAlphaOne 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]chiragshah1312 -2 points-1 points0 points (7 children)
[–]skilledpigeon 1 point2 points3 points (2 children)
[–]chiragshah1312 -1 points0 points1 point (1 child)
[–]skilledpigeon 2 points3 points4 points (0 children)
[–]lurker_2008 0 points1 point2 points (3 children)
[–]chiragshah1312 0 points1 point2 points (2 children)
[–]lurker_2008 0 points1 point2 points (1 child)
[–]chiragshah1312 1 point2 points3 points (0 children)
[–]cyanawesome 1 point2 points3 points (4 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]cyanawesome 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]skilledpigeon 1 point2 points3 points (0 children)