Slide 1

Slide 1 text

Super Charging AWS Lambda Kashif Mehmood

Slide 2

Slide 2 text

Why should you care about Kotlin?

Slide 3

Slide 3 text

Understanding Cold Starts Cold Starts in AWS Lambda: Delays caused by initializing the runtime environment and dependencies during the first invocation after inactivity. Cold Starts in AWS Lambda: Delays caused by initializing the runtime environment and dependencies during the first invocation after inactivity. Impact on Performance: Cold starts increase response times and reduce throughput, affecting real-time applications. Contributing Factors: Infrequent invocations, large function sizes, complex dependencies, and heavy libraries increase cold start occurrences

Slide 4

Slide 4 text

Kotlin: A Modern Language for AWS Lambda Kotlin for AWS Lambda: A modern, concise language ideal for scalable serverless applications with strong type safety and seamless Java integration. Cold Starts in AWS Lambda: Delays caused by initializing the runtime environment and dependencies during the first invocation after inactivity. Benefits over Java: Kotlin's concise syntax, null safety, functional programming, and Java interoperability make it superior for Lambda development. Enhancing Lambda Development: Kotlin's coroutines, data classes, and lambda expressions boost efficiency, maintainability, and reduce errors in Lambda functions.

Slide 5

Slide 5 text

The Holy Graal GraalVM Overview: A high-performance, polyglot virtual machine supporting multiple languages, ideal for efficient, scalable applications. Truffle Framework: Truffle allows for the implementation and efficient execution of multiple languages within GraalVM. Polyglot Nature: GraalVM enables seamless integration of different languages within a single application for complex, interoperable systems. Difference from Traditional JVM: GraalVM employs advanced optimizations like AOT compilation, offering faster startup times and better runtime performance. Benefits for Serverless: GraalVM's native image generation reduces cold start times and boosts performance in serverless environments like AWS Lambda.

Slide 6

Slide 6 text

The Holy Graal - Polyglot

Slide 7

Slide 7 text

The Holy Graal Start Fast Low Resource Usage Minimize Vulnerability Compact Packaging

Slide 8

Slide 8 text

Start Fast JIT Load JAR files from disk Uncompress class files Verify class definitions Execute in interpreter (~20x slower) Gather profiling feedback Compile to machine code Execute at peak performance AOT Load executable from Disk Execute at Peak Performance

Slide 9

Slide 9 text

Low Memory Usage

Slide 10

Slide 10 text

Memory Scalability

Slide 11

Slide 11 text

Reduce Vulnerability • No new unknown code can be loaded at run time • Only paths proven reachable by the application are included in the image • Reflection is disabled by default and needs an explicit include list • Deserialization only enabled for specified list of classes • Just-in-time compiler crashes, wrong compilations, or “JIT spraying” to create machine code gadgets are impossible

Slide 12

Slide 12 text

Lightweight Applications

Slide 13

Slide 13 text

Use Cases

Slide 14

Slide 14 text

Use Cases

Slide 15

Slide 15 text

Kotlin is Multiplatform Kotlin can run everywhere, can be transpiled to Js, ObjC, Swift and more.

Slide 16

Slide 16 text

Kotlin is Multiplatform

Slide 17

Slide 17 text

Thank You for Listening