Spring Boot is an open-source Java-based framework developed by Pivotal Team. It is commonly used for creating micro-services. It is also used to create stand-alone and production-ready Spring applications.
Building any applications using Java requires a lot of configurations. For example, the Spring MVC framework requires a lot of details in its configuration file. In such projects, if the developer use Maven build tool, just for configuring web components, she/he will have to configure 10s of dependencies in the
pom.xml. There is no need for such hassles in Spring Boot.
Table of Contents
- What is a microservice?
- What is the use of Spring Boot?
- How to create a Spring Boot Project
- Run the Spring Boot application
What is a microservice?
Microservice is a software architecture where an application has its service provided by a collection independently existing smaller services.
This type of architecture makes an application or software highly maintainable and easy to test. It makes an application loosely coupled, and independently deployable.
For example, in a Customer-Relation Management(CRM) application, it will have its user management services running on port 8080. Customer services running on port 8081. Sales services on port 8082, etc (independently deployable).
If you look into the example given above you will see that even if one service fails, others will run independently. In this type of architecture, the application’s administrator or developer will be easily able to see and fix what went wrong(highly maintainable, easily testable).
If one service fails, others will be running without the application completely down. One service need not depend on another to keep it running(loosely coupled).
What is the use of Spring Boot?
With the understanding of microservices and what really is Spring Boot, it is easily understandable what is the use of Spring Boot.
Listing the uses of Spring Boot framework (in short):
- Build easily deployable applications
- Develop easily scalable applications
- Build production-ready microservices
- Minimize development time
- Easy configuration of the development architecture
How to create a Spring Boot Project
The easiest and the most popularly used method to create a Spring Boot project is by using Spring Initializr.
Visit the Spring Initializr’s site. Select a project build tool, programming language, Spring Boot version and enter project meta-data. Then, add all the dependencies you require for your project.
Run the Spring Boot application
Using IDEs, running a Spring Boot application is easy. For running the Spring Boot application using Eclipse IDE, open the main application file, and run it as Java Application.
There are several other ways to run a spring boot application. For an extensive list of ways to run a spring boot application, refer this link.