Hello everyone. I’d like to use Kotlin for a back ...
# getting-started
d
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
h
Spring: mostly hibernate, Ktor often Exposed
j
This is the first I've heard of ktorm, does it have any relationship to ktor?
d
ya it’s an orm for ktor
kt orm
j
Looks like ktor is developed by jetbrains. ktorm is not. I think the only relationship is that they both use kotlin
😂 1
d
ya true
I’d like to see a built in ORM in ktor
j
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
let me look at it. But regarding Ktor, how do we do database queries (without ktorm) ?
r
Spring Boot works perfectly with Kotlin and non-blocking spring-data-r2dbc works nice with spring webflux and kotlin coroutines.
h
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
https://github.com/JetBrains/Exposed is an orm by the same people that develop ktor
👍 1
d
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
Ktorm was updated in May 2021. Hardly outdated and it works very well from my inexperienced perspective