Speaker: Paul Bakker
See the table of contents for more posts
He started out by showing the social media reaction to his few minutes in yesterday’s keynote. Which included “how much do you pay Oracle” to which he said 0 (they use Azul but also Open JDK exists). And my favorite “Java is heavyweight; you should use Kotlin”. Which is entertaining because it is literally the same runtime
For streaming
- Hight RPS (requests per second)
- Multi region – 4 regions. Expensive/slow (milliseconds) to communicate across region, but needs to be near customers.
- Large fanout to backend services
- Retry on failure, aggressive timeous
- Non relational data store
- GraphSQL query to API gateway, federated so can get to multiple data sources. DGS (domain graph service)
- Spring boot
- Kafka
- gRPC
- evCache
- Stream processing – ex: Spark
- Also have Go and Python, but mostly Java
Enterprise/studio apps (ex; managing movie production)
- Low RPS
- Single region
- Relational data store
- Failure not acceptable
- UI and backend
- Similar – GraphQL, Federated Gateway, DGS, spring boot
- Database could be postgres
General
- Were on Java 8 until recently
- Relied on old libraries and old in house framework which were incompatible with modern Java
- Java 11 wasn’t enough incentive to upgrade
- Went to 17 as a big migration
- Migrated all services to Spring Boot – 3000 apps
- Patched unmaintained libraries for JDK availability – “might look hard; its not”
Garbage Collection
- G1 is better on Java 17 than Java 8
- About 20% less CPU on garbage collection
- Switched to Generational ZGC in Java 21. More predictable. Pause times are effectively gone
- Important to have generational garbage collector so doesn’t have to go thru whole heap each collection
- Error rates also dropped due to not having GC related timeouts
Virtual Threads
- Added virtual thread support to internal frameworks
- Virtual threads and structured concurrency will replace reactive
- Java 23 – mixing synchronized and reentrant locks lead to deadlocks due to thread pinning. Some virtual threads are pinned when waiting on lock but no more platform threads available resulting in deadlock
- Had to back off virtual threads some because of that. Fixed in Java 24
Spring Boot
- Added Netflix modules to open source spring boot
- Looks like regular spriing boot to developers
- Upgrade Netflix Spring boot to OSS minor releases in days
- Added: security, gRPT, IPC clients, etc
- Use WebMVC
- Not using Webflux since not using reactive
- Spring 3 – went to Java 17, jakarta packages. Need to upgrade libraries at same time. Used bytecode rewrite in Gradle to change package names during migration
GraphQL vs gRPC
- GraphQL – flexible schema to query data, think in data rather than methods
- gRPC- highly performant for server to server communication. Think in methods rather than data
- REST – easier than GraphQL but doesn’t recommend for UI. Often returns more data than UI needs
Deployment
- Either AWS or Titus (in house k8s)
- Exploded JAR with embedded Tomcat
- Not using native images – not yet working well enough. Hard to get right. Development experience is worse – build time longer, don’t hant to build a native image for development
- Experimenting with AOT and Leyden
My take
Great case study!