23 - Spring Boot Architecture Overview
- 23 - Spring Boot Architecture OverviewCurrent
- 24 - Key Spring Boot Annotations Explained
- 25 - Auto-Configuration: How Spring Boot Does Magic
- 26 - Spring Boot Starters – The Complete Guide
- 27 - Creating a Basic Spring Boot Application (Hands-on)
- 28 - Embedded Web Servers in Spring Boot (Tomcat, Jetty, Netty)
- 29 - Spring Boot Application Startup Process
- 30 - Understanding the main() Method in Spring Boot
- 31 - Best Practices for Spring Boot Applications
- 32 - application.properties vs application.yml in Spring Boot
- 33 - Profiles & Environment Configuration in Spring Boot (@Profile)
- 34 - Spring Boot Logging – Complete Guide
- 35 - Spring Boot DevTools – Hot Reloading & Developer Productivity
- 36 - Using Spring Boot Actuator (Health, Metrics, Insights)
Spring Boot is often described as “Spring made easy”, but behind that simplicity lies a well-structured architecture. Understanding this architecture helps you:
- Debug startup issues
- Customize behavior confidently
- Design scalable and maintainable applications
- Remove the mystery behind Spring Boot’s “magic”
This post introduces Spring Boot’s architecture from a core-features perspective.
1. High-Level View of Spring Boot Architecture
At a high level, Spring Boot is composed of:
- Spring Framework (Core + Context)
- Spring Boot Auto-Configuration
- Starter Dependencies
- Embedded Web Server
- Externalized Configuration
- Production-ready tools (Actuator)
These components work together to let developers focus on business logic, not boilerplate.
2. Built on Top of the Spring Framework
Spring Boot does not replace Spring. It builds on top of:
- Spring Core (IoC, DI)
- Spring Context
- Spring MVC
- Spring Data
- Spring Security (optional)
Spring Boot simply provides:
- Opinionated defaults
- Automation
- Sensible configuration
3. The Role of the IoC Container
At the heart of Spring Boot lies the Spring IoC Container (ApplicationContext).
It is responsible for:
- Creating beans
- Managing dependencies
- Handling lifecycle
- Applying configuration
Spring Boot always uses ApplicationContext, never BeanFactory directly.
4. Auto-Configuration Engine
Auto-configuration is the most important architectural layer in Spring Boot.
It:
- Detects dependencies on the classpath
- Applies conditional logic
- Registers beans automatically
Example conceptually:
If Spring MVC present → Configure MVC
If JPA present → Configure DataSource & EntityManager
If Jackson present → Configure JSON converters
This is powered by conditional annotations internally.
5. Starter Dependencies
Starters act as entry points into Spring Boot features.
Example:
spring-boot-starter-web
Internally bundles:
- Spring MVC
- Embedded Tomcat
- Jackson
- Validation
Starters ensure:
- Version compatibility
- Minimal configuration
- Faster development
6. Embedded Web Server Layer
Spring Boot embeds web servers directly inside the application:
- Tomcat (default)
- Jetty
- Netty
Benefits:
- No external server setup
- Executable JAR deployment
- Consistent runtime behavior
Application runs using:
java -jar app.jar
7. Externalized Configuration
Spring Boot separates code from configuration.
Configuration can come from:
- application.properties / application.yml
- Environment variables
- Command-line arguments
- Profiles
This makes applications environment-agnostic.
8. Application Startup Flow (Simplified)
main()method executesSpringApplication.run()starts- ApplicationContext created
- Auto-configuration applied
- Beans created & wired
- Embedded server starts
- Application ready to serve requests
Logs printed during startup reflect this flow.
9. Production-Ready Features
Spring Boot includes built-in operational tools:
- Actuator endpoints
- Health checks
- Metrics
- Application info
These are essential for monitoring in real environments.
10. Why This Architecture Matters
Because of this architecture:
- Applications start quickly
- Configuration stays minimal
- Features are modular
- Defaults are safe
- Customization is easy
Spring Boot scales from small demos to large enterprise systems.
11. Summary
- Spring Boot is layered on top of Spring Framework
- Auto-configuration is the core innovation
- Starters simplify dependency management
- Embedded servers simplify deployment
- Architecture supports clean, scalable applications
What's Next?
Next post:
24 - Key Spring Boot Annotations Explained
We’ll explore the most important annotations that power Spring Boot core features.
