Why Spring Boot
The backend is where correctness, throughput and operability actually matter. Spring Boot wins there not because any single feature is unbeatable, but because it is the only option where everything — security, data, messaging, batch, observability, testing — is production-grade and designed to fit together.
1 · The JVM is still the best general-purpose server runtime
| JVM | Node.js | Python | Go | |
|---|---|---|---|---|
| CPU-bound throughput | Excellent (JIT) | Poor — single-threaded | Poor | Excellent |
| True multithreading | Yes | Worker threads, awkward | GIL | Yes |
| Memory footprint | Higher | Lower | Lower | Lowest |
| Startup | 1–3 s (0.05 s native) | Fast | Fast | Fast |
| Profiling & diagnostics | JFR, heap dumps, async-profiler | Basic | Basic | pprof |
| Library depth for business software | Unmatched | Broad but shallow | Strong in data/ML | Thin |
Java 21's virtual threads removed the last serious objection: you can now handle very high I/O concurrency with ordinary blocking code, which is far easier to read and debug than reactive pipelines.
spring:
threads:
virtual:
enabled: true
2 · Observability nobody else matches
/actuator/health/liveness is the process wedged? /actuator/health/readiness can it serve traffic? /actuator/prometheus request latency histograms, JVM, pool, GC /actuator/conditions why is this bean missing? /actuator/threaddump what is every thread doing right now? /actuator/heapdump what is consuming the heap? /actuator/loggers change log levels without a restart
Distributed tracing is one more dependency and trace ids appear automatically in every log line. Achieving the equivalent in most other ecosystems means assembling four libraries and maintaining the glue. Detail in Spring Boot chapter 12.
3 · Convention that you can always inspect
Auto-configuration is often described as magic. It is not — it is conditional
@Bean methods, and the framework will show you every decision it made:
java -jar app.jar --debug # prints the CONDITIONS EVALUATION REPORT
Every default backs off the moment you define your own bean. You get a working application in one file and full control the moment you need it — without a "eject" step that dumps 2,000 lines of configuration on you.
4 · Security you are not writing yourself
Spring Security handles JWT validation, key rotation, OAuth2/OIDC flows, CSRF, session fixation, password hashing and method-level authorisation — reviewed by a large community and patched quickly. Hand-rolled auth is where small teams create their worst vulnerabilities.
spring:
security:
oauth2:
resourceserver:
jwt:
issuer-uri: https://auth.example.com/realms/orders
audiences: orders-api
5 · Backwards compatibility measured in decades
Code written against Spring 3 largely still compiles against Spring 6. Deprecations run for
years before removal, and major migrations ship with tooling (OpenRewrite recipes,
spring-boot-migrator). For software that must be maintained for ten years,
that track record is a feature you can price.
6 · Testing is a first-class concern
| Need | Provided |
|---|---|
| Test one layer fast | @WebMvcTest, @DataJpaTest, @JsonTest |
| Real database in tests | @ServiceConnection + Testcontainers, zero config |
| Replace a bean | @MockitoBean |
| Assert HTTP behaviour | MockMvc without a socket |
| Security tests | @WithMockUser, jwt() post-processor |
What it costs, honestly
| Cost | Mitigation |
|---|---|
| ~250 MB idle memory | Fine on a container; expensive at 200 replicas. Native images cut it to ~60 MB. |
| 1–3 second startup | Irrelevant for long-running services; CDS or native for serverless. |
| Surface area is large | You can be productive with about 20 annotations; the rest waits until needed. |
| Proxy-based magic has sharp edges | Self-invocation, non-public methods — one page of rules (chapter 13). |
| Two languages if the front end is TypeScript | Real. The trade is a better runtime and a better ops story. |
Which Spring Boot property is most often the difference between a healthy service and an exhausted connection pool?
The default keeps a database connection bound to the request thread until the response is written, which hides N+1 queries and drains the pool under load. It is the first setting to change in any new project.