https://kotlinlang.org logo
#announcements
Title
# announcements
c

Cyberpunk Keanu

11/14/2019, 4:21 PM
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

fred.deschenes

11/14/2019, 4:23 PM
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

Cyberpunk Keanu

11/14/2019, 4:24 PM
So is there any advantage to write APIs with Spring over Ktor?
d

Dariusz Kuc

11/14/2019, 4:26 PM
SpringBoot is the gorilla in the room, much larger ecosystem
also much more mature
f

fred.deschenes

11/14/2019, 4:27 PM
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

Dariusz Kuc

11/14/2019, 4:27 PM
this ⬆️
c

Cyberpunk Keanu

11/14/2019, 4:30 PM
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

fred.deschenes

11/14/2019, 4:30 PM
I'd be very surprised, I just looked and Spring's been around for 17 years
d

Dariusz Kuc

11/14/2019, 4:31 PM
*spring boot only ~5 years
c

Casey Brooks

11/14/2019, 4:34 PM
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

pavel

11/14/2019, 5:39 PM
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

Zachary Grafton

11/14/2019, 6:26 PM
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

Gary

11/14/2019, 8:38 PM
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

Dico

11/19/2019, 4:35 AM
I used ktor in production for about 6 months straight with zero downtime as well.
Super easy to declare routes etc
c

Cyberpunk Keanu

11/19/2019, 5:03 AM
@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

Dico

11/19/2019, 10:36 AM
I reckon I'd just use jdbc. But there are way more advanced libs out there like hibernate.
Just google those