I am confused between the server engines that are ...
# ktor
n
I am confused between the server engines that are available in Ktor. Netty seems the default choice but CIO is something that uses coroutines in its core. Should I use CIO? Would there be any API level difference? I mean the way I use Ktor? What would be some benefits that I can get by choosing CIO over Netty?
b
Engines are well hidden from api surface and are interchangeable. Think of them like batteries for your tv remote - brand makes no difference for general use, bur Duracell might last longer
n
@Big Chungus What would you use? I think CIO seems a pretty solid choice given that it is developed by the Ktor team and uses coroutines. Would there be any disadvantages if I chose CIO?
b
CIO is still considered experimental I think and is not recommended for production. I personally use CIO for all my pet project to help find and report issue as it'll be the one that eventually unlocks mpp ktor server
1
🙏 1
But for jvm, definitely use other, older servers that are much more mature
However to be fair I haven't had any issues with CIO in the past 3 years...
But you can go with CIO initially and just swap the engine if you hit a wall
That's what's so nice about ktor's architecture
i
I use cio in my "pet projects" too. It's worked well for me as well.
c
of the engines that ktor supports i would probably use jetty or netty. imo the 2 fastests http servers for the jvm are undertow and vertx, and both are currently not supported by ktor