Building a Sub-100 µs Matching Engine with Kotlin Coroutines

In the world of high-frequency trading (HFT), every microsecond counts. Small inefficiencies can quickly snowball into significant costs or missed opportunities. With Kotlin’s robust coroutine model, we can harness lightweight concurrency to power a matching engine that can respond within sub-100 microseconds. In this post, I’ll walk through the design considerations, coroutine architecture, and performance... Continue reading Building a Sub-100 µs Matching Engine with Kotlin Coroutines

Attack of the Clones: How Kotlin Design Patterns Save the Day (Again)

If you’ve ever had the pleasure of working with generated classes—whether from Protobuf, Swagger, or yet another “magical” schema tool—you’ll know they’re about as customizable as a locked-down corporate laptop. The result? Multiple classes that all do basically the same thing (e.g., PersonA, PersonB, PersonC) but refuse to share a single interface. In Kotlin, this... Continue reading Attack of the Clones: How Kotlin Design Patterns Save the Day (Again)

Implicit Temporal Coupling in Asynchronous Systems

Introduction: A Race Against… Yourself? You’ve just rolled out a fancy asynchronous service that purrs like a well-tuned engine. Except it occasionally goes “pop.” Not a life-threatening pop, no giant performance catastrophes or memory leaks, but the kind of glitch that leaves everyone scratching their heads, thinking: “I’m sure that wasn’t happening yesterday.” If you’ve... Continue reading Implicit Temporal Coupling in Asynchronous Systems

Database Denormalization: Boosting Performance, Managing Trade-offs, and Best Practices for Implementation

Every database purist has a moment of crisis when they consider denormalizing perfectly clean, 3NF-compliant data. We spend so much time in university or reading blog posts being told “Don’t Repeat Yourself” or “No duplication in the database!” that the very thought can feel like sacrilege. Yet here we are, about to talk about intentionally... Continue reading Database Denormalization: Boosting Performance, Managing Trade-offs, and Best Practices for Implementation

Merging Old-School OOP with Dataflow: The Awesome Visitor + Pipe-and-Filter Mashup

Ever wake up in the middle of the night thinking, “I love reading about design patterns, but do we really need more ways to pass data around?” No? Well, if you’re still here, you probably enjoy borderline masochistic discussions about code architecture as much as I do. Today, we’ll look at two seemingly unrelated design... Continue reading Merging Old-School OOP with Dataflow: The Awesome Visitor + Pipe-and-Filter Mashup

Taming the Optional Beast When Interfacing Between Java and Kotlin – Without Losing Your Sanity or Null Safety

So you’ve got a Kotlin codebase that you love more than your morning coffee, and yet there’s still that pesky legacy Java component that’s holding on for dear life. Somewhere in there is Optional<T> – Java’s fancy way of saying “maybe it’s there, maybe it’s not,” which Kotlin takes very, very personally. If you’ve ever... Continue reading Taming the Optional Beast When Interfacing Between Java and Kotlin – Without Losing Your Sanity or Null Safety