AWS Lambda provides a powerful serverless computing platform, allowing developers to focus on writing code without worrying about infrastructure management. One important consideration when using Lambda is selecting the appropriate runtime for your application. In this technical blog, we will dive into the performance and development aspects of different AWS Lambda runtimes, based on a series of tests conducted using NodeJS, JVM, and GraalVM.
I have gained valuable insights into their performance and development characteristics. The Node.js runtime stood out as a reliable choice with decent cold and warm start times, making it a practical option for many applications.
On the other hand, my experience with Clojure and GraalVM Native Image showcased impressive performance gains, often surpassing Java runtime. However, the development cost associated with compatibility issues and the need for careful handling of features like reflection and random number generation were notable drawbacks. Troubleshooting in production also proved challenging due to limited error trace information, and the longer deployment times resulting from native image compilation added to the development overhead.
One runtime that particularly caught my attention was ClojureScript on NodeJS. Despite encountering initial difficulties due to my lack of familiarity with specific configurations, the code proved flexible and open to integration with npm packages and AWS Lambda enhancements. The runtime demonstrated promising results, with competitive cold and warm start times, making it a compelling option for developers seeking the benefits of both Clojure and JavaScript ecosystems.
Testing a Simple Lambda Handler
Node.js Runtime:
Clojure Runtime with GraalVM Native Image:
Testing Lambda with HTTP Dependencies:
Clojure on .jar
with Docker:
Clojure on .jar
with Zip Packaging:
Node.js Runtime and Zip Packaging:
ClojureScript with Node.js Runtime and Zip Packaging: