Hey all, I'm new here. With my recent discovery of...
# announcements
c
Hey all, I'm new here. With my recent discovery of Ktor as an Android Developer working in Kotlin, I'm more intrigued about building my own Kotlin Written Server Backends without having to rely much on my team's backend developers. However, almost no one here writes server backend in Kotlin. Everyone's on Node.js & Express.js, saying Ktor doesn't have a Future Scope. So asking you guys, can Ktor grow into something which can be use to write Production level Server Backends?
f
You can use any existing JVM server framework too (Spring, Dropwizard, Vertx, etc), you don't have to specifically use something written in Kotlin. Anyone saying those don't have any future is just disingenuous.
c
So is there any advantage to write APIs with Spring over Ktor?
d
SpringBoot is the gorilla in the room, much larger ecosystem
also much more mature
f
It's probably one of the most used web server frameworks (not just on the JVM but all around), has tons of documentation, does pretty much everything you'd want it too, has a lot of external tools/libraries/tutorials, I could go on for a while (and I'm not even that much of a fan)
d
this ⬆️
c
So just like everyone in my team keeps saying, I'd like to ask, will Ktor ever get to the level of Spring Framework over the course of few years?
f
I'd be very surprised, I just looked and Spring's been around for 17 years
d
*spring boot only ~5 years
c
I woudn’t expect anything to upset Spring, but I don’t think that’s the goal of Ktor. Spring is very much enterprise-focused and has built in support just just about anything you could imagine. Ktor is smaller and more streamlined, offering just the right amount of functionality while not getting in your way. Ktor focuses specifically on the HTTP server portion of the backend while you’re free to use whatever other libraries you like for databases, DI, etc.
p
I don’t have a strong opinion on whether Ktor can be used for production level server backends, but I am completely convinced that node.js and Express.js can’t be used for that purpose 🧌
z
I've used Ktor in a production environment handling over 250k requests a week with absolutely zero downtime. May be anecdotal, but I'd say it is production ready.
g
Spring is embracing Kotlin and you get the benefits of all existing maturity of Spring and it's libraries. We currently run a Kotlin Spring Webflux server in production one of the most stable/performant in our setup. I don't think Ktor should be measured to Spring. Part of the appeal is it's simplicity and that it's not heavy like Spring. Kind of like Flask to Django or Sinatra to Rails?
d
I used ktor in production for about 6 months straight with zero downtime as well.
Super easy to declare routes etc
c
@Dico Can you share more insight on what libraries you use to handle the database? Also any insightful articles, posts, guides to help a beginner get started with? My workplace requires Rest APIs to communicate with SQL Databases. If I could be able to do that with my APIs written in Ktor, I'd be sorted 👍🏻
d
I reckon I'd just use jdbc. But there are way more advanced libs out there like hibernate.
Just google those