Trace Id is missing
Skip to main content
Azure
People working in office on their laptop screen

What is Java Spring Boot?

An intro to Spring Boot—the popular, Java-based tool for developing web apps and microservices.

A person watching laptop screen and using external keyboard with mouse

What is Spring Boot?

Java Spring Boot is an open-source tool that makes it easier to use Java-based frameworks to create microservices and web apps. For any definition of Spring Boot, the conversation has to start with Java—one of the most popular and widely used development languages and computing platforms for app development. Developers all over the world start their coding journey learning Java. Flexible and user-friendly, Java is a developer favorite for a variety of apps—everything from social media, web, and gaming apps to networking and enterprise applications.

Java and the Spring framework

While Java may be easy to use and easier to learn than other languages, the level of complexity to build, debug, and deploy Java apps has escalated to dizzying new heights. This is due to the exponential number of variables modern developers are faced with when developing web apps or mobile apps for common modern technologies such as music streaming or mobile cash payment apps. A developer writing a basic line-of-business app now needs to deal with multiple libraries, plugins, error logging and handling libraries, integrations with web services, and multiple languages such as C#, Java, HTML, and others. Understandably, there is an insatiable demand for any tools that will streamline Java app development, saving the developers time and money.

Enter application frameworks—the large bodies of prewritten code that developers can use and add to their own code, as their needs dictate. These frameworks lighten the developer's load for almost any need—whether they're developing mobile and web apps or working with desktops and APIs. Frameworks make creating apps quicker, easier, and more secure by providing reusable code and tools to help tie the different elements of a software development project all together.

Here's where Spring comes in: Spring is an open-source project that provides a streamlined, modular approach for creating apps with Java. The family of Spring projects began in 2003 as a response to the complexities of early Java development and provides support for developing Java apps. The name, Spring, alone usually refers to the application framework itself or the entire group of projects, or modules. Java Spring Boot is one specific module that is built as an extension of the Spring framework.

So, with that background on how the Spring framework, Spring Boot, and Java work together, here's the definition of Spring Boot—the tool that streamlines and speeds up web app and microservices development within the Java framework, Spring.

Sometimes, because the language and/or platform is Java, it gets referred to as "Java Spring Boot," the "Java Spring framework," or the "Spring Boot framework." However, because there are other third-party frameworks for Java, such as Play and Hibernate, it's more accurate to say "Spring" and "Spring Boot."

For a high-level discussion of Java basics, check out the article, What is Java?

What's the difference between Spring and Spring Boot?

As mentioned earlier, Spring is an open-source, Java-based app framework that covers many smaller projects under its umbrella. Other popular Spring projects include Spring Data, Spring Cloud, and Spring Security, just to name a few. To understand the difference between Spring Boot vs. Spring, it's important to realize that, even though there may be differences in core capabilities, it's all in the Spring family.

To fully understand the differences between Spring and Spring Boot, we'll need to define a few key terms first.

A person looking in the laptop.
A woman looking in the tablet.

What are microservices?

Microservices are an approach to software development architecture. The "micro" in microservices refers to code being delivered in small, manageable pieces, or components, and each "service" or core function, is created and deployed independently from the other services. The independent components work together and communicate through prescribed API documents called contracts. The small scale and relative isolation of these microservices has many benefits. For example, because this type of architecture is distributed and loosely coupled, the whole app doesn't break if one component fails. Other benefits are improved productivity, easier maintenance, better business alignment, and greater fault tolerance.

What is dependency injection?

Dependency injection (DI) is a design technique used to achieve inversion of control (IoC). In object-oriented programming like Java, objects that depend on other objects are called dependencies. Typically, the receiving or dependent object is called a client and the object that the client is dependent on is called a service. So, dependency injection passes the service to the client, or "injects" the dependency using code called an injector. DI eliminates the need for the client to specify which service to use—the injector does that work for the client.

A person looking in the laptop and monitor
A woman wearing a VR headset

What is convention over configuration?

Convention over configuration, sometimes called coding by convention, is a concept used in application frameworks to reduce the number of decisions that a developer has to make. It adheres to the "don't repeat yourself" principle to avoid writing redundant code. Coding by convention strives to maintain flexibility while allowing a developer to only write code for the unconventional aspects of the app they're creating. When the desired behavior of the app matches the conventions established, the app will just run by default without having to write configuration files. The developer will only need to explicitly write configuration files if the desired behavior strays from the "convention."

Spring framework vs. Spring Boot

Because Spring Boot is built on the benefits of the Spring framework, it's not really an "either/or" question of Spring vs. Spring Boot, but rather a "both/and" benefit. It's not Spring vs Spring Boot; Spring and Spring Boot go hand in hand:
organization-wide support plan
Spring Spring Boot
What is it?

An open-source web application framework based on Java.

An extension or module built on the Spring framework.

What does it do?

Provides a flexible, completely configurable environment using tools and libraries of prebuilt code to create customized, loosely coupled web apps.

Provides the ability to create, standalone Spring applications that can just run immediately without the need for annotations, XML configuration, or writing lots of additional code.

When should I use it?

Use Spring when you want:

  • Flexibility.
  • An unopinionated approach.*
  • To remove dependencies from your custom code.
  • To implement a very unique configuration.
  • To develop enterprise applications.

Use Spring Boot when you want:

  • Ease of use.
  • An opinionated approach.*
  • To get quality apps running quickly and reduce development time.
  • To avoid writing boilerplate code or configuring XML.
  • To develop REST APIs.
What's its key feature?

Dependency injection

Autoconfiguration

Does it have embedded servers?

No. In Spring, you'll need to set up the servers explicitly.

Yes, Spring Boot comes with built-in HTTP servers like Tomcat and Jetty.

How is it configured?

The Spring framework provides flexibility, but its configuration has to be built manually.

Spring Boot configures Spring and other third-party frameworks automatically by the default "convention over configuration" principle.

Do I need to know how to work with XML?

In Spring, knowledge of XML configuration is required.

Spring Boot does not require XML configuration.

Are there CLI tools for dev/testing apps?

The Spring framework alone doesn't provide CLI tools for developing or testing apps.

As a Spring module, Spring Boot has a CLI tool for developing and testing Spring-based apps.

Does it work from an opinionated or unopinionated approach?

Unopinionated*

Opinionated*

*Opinionated vs. unopinionated framework approach

While the word "opinionated" may sound vaguely negative, both the opinionated approach of Spring Boot and the unopinionated Spring framework have their advantages.

Opinionated approach

An opinionated approach takes the position that there is one way that is significantly easier than all the others. By design, the software limits designers, encouraging them into doing things in that prescribed way.

It provides a well-paved path, a best practice that will work for most people in most situations. The app is written sticking closely to these best practices and widespread conventions. An opinionated approach makes collaboration and getting help with a coding project much easier—other developers who have experience with that framework will have immediate familiarity with the new app and can jump right in.

Unopinionated approach

An unopinionated approach is adopted if all solutions require roughly the same amount of effort or complexity. It takes the position that there's no one right way to arrive at a solution to a problem. Rather, it provides flexible tools that can be used to solve the problem in many ways. Unopinionated frameworks have the benefit of providing lots of flexibility in development and they put more of the control in developers' hands. The main disadvantage with so much flexibility is that the developer has more decisions to make and may end up having to write more code because the framework is so open-ended and well, unopinionated.

Spring Boot features and benefits

Finally, the exciting part—the core capabilities that Java Spring Boot provides beyond the Spring framework. Spring Boot gives an easier, quicker path to set up, configure, and run apps. It eliminates the heavy lifting of configuration that is required for setting up most Spring-based apps. Developers can jump right in and use Spring Boot without ever having to learn the underlying Spring framework.

A person sitting on a chair and watching on the desktop screen

Here's how Spring Boot features help to streamline Java programming tasks. Some key features of Spring Boot are:

Benefits of Spring Boot

Spring Boot:

Java Spring Boot tutorials

If you're already familiar with building apps using the Spring framework, you'll probably find it straightforward to learn Spring Boot using the tutorials, project starters, and documentation provided in this section. But here's some good news if you're in a hurry to use Spring Boot but don't know the framework yet. It's possible to learn Spring Boot —and get started working with it—before learning the Spring framework, because you'll pick up many of the framework fundamentals as you go along. While this won't teach you everything there is to know about the framework, it will give you a good head start if you decide to learn it later on.

Another benefit of learning Spring Boot, besides making app development much faster and more efficient, is that it also sets you up to be able to use other Spring capabilities, namely Spring Data, Project Reactor, and Spring Security.

A person talking over laptop using headphones
That said, you'll find it easier to work through your first Spring Boot tutorial if you first learn how the basic concepts of dependency injection and inversion of control work in the Spring framework. Here's a very high-level overview:

Dependency injection

  • XML-based, i.e., <beans/> and <namespace:*/>.
  • Annotation-based, i.e., @Component, @Autowired, @Inject.
  • Java-based, i.e., @Configuration classes, @Bean methods.

Inversion of control (IoC)

  • ApplicationContext—the root interface that serves as the Spring IoC container.
  • BeanFactory—the interface to access the Spring container.
  • Beans—the objects instantiated, assembled, and managed by ApplicationContext.

Java Spring Boot tutorials for beginners

Once you've mastered the basics, if you're looking to build and deploy Spring Boot apps at scale, consider checking out the fully managed Azure Spring Cloud service from Microsoft and VMware. Or—get started right away with this tutorial on how to secure your Spring Boot apps with TLS/SSL certificates.

Create and help secure a Java app

Create a Java app with the Spring Initializr using the Spring Boot starter for Microsoft Entra ID (formerly Azure Active Directory).

Deploy your first app to Azure Spring Cloud

Learn to create, provision, and monitor a simple Spring Boot app built with Spring Initializr.

Build a simple Spring Boot microservice

Build and deploy a simple microservice—and then learn to add Spring Cloud technologies to it.

More Spring Boot starters

Add storage, security, authentication, and key vault features to your Spring Boot apps.

FAQs

  • Spring Boot is an open-source, microservice-based Java web framework offered by Spring, particularly useful for software engineers developing web apps and microservices.

  • "Spring Boot in Java" is another way of saying "Java Spring Boot"—the two terms can be used interchangeably. Java is the language and platform, Spring is the application framework based on Java, and Spring Boot is an extension of the Spring framework, with some added benefits.

  • Spring Boot has the functionality of the general Spring framework, but Spring Boot doesn't require you to learn Spring. A developer can get an app up and running with less time because Spring Boot attributes are autoconfigured and the opinionated approach removes much of the boilerplate code and configuration involved with Spring app development and deployment.

  • Yes, as mentioned above, Spring Boot is particularly useful for a microservice approach to software development architecture. Microservices are a popular way to build small, autonomous teams that can work independently—and by their very nature—microservices only work in the backend.

  • Reduced development time, increased productivity, and ease of use are just a few of the benefits of developing Spring Boot apps.

  • There are lots of tutorials, quickstarts, and documentation on the Spring website as well as Spring Boot Starters and documentation from Microsoft Azure. If you'd like to get started right away deploying Spring Boot apps, check out the webinar, Accelerate Spring Boot Applications to Cloud at Scale.

Ready when you are—let's set up your Azure free account