Spring Boot vs Spring Framework
Understand exactly what Spring Boot adds on top of the core Spring Framework: auto-configuration, embedded servers, and starters.
Introduction
A common point of confusion for newcomers is the relationship between "Spring" and "Spring Boot." They are not competitors and they are not the same thing — Spring Boot is built directly on top of Spring Framework. This lesson draws a clear line between what each one is responsible for.
Spring Framework: The Foundation
Spring Framework provides the core building blocks: the Inversion of Control (IoC) container, dependency injection, Aspect-Oriented Programming (AOP), transaction management, and the Spring MVC web framework. It is powerful, but using it directly means you are responsible for configuring all of these pieces yourself, deciding which server to deploy to, and wiring dependencies by hand.
What Spring Boot Adds
Spring Boot does not replace any of that. Instead, it adds three things on top of it:
- Auto-Configuration — automatically configures Spring beans based on the JARs found on the classpath, using sensible, overridable defaults.
- Embedded Servers — bundles Tomcat, Jetty, or Undertow directly inside your application so it can run as a standalone JAR with "java -jar".
- Starter Dependencies — curated, pre-tested groups of dependencies (like spring-boot-starter-web) so you no longer have to hunt down compatible library versions yourself.
Here is the same functionality expressed both ways. First, a simplified plain Spring Framework setup using Java configuration.
@Configuration@EnableWebMvc@ComponentScan(basePackages = "com.programinds.demo")public class AppConfig { // You must manually configure a DispatcherServlet, // register it with a servlet container (deployed as a WAR), // and manually declare any additional beans you need.}Now the same application in Spring Boot.
@SpringBootApplicationpublic class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); }}The Spring Boot version needs no `web.xml`, no external Tomcat installation, and no manual `DispatcherServlet` registration — `@EnableAutoConfiguration` (bundled inside `@SpringBootApplication`) detects `spring-boot-starter-web` on the classpath and configures all of it automatically.
Side-by-Side Comparison
| Aspect | Spring Framework | Spring Boot |
|---|---|---|
| Configuration | Manual (XML or Java config) | Auto-configured, overridable |
| Web Server | External (installed separately) | Embedded (Tomcat/Jetty/Undertow) |
| Dependency Management | You resolve compatible versions | Starters bundle tested versions |
| Deployment | Usually a WAR to a server | Standalone executable JAR |
| Setup Time | Hours | Minutes |
Common Mistakes
- Treating Spring Boot and Spring Framework as competing technologies you must choose between.
- Assuming Spring Boot hides so much that you lose control — every auto-configured bean can be overridden or disabled.
- Forgetting that Spring Boot applications still use core Spring concepts like `@Component`, `@Service`, and `@Autowired` underneath.
Best Practices
- Think of Spring Boot as "opinionated Spring," not a separate technology.
- When debugging unexpected behavior, remember it likely comes from an auto-configuration decision that can be inspected or overridden.
- Use the `--debug` flag when starting a Spring Boot app to print a full auto-configuration report if you need to see exactly what was applied.
Frequently Asked Questions
Yes, and many existing enterprise applications still do. You will simply need to manually configure the pieces (web server, beans, dependencies) that Spring Boot would otherwise configure automatically.
No. Every capability of Spring Framework is still available in Spring Boot. Auto-configuration only provides defaults — you can override or disable any of it.
Most developers today learn Spring Boot first since it gets you building real applications faster, and you naturally pick up core Spring concepts (beans, dependency injection) along the way.
Key Takeaways
- Spring Boot is built on top of Spring Framework, not a replacement for it.
- It adds auto-configuration, embedded servers, and starter dependencies.
- Every auto-configured default can be overridden with your own bean definitions.
- Spring Boot apps still use core Spring concepts like dependency injection underneath.
Summary
Spring Boot and Spring Framework are not alternatives — Spring Boot is a productivity layer sitting on top of Spring Framework, adding auto-configuration, embedded servers, and starters so you spend your time writing business logic instead of wiring beans. Next, you will set up your very first Spring Boot project using Spring Initializr.