Of the three web server frameworks I've found in K...
# server
v
Of the three web server frameworks I've found in Kotlin - ktor, javelin and sparkjava-kotlin - are there any different design goals or use cases which would help me choose between them? I've been using spark-kotlin quite happily, and I'm looking to build straightforward web applications. But javelin in particular seems to sell itself as better than spark-kotlin.
r
Not to answer your question, but we use a fourth: http://jooby.org/doc/lang-kotlin/
d
@v79 Ktor is based on coroutines, making async operations much more efficient... but actual async libs (like for db access) are currently missing for now... I opened an issue to propose Vert.x async libs integration with ktor: https://github.com/ktorio/ktor/issues/286 Also Vert.x can be used w/ coroutines, but has tons more features that might not be necessary in your case. Docs are still missing for ktor so you need to learn from source code and examples... If you're not looking for performance, your other options moght be simpler...
r
But having a coroutine-based http client is surely a sweet thing. We use https://github.com/AsyncHttpClient/async-http-client and wrap coroutines around that…
There are some advantages besides raw scalability, namely not having to size thread pools etc
But otherwise asyncio can be overkill or just extra complexity if you do not need it…
v
I don't think performance is a concern for me at all, really. Low volume stuff. I'm more interested in integration with templating engines, validation, model binding - a little bit of the sort of magic that SpringMVC brings, for instance.
d
@rrva What about data access, like mysql and postgres any async libs there?
r
http://jooby.org/doc/jdbc/ ? No experience myself
d
That's async, and decoupled from jooby?
r
Hmm.. would not think so..
I think you’d have to use http://jooby.org/doc/rxjava-jdbc/ then
Here is the datastore section http://jooby.org/doc/datastore/. Maybe each of these have async options
d
Funny to have to include rx for such a thing, but I guess I'll look into all these jooby modules... they seem to be working very hard there 😄, maybe I'll uncover some treasure lib...
r
http://jooby.org/doc/requery/ has a KotlinEntityDataStore
which looks sync…
d
Thanks, I'll take a look.
r
I guess you would have to bridge between rxjava and coroutines in some cases… Maybe it’s nicer if the libraries just use CompletableFuture etc
t
@v79 if you have any questions about javalin, feel free to ask (either in channel or direct message)