The 30 second answer
The Spring Framework gives the core features: dependency injection, transactions, Spring MVC for web and data access support. Spring Boot sits on top and makes Spring easy to start and run: starters pull in matching dependencies, auto-configuration sets up beans based on what is on the classpath, an embedded server like Tomcat runs inside the app, and Actuator adds health and metrics. So Spring is the framework; Spring Boot is the opinionated way to build and run Spring apps with very little setup.
<!-- level: 1 --> <!-- must_know: true -->
Spring Framework is the foundation: the IoC container that creates and wires objects, plus modules for web (Spring MVC), data access, transactions, security integration and more. Before Spring Boot you had to choose compatible library versions, configure a DispatcherServlet, a DataSource, a transaction manager and so on yourself, and deploy a WAR file to an external server.
Spring Boot removes most of that setup. The Spring Boot reference lists what it adds:
- Starters. One dependency such as
spring-boot-starter-webbrings a tested set of libraries. Spring Boot's dependency management picks the versions, so you usually write no version numbers. - Auto-configuration. Spring Boot configures beans for you based on the jars on the classpath and your properties. If Spring MVC and Tomcat are present, it sets up a web server and the
DispatcherServlet; if a JDBC driver and a URL are present, it creates aDataSource. Your own beans always win over the defaults. - Embedded server. The app is a runnable JAR with Tomcat (or Jetty or Undertow) inside, started with
java -jar. - Production features. Actuator gives health checks, metrics and info endpoints, and externalized configuration lets the same JAR run in every environment.
A one-line answer: Spring Boot is not a replacement for Spring; it is Spring with sensible defaults, so you write business code instead of setup code.
Sources (3)
- Spring Boot reference: overviewdocs.spring.io
- Spring Boot reference: Auto-configurationdocs.spring.io
- Spring Boot reference: Build systems and startersdocs.spring.io