Skip to main content

Spring Boot

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/spring-boot

In short

Spring Boot is a Java framework for quickly building production-ready services on top of Spring, with auto-configuration and an embedded web server.

What is Spring Boot?

The Spring Framework has been a foundation of enterprise Java since the early 2000s, known for dependency injection and its many modules for web, data and security. It was also known for heavy configuration. Spring Boot, first released in 2014, removed most of that: you add a starter dependency such as spring-boot-starter-web, and Boot configures the pieces automatically based on what it finds.

A Spring Boot application runs as a single executable JAR with an embedded server such as Tomcat, so you start it with java -jar app.jar instead of deploying into a separate application server. Controllers are plain classes with annotations such as @RestController and @GetMapping, and Spring wires dependencies into them through their constructors.

Around the core is a large ecosystem: Spring Data for databases with JPA and Hibernate, Spring Security for authentication, Spring Cloud for microservice patterns, and Actuator for health checks and metrics. Spring Initializr generates a ready project, and Spring Boot 3 requires Java 17 or later and supports compiling to native images with GraalVM.

A common misconception is that Spring Boot is a different framework from Spring. It is a layer on top of Spring that chooses defaults and wires things up; underneath it is still the Spring Framework, and any default can be overridden when a project needs something different.

Key takeaways

  • Spring Boot builds production-ready Java apps on the Spring Framework.
  • Starters and auto-configuration replace most manual setup.
  • Apps run as a single JAR with an embedded server such as Tomcat.
  • Spring Data, Security and Actuator cover databases, auth and monitoring.
  • It is a layer of defaults on Spring, not a separate framework.

Example

A REST controller in Spring Bootjava
@SpringBootApplication
public class BookApplication {
    public static void main(String[] args) {
        SpringApplication.run(BookApplication.class, args);   // starts the embedded server
    }
}

@RestController
@RequestMapping("/books")
class BookController {
    private final BookRepository books;

    BookController(BookRepository books) {   // injected by Spring
        this.books = books;
    }

    @GetMapping("/{id}")
    ResponseEntity<Book> get(@PathVariable Long id) {
        return books.findById(id)
            .map(ResponseEntity::ok)
            .orElse(ResponseEntity.notFound().build());
    }
}

Readers ask

What is the difference between Spring and Spring Boot?

Spring is the underlying framework with dependency injection and many modules. Spring Boot sits on top of it and adds auto-configuration, starter dependencies and an embedded server, so a Spring application needs far less setup.

Is Spring Boot used for microservices?

Very often. Small, self-contained executable JARs, health checks through Actuator and the Spring Cloud projects make it a common choice for Java microservices.

Can I use Kotlin with Spring Boot?

Yes. Spring Boot officially supports Kotlin, and Spring Initializr can generate Kotlin projects with Gradle or Maven.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings