4 ms·
The other problem with Lambda is that you cannot keep persistent connections in a connection pool. It is after all, designed for statelessness. This can be cons
by gshx 11y ago
The other problem with Lambda is that you cannot keep persistent connections in a connection pool. It is after all, designed for statelessness. This can be considerable cost for doing calls to other business services (http connection pools) or infra services like databases that all maintain persistent connections.
- falcolas 11y agoAbsolutely. The overhead of re-establishing a secure DB connection for every request is hardly trivial.
- wsh91 11y agoIt would be, if it were necessary, but it's not. (Static initializers or default constructors in Java, for example.)
- falcolas 11y agoQuestion then: How do you omit the overhead of setting up a new socket and all of the SSL handshakes? I'm not concerned about the Java overhead associated with new connections, I'm concerned with the raw connectivity/handshake overhead required with new connections to the DB.
- wsh91 11y agoThis isn't true. I run a Lambda right now that queries a Cassandra connection pool at high volume. In Java, at least, you set up your resources in a static initializer block, as this alludes to. http://docs.aws.amazon.com/lambda/latest/dg/best-practices.html http://docs.aws.amazon.com/lambda/latest/dg/best-practices.h... Problem solved.