top | item 40762483

(no title)

multani | 1 year ago

What is the pattern to use on Lambda if you actually have to call out other services, which may, sometimes, take a long time to answer? Do you make requests with a shorter timeout and have your Lambda fail when it triggers? Do you delegate long calls to a non-Lambda service?

discuss

order

moribvndvs|1 year ago

In a case where a dependency has a consistent high latency and you can’t avoid it, I’d run the numbers and see if it’s more worthwhile to just run your app on ECS or something instead.

Aeolun|1 year ago

I find that running your app on ECS is generally a great way to just do away with a whole class of problems. I’ve never found lambda to do away with any of the issues I encounter on ECS.

dragonwriter|1 year ago

If you have enougu volume to warrant it, probably re-architecting the lambdas so the before/after part of the calls is a separate invocation, with an adapter service living on ECS that gets a call from the “before” lambda, handles the remote request and response, the calls the “after” lambda with the response.

The simpler solution is often to just lift the app from lambda to ECS without internal changes

roncesvalles|1 year ago

It seems like Lambda is not suited for such "hanging" use cases. To me the best use case for Lambda is for an API call that might be made very infrequently, like say 50 times a day. Doing the same with a VM instance (remember, it has to be HA, secure etc) is probably not worth the effort.

throw156754228|1 year ago

There are AWS step functions that might fit this use case. Just another product AWS will charge you to use to perpetuate the serverless myth.