

Table of Contents
- 1. Overview
- 2. Want to learn spring boot but from where to start?
- 3. How to create Rest services and how to make it secure (secure endpoints) in spring boot?
- 4. How to communicate with the databases (SQL/NoSQL)?
- 5. How to debug the application and how to configure logs in spring boot?
- 6. How to deploy a spring boot application in production? and what the important point that we should care about?
- 7. How to develop API documentation, which helps to the frontend developer to call rest points and show in UI?
- 8. Best practice for spring boot application development
1. Overview
If you are visiting this article means that you are going to plan to learn the spring boot. When we are unknown to particular technology at that time we might be a little bit confused about what to learn and from where to start? and also up to which level it will be enough to know about the basic about it. So in this article, we will try to remove the confusion about spring and spring boot.
2. Want to learn spring boot but from where to start?
I would like to say some basic about spring boot, Spring boot is not a framework but it just helps and makes the configurations easy for application development as well as production, Here are some of the advantages of Spring boot:
- Easily configure spring modules like Spring JPA, Spring web and etc using spring starter
- Embedded web servers like Tomcat, Jetty, and undertow (No need to setup server just run single jar)
- Easy dependency management & just worry about modules, not about dependency supported versions
- Simple configurations, No need of XML configurations. Develop an application with minimal configurations
To develop any web application, we should generally know about:
- How to create Rest services and how to make it secure (secure endpoints)?
- How to communicate with the databases (SQL/NoSQL)?
- How to debug the application and how to configure logs?
- How to build and package the application for production or staging (Testing)?
- How to deploy an application in production? and what the important point that we should care about?
- How to develop API documentation, Which helps to the frontend developer to call rest points and show in UI?
- What are the best practices for application development?
3. How to create Rest services and how to make it secure (secure endpoints) in spring boot?
- As we discussed, Spring boot is not a directly a framework in we can develop Rest Service, To develop web services in Spring we should know about
spring-web
modules. Rest service may return data in XML or JSON format, Here is an example of JSON based Rest service and example of XML based Rest service. - In spring to any time of security, we need to know about spring-security module, we can use token-based authentication, It might be Basic authentication or OAuth2.0 authentication.
- Here is details explanation of basic authentication with spring boot and basic authentication with database
- For OAuth2.0, We need an authentication server and the resource server, Here are steps to set up the authentication server and steps to the setup resource server.
- We can also implement digest authentication with spring boot, Here are details steps to implements digest authentication
- Other important links about spring boot and spring security which help us to learn more about spring security’
4. How to communicate with the databases (SQL/NoSQL)?
- Data persistence and communicate with the databases are a very important part of any application, Database can be SQL or NoSQL.
spring-jpa
is a module using that we can communicate with the database. - Here is a tutorial for Spring JPA which will help us know more about Spring JPA.
- Here is a detail explanation of Spring boot with solr, Spring boot with elastic search and nowadays very popular NoSQL database is MongoDB, Here is details explanation of Spring boot rest service with mongoDB.
5. How to debug the application and how to configure logs in spring boot?
- Debugging useful while application development. To check that code execution flow step by step debugging is requires, Here is an article for how to debug that spring boot application.
- Logging mostly useful for production, We check the exceptions and error in the doing from production logs. Spring boot supports so many logging frameworks, Here are configurations examples for log4j and slf4j-and-logbackHow to build and package the application for production or staging (Testing)?
6. How to deploy a spring boot application in production? and what the important point that we should care about?
- To deploy spring boot application in production with just run .jar in production server for 80 for http and 443 for https ports.
- Our database or any other configurations generally different from the production environment, in that case, we can use profiling: Here is an example for how to set different profile for different environments.
- Another challenge for the production deployment is database migrations, Generally each and every we might have new database changes like added some new tables or modification in the schema, we have some tools for database migrations that we can configure in spring boot using that when new build deploy in production at that time .SQL file will be executed automatically. Here is an example of flyway configurations with spring boot and another tool is there for database migration is liquibase, here is an example of liquibase configurations with spring boot.
7. How to develop API documentation, which helps to the frontend developer to call rest points and show in UI?
- We are developing Rest API and automatically generate documents for endpoints then? Look likes a dream !. Dreams come to true using swagger. We can easly configure swagger with our spring web application, which helps UI developers to check and develop a swagger. Here is the guideline to configure swagger with spring boot.
8. Best practice for spring boot application development
- The best practice is a very large topic so we have created a separate tutorial for spring boot best practice, Here are spring boot tips and tricks which help to know more about spring boot. and here are more tutorials related to spring boot.
it would be beneficial for you to Hire spring boot developers from ProminentPixel. We have a wide range of experience in the field and can provide you Best spring boot development services.
2 comments. Leave new
Great Article
Thank you..Ankit.