Course
Overview
Ktor and Exposed make a 100% Kotlin duo for building modern servers: Ktor to expose lightweight, asynchronous HTTP APIs, Exposed to access your databases in a typed and idiomatic way.
No magic or hidden annotations: explicit Kotlin code that you understand, master, and test end to end.
This course guides you step by step, from setting up a Ktor server all the way to putting it into production: routing, serialization, JWT authentication, sessions, tests, and monitoring with OpenTelemetry. On the data side, you will learn to choose between DSL and DAO, between JDBC and R2DBC, to model your tables and relations, to write complex queries, and to evolve your schemas.
By the end of these two days, you will be able to design, secure, test, and run a complete Kotlin server backed by a relational database.
Program
Objectives
Set up a Ktor server and structure its code with the plugin model.
Secure an HTTP API with authentication, JSON Web Tokens, and sessions.
Test and monitor a Ktor server with OpenTelemetry.
Model, query, and evolve a database with Exposed, using either the DSL or DAOs.
Choose the right data access approach: DSL or DAO, JDBC or R2DBC.
Master Exposed's transaction model and write complex queries, including joins.
Prerequisites
Good knowledge of the basics of the Kotlin language, the HTTP protocol, and the SQL language. Some prior back-end development experience is a plus, but not required.
Program
D1
Ktor: building an HTTP server
Morning
Setting up a Ktor server
engines, configuration, and lifecycle
The plugin model
install, configure, and write your own plugins
Call routing
by path and by HTTP method
Serving raw or serialized content
content negotiation and kotlinx.serialization
Call authentication
providers and route protection
Afternoon
JSON Web Tokens
generation and renewal
Session management
cookies, headers, and storage
Static or generated content
files, resources, and templates
Server tests
verify behavior end to end
Monitoring with OpenTelemetry
traces and metrics
D2
Exposed: accessing databases
Morning
DSL or DAO
choose the right level of abstraction
JDBC or R2DBC
blocking or reactive access
Tables & relations
declare your data model
Indexes
declare and optimize indexes
CRUD operations
with the DSL or DAOs
Afternoon
Queries
query with the DSL or DAOs
The transaction model
understand and master transactions
Joins
join tables and queries
Complex queries
write custom queries
Migrations
evolve your schemas
Details
- Format
In-company
- Duration
2 days (14 hrs)
- Level
Intermediate
These trainings might interest you
Our workshops are designed for professionals. Each program is tailored to your team's level and context, whether in-house or as an open session.
Kotlin Multiplatform: Mobile
Share your business logic between Android and iOS without sacrificing the native experience: master the Kotlin Multiplatform toolchain and Swift interoperability to design, distribute, and integrate a robust shared SDK that accelerates your teams.
The Kotlin Language: Concepts & Tools
Discover how Kotlin lets you write less code with fewer errors: its key concepts and tools will quickly make you productive at building safe, readable, and maintainable applications.
Compose: Interfaces in All Their Forms
Embrace declarative thinking to build reactive, maintainable, and performant interfaces. Master state and data flow to share a single UI codebase across Android, iOS, Desktop, and Web.
The Kotlin Language: Expertise for Deploying APIs
Go beyond everyday Kotlin: understand the deep mechanisms of the language and compiler to write idiomatic, safe code, design durable public APIs, and automate code generation.
Kotlin Coroutines: Expert Usage
Go beyond everyday coroutine usage: understand their inner mechanisms, from language primitives to flows, to write reliable, performant, and testable asynchronous code, and choose the right tool for each problem.
Koog: Integrating AI into Your Multiplatform Apps
Go beyond the simple LLM call: use Koog to design AI agents integrated into your Kotlin applications, capable of acting and orchestrating themselves, reliable, cost-efficient, and observable in production.