I’m not going to use ktor as a network client anymore, here’s why

Anton Malinskiy
7 min readApr 1, 2021

There is a lot of hype around ktor: numerous posts on Twitter, Medium, podcasts, and more on how everyone should jump into using it. Let’s take a step back and try to understand the big picture.

Software engineering is a game of tradeoffs: you win in one place but lose in others. So what’s the deal with ktor? There are clearly 2 tradeoffs made with the overall concept of ktor:

  1. Ktor is multiplatform: it strives to support different platforms such as JVM, JavaScript or Native
  2. Ktor is concise: it emphasises easy to write code

Do you feel the loophole in this? I certainly didn’t and boy was I surprised when I received this issue.

You can certainly ignore the context of the project where I’m using the ktor, but here are some important facts about the desired use-case:

  1. Ktor is used as a TCP client
  2. Ktor is used as a coroutines-based API for filesystem IO
  3. The load on the client is burst-based: there is no need to handle a lot of connections at the same time, but the throughput of each socket is of particular interest

What I’m interested in a client boils down to the following needs:

--

--

Anton Malinskiy

Software engineer & IT conference speaker; Landscape photographer + occasional portraits; Music teacher: piano guitar violin; Bike traveller, gymkhana