Fork me on GitHub
#aws
<
2021-07-08
>
Drew Verlee17:07:29

I assume what and how many lambdas one should configure is mostly function of the processing power of that lambda. E.g given a webserver where all routes are relatively the same (simple gets, puts, etc..) it would be approprate to simply have one lambda given instances of it are created on demand. Where it would make sense to have two different lambdas, is when they handled vastly different loads. E.g i wanted to spin one up with twice the ram. Given that, is it reasonable that all my websocket handlers (connect, disconnect, default, custom) with a similar load, all go to one handler function and i just use polymorphic dispatch?

Daniel Craig18:07:37

I think the more common pattern would be to put all your lambdas behind an API gateway api, and then just let API gateway handle the routing. That way you avoid having a dispatch lambda that invokes other lambdas

Drew Verlee18:07:05

@USDPTD3FY I agree, i plan on using API gateway protocals/fns to route to a single lambda.

Drew Verlee17:07:07

this is what i'm using to guide my understanding of how to think about lambdas https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html