Hi folks. Apologies — I am not a Kotlin expert. I...
# server
j
Hi folks. Apologies — I am not a Kotlin expert. I currently work at a co that has several Kotlin web services built on Dropwizard, JOOQ, Sqitch. They’ve served our org well and I’m planning on taking a similar direction for a new web service that needs to be built. I was wondering if anyone in this group has strong opinions on technology selections I might consider in the new service that could benefit our org overall in the long term (considering where we are at currently). I’m very unfamiliar with the landscape of options out there. I’m especially interested in any experience folks have with developing gRPC services or other approaches to automating server-endpoint and api-client construction in a Kotlin context.
d
Oh man this is a big topic. I worked at Bird and we used a Kotlin backend way back during 1.3 days, also did a talk on this. Look up Ktor, Exposed, Gradle or Bazel as build system (I prefer bazel but it has a steep curve). All are backed by huge communities and strong company profiles. For automated api clients, kotlin multi platform should do the trick. Essentially create frameworks or Jars for both clients and then port them over to their respective repos. (Only buildable via gradle tho)
I’m not really a fan of auto generated api builders, I find hand rolling your own architecture with something as unopinionated and opt-in feaureset like Ktor removes and simplified lot of complexity for new developers during onboarding.
Once you have a good structure for your repo duplicating them for multiple services becomes easy
d
Maybe Micronaut and Micronaut Data, has support for grpc too, and also kotlin and partial support for coroutines
t
If you’re happy with your tech stack and it’s working for you, stick with it
You don’t have to use the new shiny things
j
If you want to try something written in Kotlin for Kotlin, you could try https://hexagonkt.com which is a microservices toolkit inspired by the http://sparkjava.com toolkit (disclaimer: I'm one of the maintainers)
t
I used Spark once, I really liked it
💯 1
f
If you want to use gRPC I would recommend to stick with the official gRPC kotlin tech stack. https://grpc.io/docs/languages/kotlin/quickstart/ It supports the wide range of gRPC/http2 features like streaming properly. The underlying data types are still based on Java though, but the grpc-team is working on bringing kotlin to that part as well.
We’re using gRPC heavily (with kotlin) and quite happy with it (except for some heavy lifting required to get streaming to work on top of istio, and to get jaeger-tracing to work properly)
j
Dang! Great suggestions everyone. Thank you so much, really appreciate all the thoughtful responses.
a
Look into javalin