Software Engineeer at DoorDash
James is a backend software engineer at DoorDash, based in New York City.
Writing backend APIs in a functional programming style
This talk covers a pattern for writing backend APIs in a functional programming style, with a focus on separating business logic from I/O. I will showcase how Kotlin's structured concurrency features make separating business logic from I/O easier. By decoupling I/O and business logic, we can robustly handle errors while making it easy to modify our code in response to changing product requirements.
To illustrate these patterns, we'll walk through the code for a gRPC endpoint that calls three services using the functional-core, imperative-shell pattern. Then we'll build on that example by adding new product requirements to demonstrate how structured concurrency and lazy loading help us keep business logic and I/O separate.