Spring boot is one of the most popular java backend solutions. We have covered the different backend technologies ↗ here in greater depth. In this post however we are going to focus on spring boot.
What is spring boot ?
Spring boot is an open source java framework that is designed for microservices but is also fully capable of being used for other scenarios such as pure rest based backends or entirely monolithic full stack applications. It is not a batteries included styled framework like say Ruby on Rails or Laravel, but this is more highly customizable tool with wide variety of options to mix and match. The fact that it runs on JVM automatically also means you can use Kotlin as primary language instead of Java.
Why spring boot for app backends ?
When you are building a backend, very likely your primary need is to have a secure REST based api first. Spring boot makes this extremely simple. Spring boot relies on standard libraries and interfaces such as JPA (Java Persistence API) and its concept of Repositories to very easily give you highly customizable REST based interface for your database tables. Want to list all blog posts in paginated format ? It is as simple as add in one empty method to an interface. It is all ridiculously simple.
But it also has libraries like Spring Security, which will allow you to make your APIs very secure and put them behind different authentication and authorization mechanisms such as Oauth.
Hosting spring boot
Spring boot can be hosted in any major cloud service provider. Typically there arent any free hosting providers like Vercel (for nodejs) or PHP. But the spring boot can run on very tiny machines. For a barely used web application I would recommend using Google Cloud Run service.
We have provided an open source template that you can easily deploy to Google Cloud Run. ↗
Things to consider when choosing Spring Boot.
Spring boot has a steep learning curve
Java or Kotlin are very different from languages like Javascript or PHP. This means learning these languages can take time. In Spring boot you will have to learn concepts like dependency injection, annotations, interfaces, JPA, ORM etc. which may or may not be simple concepts for you. Consider the learning curve when choosing this technology.
Microservices based thinking
Microservices architecture is typically for larger companies. But it might still make sense for your project. Spring boot excels at such archiecture but there is nothing wrong in using it as monolithic framework either.
Do you want a different front end?
At some point you might also want to build a website for you app with all the same features. Do keep in mind that you can either have the same spring boot framework render the web UI or use a separate technology such as nextjs to talk to spring boot backend and render pages. Either are good choices.
Containerization
Spring boot is best when run on containerized services such as Google Cloud Run or your own K8 cluster. I would recommend against spring boot if your plan is to run it on a shared server along with 10 other processes.
We can help you set this up.
If you need help and consultation to achieve this, Wiseland Inc's experienced engineers from Silicon Valley and India are always happy to help. We can setup the basic project structure for you very quickly.