What Spring Boot Does
- Auto-configuration — detect classpath and wire beans automatically
- Embedded server — Tomcat, Jetty, or Undertow built in (no WAR deploy)
- Starters — spring-boot-starter-web, -data-jpa, -security, -actuator
- Actuator — health, metrics, info, env, configprops endpoints
- Spring Data JPA — repository interfaces auto-implement CRUD
- Spring Security — auth, authorization, OAuth2, CORS, CSRF
- Spring MVC — annotation-driven REST controllers
- Spring WebFlux — reactive non-blocking stack
- Profiles — dev/test/prod environment configuration
- GraalVM native — compile to native binary (Spring AOT)
Architecture
Spring IoC container manages beans. Auto-configuration inspects the classpath and conditionally registers beans. Starters bring in curated dependency sets. Actuator exposes operational endpoints. Configuration via application.yml / application.properties with profiles.
Self-Hosting
# Build executable JAR
./mvnw package -DskipTests
java -jar target/demo-0.0.1-SNAPSHOT.jar
# Docker
FROM eclipse-temurin:21-jre
COPY target/*.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]
# Native image
./mvnw -Pnative native:compile
./target/demo # ~30ms startupKey Features
- Auto-configuration
- Embedded server
- 80+ official starters
- Spring Data (JPA, MongoDB, Redis, Elasticsearch)
- Spring Security
- Spring Actuator
- Spring WebFlux (reactive)
- GraalVM native compilation
- Profiles for environment config
- Excellent documentation and guides
Comparison
| Framework | Language | Config | Best For |
|---|---|---|---|
| Spring Boot | Java/Kotlin | Auto-config | Enterprise |
| Quarkus | Java/Kotlin | CDI | Cloud-native |
| Micronaut | Java/Kotlin | Compile-time DI | Serverless |
| NestJS | TypeScript | Decorators + DI | Node enterprise |
| Django | Python | settings.py | Full stack |
| Rails | Ruby | Convention | Full stack |
FAQ
Q: Spring Boot vs Spring Framework? A: Spring Framework is the underlying IoC + AOP + MVC. Spring Boot is the layer on top: auto-configuration, starters, embedded server, so you don't write XML and complex bean configs.
Q: Slow startup? A: JVM startup is indeed slow (1-5s). Solution: Spring AOT + GraalVM Native Image can drop startup time to 30-50ms.
Q: Compared to Quarkus? A: Quarkus is optimized for cloud-native (faster startup, smaller RSS); Spring Boot has the biggest ecosystem and most enterprise experience. Most medium-to-large teams still choose Spring Boot.
Sources
- Docs: https://docs.spring.io/spring-boot/docs
- GitHub: https://github.com/spring-projects/spring-boot
- License: Apache 2.0