Vishal's Blog
Header

23 - Spring Boot Architecture Overview

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)

  1. main() method executes
  2. SpringApplication.run() starts
  3. ApplicationContext created
  4. Auto-configuration applied
  5. Beans created & wired
  6. Embedded server starts
  7. 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.