Hey guys, need some input. At a high-level, I am b...
# server
t
Hey guys, need some input. At a high-level, I am building a social media app with react native as the FrontEnd and for my backend I am using Kotlin, however any thoughts on if I should go with SpringBoot or KTor framework? This app is mobile first (IOS/Android) and Web 2nd.
j
The overlap between ktor and spring is smaller than you think. Things spring boot handles that ktor doesn't includes: Dependency injection, Db access Transaction management External Configuration Messaging (,ie kafka, jms) If you don't need any of that then use ktor.
t
Great feedback @Jacob . Appreciate it!
c
I'd say investigate code base examples of each. SBis very annotation heavy, which I personally hate. If things do not work I have to searhc the internet for answers, SB is soooo big that the answers are readily available, usually I forgot to add some annotation somewhere that only show at runtime.. I much prefer Ktor. It's smaller, has a smaller community (thus less stuff available as plugin). But I prefer to code some things myself in the beginning and get a cleaner codebase in return down the road.
3
c
Also, Ktor is multiplatform, so you can use the same code to test the backend and create your frontend.
c
micronaut and quarkus could also be interesting if you want to go the java annotation based route. if server side development is not your main focus for now using a full featured framework like micronaut, quarkus or spring will safe you a lot of time in the beginning.
☝️ 1
c
if server side development is not your main focus for now using a full featured framework … will save you a lot of time in the beginning.
I disagree, if it's not the main focus, then learning such large frameworks will take way much time for little to no benefits.
c
I havent used it myself but micronaut has great docs and tutorials for all kinds of use cases, and you could learn a lot about server side development there that will also be useful if in the end you decide to use ktor or vert.x or http4k
j
micronaut can also be used with ktor
t
@CLOVIS, familiar with SBB but unfamiliar with Ktor (or setting it up) but seems it's much more lighter. I am in favor of the multi-platform support however. Need to investigate a bit further.
c
i dont really use ktor except for like 2 sample backends i worked on. doesn't ktor backend have a sprint integration? or maybe im misremembering
c
I am developing a social media platform myself right now and I went for Ktor for a large part of the backend. Spring Boot: Too much magic From my previous experience, in Spring boot there is too much magic happening and you need to be an expert in order to get things right and know what annotation you need. Ktor: Modularity at its finest I decided to go for Ktor and I don’t regret it so far. I love the modularity that comes with Ktor and it looks that it will also scale great in a Kubernetes cluster. Building the entire backend modular allows later to load only selected modules in each Ktor instance. I still have to test that out though. Just because Ktor doesn’t come with a huge collection of dependencies doesn’t mean there are no libraries available Even if you plan to use things like Kafka, database connectors etc. they all have their own libraries, just not always as Kotlin libraries. So Ktor wouldn’t be limiting you, its just that you use independent solutions. And these libraries are built with simplicity in focus, so learning them wouldn’t be much of a burden. Spring Boot is powerful No matter what the peoples’ preferences are, Spring Boot is many years longer in development and a lot of resources exist online. So if you have people with many years of experience with Spring Boot, you may kickstart projects quicker. But my personal opinion is that in the long run its better to write everything yourself because you are in full control of everything. This comes with the risk that if something is bad from the beginning, it will only get worse if not fixed at the right moment.