https://kotlinlang.org logo
#getting-started
Title
# getting-started
d

dany giguere

01/05/2022, 6:33 PM
Hello everyone. I’d like to use Kotlin for a back end. Would you recommend Spring or Ktor ? and What is the orm for Spring ?
e

Eamon Keane

01/05/2022, 6:37 PM
h

hfhbd

01/05/2022, 6:43 PM
Spring: mostly hibernate, Ktor often Exposed
j

Jacob

01/05/2022, 7:31 PM
This is the first I've heard of ktorm, does it have any relationship to ktor?
d

dany giguere

01/05/2022, 7:33 PM
ya it’s an orm for ktor
kt orm
j

Jacob

01/05/2022, 7:36 PM
Looks like ktor is developed by jetbrains. ktorm is not. I think the only relationship is that they both use kotlin
😂 1
d

dany giguere

01/05/2022, 7:38 PM
ya true
I’d like to see a built in ORM in ktor
j

Jacob

01/05/2022, 7:43 PM
ktor is just web. spring has a lot more but it brings along a lot of legacy with it. Reading the docs still require an understanding of xml based config even though no one does that anymore
ktorm looks like it hasn't been updated in a while. I would be suspicious of it
You might want to look at micronaut. Similar to spring but less history to be aware of
d

dany giguere

01/05/2022, 7:47 PM
let me look at it. But regarding Ktor, how do we do database queries (without ktorm) ?
r

Robert Jaros

01/05/2022, 7:49 PM
Spring Boot works perfectly with Kotlin and non-blocking spring-data-r2dbc works nice with spring webflux and kotlin coroutines.
h

hfhbd

01/05/2022, 7:50 PM
Ktor does not provide a built-in db or even ORM framework support. Ktor is "only" a web server. You are free to use any ORM framework.
👍 1
j

Jacob

01/05/2022, 7:51 PM
https://github.com/JetBrains/Exposed is an orm by the same people that develop ktor
👍 1
d

dany giguere

01/05/2022, 8:01 PM
Thanks a lot guys. I really want to get into learning Kotlin on the server side. Your input helps. 🙂
I think I’ll try this tutorial https://bettercoding.dev/kotlin/ktor-rest-api-exposed/ to learn Ktor with Exposed and Kodein (for depedency injections)
j

Jasin Colegrove

01/10/2022, 9:46 AM
Ktorm was updated in May 2021. Hardly outdated and it works very well from my inexperienced perspective