Server as a Function in Kotlin
summary
A major scientific publisher site is fully rewritten to pure Kotlin serving tens of millions of requests per day and the team open-sources http4k, a tiny no-deps microservice toolkit built around the service as a function idea (handler: Request -> Response, plus composable filters). It ships routers, multiple backends (Undertow/Jetty/Apache), AWS Lambda support, a 6 MB GraalVM native binary, a lenses system for marshalling and automatic 400s, consumer-driven contract fakes and a chaos module; TechEmpower places it ~16–17th for Kotlin performance.
AI-written summary · about
chapters (25)
- 0:00Intro
- 2:38Techrospective
- 6:05Server as a Function
- 9:11Concept: Service HttpHandler
- 10:15Concept: Filter
- 11:38(New) Concept: Router
- 12:45Serving HTTP
- 13:32Consuming HTTP
- 14:14Extreme Testability
- 15:38Typesafe HTTP Contracts
- 17:39Concept: Lens
- 18:42Lens example
- 20:54Lens application
- 23:19The Layer Cake
- 27:29Standardised Server & Clients
- 28:44Fake Your Dependencies!
- 30:10Application Testing
- 31:48Consumer Driven Contracts
- 34:06Performance
- 36:09What did we gain?
- 38:51all this in 70 lines of Kotlin!
- 40:18serverless4k
- 41:46native4k
- 43:05ecosystem
- 45:58http4k nanoservices
related talks
18mServer-Side Development with Kotlin
03h 13mKotlin 1.4 Online Event, Day 4: server-side Kotlin
45mDeveloping Ultra-Light REST Microservices in Pure Kotlin
37mKotlin on the server with Ktor
53mServer-Side Development with Ktor
01h 13mWriting test driven apps with http4k
46mGoing Serverless with Kotlin
39mWriting Test Driven Apps with http4k
