Why Spring Boot?

The problem it solves

Plain Java gives you a language, not an application. A service needs an HTTP server, JSON mapping, a connection pool, transactions, config per environment, health checks, metrics and tests. Spring Boot wires all of that from a dependency list and sensible defaults.

@RestController
class Api {
    @GetMapping("/ping")
    String ping() { return "pong"; }
}

One dependency and four lines is a running HTTP service.

The three ideas

IdeaWhat it means
Inversion of controlyou declare components, the container creates and connects them
Auto-configurationclasspath contents decide what gets configured
Startersone dependency per topic, versions pinned by the parent

Every default is replaceable: define your own bean, and the auto-configured one backs off.

The ecosystem

ProjectFor
Spring Framework 7core container, MVC/WebFlux, transactions
Spring DataJPA, MongoDB, Redis repositories
Spring Securityauthentication and authorization
Spring Boot Actuatorhealth, metrics, observability
Spring Batch / Integration / Kafkajobs, pipelines, messaging

What is new in Spring Boot 4

  • Modularization — many small jars instead of one spring-boot-autoconfigure
  • Null safety — the whole portfolio is annotated with JSpecify
  • API versioning — first-class support in Spring MVC and WebFlux
  • HTTP service clients — declare an interface, get an implementation
  • Java 25 support — with Java 17 still the baseline
  • Resilience@Retryable and @ConcurrencyLimit moved into the core framework
  • RestTestClient — one test client for mock and live servers

Built on Spring Framework 7, Jakarta EE 11, Jackson 3 and Kotlin 2.2.

Coming from Spring Boot 3?

Most code compiles unchanged. Watch for: Jackson 2 support deprecated, a few renamed properties (spring.dao.exceptiontranslation.enabledspring.persistence.exceptiontranslation.enabled, management.tracing.enabledmanagement.tracing.export.enabled), and @MockBean replaced by @MockitoBean.

When not to use it

  • a 200-line CLI tool — plain Java is lighter
  • hard real-time or tiny memory budgets — the container costs startup and RAM
  • a library that others embed — keep it framework-free

★ Exercises

  1. Name three things auto-configuration does for spring-boot-starter-web.
  2. Remove the web starter from a project. What still runs?
  3. Look up two more starters at start.spring.io and say what each adds.
  4. Which of the Boot 4 features above would change code you already have?