https://kotlinlang.org logo
#ktor
Title
# ktor
h

Hassaan

01/14/2022, 6:12 AM
Is there any advantage using nodejs over ktor for backend or every possible thing could be done using just ktor
ktor 1
a

Alexander Suraphel

01/14/2022, 11:03 AM
They are basically HTTP libraries and can do the same thing. It all boils down to the third package libraries you want to use with them. Ktor has multiplatform support which is a huge advantage. It boils down to whether you want to use JS or Kotlin.
h

Hassaan

01/14/2022, 11:09 AM
Thanks, as i have already started learning kotlin and writing android applications, i was curious to know to 'would kotlin be enough or should i take a parallel nodeJs path to build backend'. Thanks for the answer.
a

Alexander Suraphel

01/14/2022, 11:12 AM
@Hassaan the Java ecosystem predates node by years. I don’t like Spring personally which is why I use Django/Python but the introduction of Ktor makes your knowledge transferable plus you get to share libraries( e.g. SqlDelight) which why I am diving in. One more thing… SqlDelight supports Kotlin/JS which means you can port your data layer to Node if you chose to do so in the future.
h

Hassaan

01/14/2022, 11:13 AM
Oh, ok
r

Rescribet

01/14/2022, 12:29 PM
We’ve migrated our frontend server from node to ktor for a few reasons: • Trouble with memory leaks • Node was often crashing (unhandled errors in koa, segfaults) • Getting node and typing / es modules working is.. particular The only part which still has to be done for feature parity is getting prerendering of the typescript frontend client working. AFAIK such things could be done either via Graal Polyglot or separating it out into a service that’ll be called by ktor
2 Views