Short version: In this talk, I'll show how I migrated the backend for the NLJUG conference app (used for J-Fall, J-Spring and more events) from Spring running on Linux virtual machines to Quarkus running as GraalVM native image on AWS lambda.
Long(er) version:
A conference app backend makes the ideal candidate for a serverless architecture: almost no traffic during the year, and peak traffic during conference days.
In this talk, I'll show how I migrated the backend for the NLJUG conference app (used to rate talks for conferences with 1500+ attendees) from a traditional approach with Java and Spring running on Linux VM's to a fully serverless architecture with Quarkus, GraalVM native images, AWS lambda, API gateway and DynamoDB.
I'll talk about (and demo) the Quarkus development experience, migrating code to Quarkus, creating native images and the caveats involved, testing, deploying to AWS with the SAM CLI, monitoring, costs and more.
After this talk, you'll know enough to get started with building and deploying Quarkus native images on AWS Lambda yourself!
3. Serverless computing
GraalVM & Quarkus
Backend architecture
About NLJUG & the
NLJUG events app
From Spring to
Quarkus
Experiences from
running in production
Wrap up & questions
Outline
W h a t ‘ s n e x t ?
Demo!
@bjschrijver
8. NLJUG app: data flow
User
User
App
App
S3
S3
Open app
Get overall metadata
List of all events
Display all events
Select event
Get event metadata
Event metadata
(colors, link to event content)
Get event content
Event content
(highlights, speakers, sessions)
Show Event
User
User
App
App
S3
S3
Open app
Get overall metadata
List of all events
Display all events
Select event
Get event metadata
Event metadata
(colors, link to event content)
Get event content
Event content
(highlights, speakers, sessions)
Show Event
User
User
App
App
S3
S3
Open list of sessions
loop
Get speaker image
Speaker image
Show session list
12. • Functions-as-a-service (FaaS)
• Short running
• Small units of execution
• On demand, pay per use, scale to zero
• Startup time matters (for cold starts)
• There are still servers ;-)
Serverless computing
Background source: https://filmquarterly.org/2012/07/02/i-robot-what-do-robots-dream-of/
17. • JDK & JVM
• Built by Oracle
• Two runtime options:
• run as JVM (Based on Hotspot) with JIT
• ahead-of-time compilation to platform-
specific native image binary
GraalVM
19. • Kubernetes native web framework
• Open source, developed by Red Hat
• Designed to work with Java ecosystem
• Tailored for OpenJDK HotSpot and
GraalVM
• Great developer experience
Quarkus
44. • Cross compiling across cpu architectures is slow
• 3rd party library support for native images is not
guaranteed (but Quarkus libs are good)
• Reflection and native images can be tricky
• Debugging can be painful if problem is not local
• You need limits on lambda and API GW
• Probably good to use build & deploy pipelines ;-)
Quarkus/GraalVM native/Lambda caveats