4 ms·
You can create a connection pool in a static context that lives throughout the lifetime of the JVM. Although admittedly if Lambda scales to multiple JVMs as re
by djhworld 7y ago
You can create a connection pool in a static context that lives throughout the lifetime of the JVM.
Although admittedly if Lambda scales to multiple JVMs as request rate increases, you'll have multiple pools. Or if your request rate is low you'll not get much benefit
- cavisne 7y agoLambda containers serve 1 request at a time, so the number of JVM's tends to scale out a lot quicker than you would expect. This is more of a broader problem with Java on lambda, as the classic Java way of creating a bunch of singletons on startup and accessing them from multiple threads doesn't work, you just get a really slow cold start time and some near empty connection pools.