ArchitectMind
  1. Home
  2. Java Ecosystem
  3. Book 4 · Spring & Spring Boot
  4. Volume III
  5. Spring Boot vs Spring Framework
Book 4 · Volume III — Spring Boot, Configuration & Application Lifecycle · Topic 1.3

Spring Boot vs Spring Framework

Relationship, differences and when Spring Boot is useful

10 min readStage 2 · Frameworks & design8 interview questions
Chapter
Chapter 1 — Spring Boot Fundamentals
Prerequisites
Topics 1.1–1.2
You will be able to
Explain precisely how Boot relates to the Framework, contrast them across key dimensions, and decide when Boot is (or is not) the right choice
Covers
Relationship · Differences · When Boot Is Useful
On this page
  1. 1. Concept / Definition
  2. 2. Why It Exists
  3. 3. Core Concepts
  4. 4. How It Works Internally
  5. 4A. Deep Dive — Using Boot Features Without Full Boot Opinions
  6. 5. APIs / Features / Syntax
  7. 6. Practical Examples
  8. 7. Common Problems & Mistakes
  9. 8. Performance & Production Considerations
  10. 9. Architecture & Design Considerations
  11. 10. Interview Questions & Answers

1Concept / Definition

The Spring Framework is the programming model and container: dependency injection, AOP, transactions, data access, Spring MVC and WebFlux, events, and more. Spring Boot is an opinionated assembly and runtime layer for Spring applications: it chooses dependencies, configures infrastructure beans conditionally, embeds a server, externalizes configuration and adds production features.

Boot builds on the Framework and the wider Spring portfolio
Figure 1 — Boot builds on the Framework and the wider Spring portfolio
StatementTrue?Why
Boot replaces the Spring FrameworkNoEvery Boot application runs on the Framework's container
Boot adds a new programming modelNoControllers, beans, @Transactional are Framework features
Boot can be used without the FrameworkNoBoot depends on it
The Framework can be used without BootYesLibraries, legacy WARs, custom runtimes
Boot configures other Spring projectsYesData, Security, Batch, Kafka, Integration… via auto-configuration
Table 1 — Common misconceptions

2Why It Exists

As the Spring portfolio grew (Spring Data, Spring Security, Spring Batch, Spring Integration, Spring Cloud), integrating them correctly became a skill in itself. The Framework deliberately stays unopinionated — it must serve libraries, application servers and every kind of application. Boot was created as a separate project so that opinions about defaults, versions and packaging could evolve without constraining the Framework's generality. The two projects are released in coordinated generations: Boot 4 is built on Framework 7, Boot 3 on Framework 6.

3Core Concepts

3.1 Relationship

LayerProvidesExample
Java / Jakarta EERuntime and APIsJVM, Servlet 6.1, JPA 3.2, Bean Validation
Spring FrameworkContainer and programming model@Component, @Transactional, @RestController
Spring portfolio projectsDomain capabilitiesSpring Data repositories, Spring Security filter chain
Spring BootAssembly, configuration, runtime, operationsStarters, auto-configuration, embedded Tomcat, Actuator
Table 2 — The Spring stack

Boot's auto-configuration calls the same Framework APIs you would call by hand — it creates a JpaTransactionManager, registers a DispatcherServlet, builds a SecurityFilterChain. Understanding the Framework (Volumes I–II) is therefore a prerequisite for understanding what Boot configures.

3.2 Differences

Framework and Boot compared
Figure 2 — Framework and Boot compared
DimensionSpring FrameworkSpring Boot
PurposeProgramming model and containerOpinionated application assembly and runtime
ConfigurationExplicit (Java config, XML)Auto-configuration + properties; explicit overrides
DependenciesYou choose libraries and versionsStarters + managed BOM
ServerDeploy WAR to external container (or embed yourself)Embedded server, executable jar (WAR optional)
Configuration values@PropertySource, EnvironmentRich externalized configuration, relaxed binding, @ConfigurationProperties
Production featuresBuild your ownActuator, Micrometer, probes, graceful shutdown
TestingSpring TestContextPlus test slices, @SpringBootTest, Testcontainers integration
Packaging and imagesStandard Java toolingBoot build plugins: executable/layered jars, buildpack images, AOT
Table 3 — Detailed comparison

3.3 When Boot is useful

Decision guide
Figure 3 — Decision guide

Boot is the default choice for applications: web services, APIs, event-driven workers, batch jobs, CLIs. Plain Framework remains appropriate for libraries (which must not impose Boot's opinions on consumers), for applications deployed into existing application servers where Boot's runtime adds nothing, and for highly specialised runtimes that need full control over assembly.

ScenarioRecommendation
New REST microserviceBoot (spring-boot-starter-webmvc or -webflux)
Kafka consumer / scheduled workerBoot with web-application-type: none
Reusable company libraryPlain Spring (or no Spring); ship an optional Boot starter separately
Legacy WAR on WebLogic, gradually modernisedBoot WAR packaging or Framework only; plan migration
Serverless function with tight cold-start budgetBoot + AOT/native image, or Spring Cloud Function
Table 4 — Choosing between Boot and plain Framework

4How It Works Internally

Responsibilities of each layer
Figure 4 — Responsibilities of each layer

The practical consequence of the layering is where to look when something breaks:

SymptomLikely layerWhere to look
Bean behaves wrongly (proxy, transaction, injection)FrameworkVolumes I–II concepts, Framework docs
Bean missing, duplicated or unexpectedly presentBoot auto-configurationCondition report, /actuator/beans
Wrong property value usedBoot externalized configuration/actuator/env, /actuator/configprops
NoSuchMethodError after upgradeBoot dependency managementdependency:tree, BOM alignment
Service not ready / killed by platformBoot lifecycle + ActuatorAvailability states, probes
Table 5 — Troubleshooting by layer

4ADeep Dive — Using Boot Features Without Full Boot Opinions

Boot is modular; you can adopt parts of it:

NeedOption
Aligned versions onlyImport spring-boot-dependencies BOM without Boot at runtime
Boot runtime but minimal auto-configuration@ImportAutoConfiguration with an explicit list instead of @EnableAutoConfiguration
Boot in a WAR on an external serverExtend SpringBootServletInitializer; mark server starter as provided (spring-boot-starter-tomcat-runtime for Tomcat deployments in Boot 4)
Library that works with and without BootCore library with no Boot dependency + separate *-spring-boot-starter module
Upgrade path from Boot 3Classic starters (spring-boot-starter-classic) as a temporary bridge to Boot 4 modularity
Table 6 — Partial adoption strategies
JAVA
// A test or specialised runtime importing only selected auto-configurations
@Configuration
@ImportAutoConfiguration({
        DataSourceAutoConfiguration.class,        // imports from the Boot JDBC module
        JdbcTemplateAutoConfiguration.class })
class MinimalJdbcConfig { }

5APIs / Features / Syntax

Framework-only mechanismBoot counterpart
AnnotationConfigApplicationContextSpringApplication.run
@PropertySource + Environmentapplication.yaml, profiles, @ConfigurationProperties
Manual DataSource / EntityManagerFactory beansJDBC / JPA auto-configuration + spring.datasource.*, spring.jpa.*
WebApplicationInitializer + WAREmbedded server + executable jar (or SpringBootServletInitializer)
Spring TestContext (@ContextConfiguration)@SpringBootTest, test slices, @ServiceConnection
Custom health/metrics endpointsActuator + Micrometer
Table 7 — Framework mechanisms and Boot equivalents

6Practical Examples

6.1 The same controller, two assemblies

JAVA
// Identical in both worlds — the Framework programming model
@RestController
class PingController {
    @GetMapping("/ping") String ping() { return "pong"; }
}
JAVA
// Plain Framework: you create and configure the web context yourself
public class WebInit extends AbstractAnnotationConfigDispatcherServletInitializer {
    protected Class<?>[] getRootConfigClasses() {
        return new Class<?>[] { RootConfig.class };
    }
    protected Class<?>[] getServletConfigClasses() {
        return new Class<?>[] { WebConfig.class };
    }
    protected String[] getServletMappings() { return new String[] { "/" }; }
}   // + @EnableWebMvc WebConfig, WAR packaging, external Tomcat
 
// Boot: one class, embedded server
@SpringBootApplication
public class PingApp {
    public static void main(String[] a) { SpringApplication.run(PingApp.class, a); }
}

6.2 A library with an optional Boot starter

TEXT
acme-audit                          (plain Java/Spring library, no Boot)
acme-audit-spring-boot-autoconfigure (auto-configuration + properties)
acme-audit-spring-boot-starter       (POM: library + autoconfigure)

6.3 WAR deployment in Boot 4

JAVA
@SpringBootApplication
public class LegacyApp extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder b) {
        return b.sources(LegacyApp.class);
    }
}

6.4 Boot and Framework generations

Spring BootSpring FrameworkJakarta EEMinimum JavaNotable shift
2.x5.xJava EE 8 (javax.*)8Executable jars, Actuator 2, reactive stack
3.x6.xJakarta EE 9/10 (jakarta.*)17Namespace change, AOT and native images, observability
4.x7.xJakarta EE 11 (Servlet 6.1)17Modular auto-configuration, Jackson 3, JSpecify null-safety, core resilience features
Table 8 — Coordinated generations of Boot and Framework

Each Boot generation fixes the Framework generation and the Jakarta EE baseline. Upgrading Boot therefore means upgrading the Framework and many third-party libraries together — which is exactly why Boot's managed versions are valuable.

6.5 Migration checklist from Boot 3 to Boot 4 (summary)

  • Upgrade to the latest 3.5.x first and remove deprecated API usage.
  • Replace renamed starters (-web → -webmvc, -aop → -aspectj, OAuth2 starters under -security-oauth2-*) and add starters for technologies that previously had none (Flyway, Liquibase).
  • Add the -test companion starters for tested technologies; replace @MockBean with @MockitoBean.
  • Migrate Jackson 2 customisations to Jackson 3 (JsonMapper, tools.jackson packages).
  • Use spring-boot-starter-classic temporarily if the modular split blocks progress; remove it afterwards.
  • Run with spring-boot-properties-migrator to detect renamed properties.

7Common Problems & Mistakes

  • Saying "Spring Boot transactions" or "Boot DI". They are Framework features; misattribution hides where behaviour is defined.
  • Mixing Boot with manual infrastructure that duplicates auto-configured beans.
  • Libraries depending on Boot starters. Forces versions and auto-configuration on consumers.
  • Choosing plain Framework for new services "for control" and rebuilding what Boot already provides.
  • Mismatched generations (Boot 4 with Framework 6 artefacts pinned manually).

These mistakes are easiest to spot through their symptoms. Duplicated infrastructure usually appears as two beans of the same type and a NoUniqueBeanDefinitionException at start-up or, worse, as a silent back-off where Boot's auto-configured DataSource or ObjectMapper disappears because a hand-written bean replaced it with fewer settings. The condition evaluation report, printed with --debug or exposed at /actuator/conditions, shows exactly which auto-configurations matched and which backed off. A copied @EnableWebMvc class is the classic case, switching off Boot's MVC customisations entirely. Generation mismatches show up as NoSuchMethodError or ClassNotFoundException on a code path that worked before an upgrade, typically after someone pinned a Framework or Jackson version manually; mvn dependency:tree or gradle dependencyInsight reveals the override. Rebuilding Boot by hand tends to be discovered late, when the first incident shows that the service has no health probes, no graceful shutdown and no consistent metrics. Treat every explicit version property and every infrastructure @Bean in a Boot application as something to justify in review.

8Performance & Production Considerations

AspectFramework onlyBoot
Start-upOnly what you configureAuto-configuration evaluation adds some work; usually small
FootprintMinimal if curated carefullyStarters may add unused libraries — trim them
OperationsCustom per applicationUniform health, metrics, logging, shutdown
UpgradesMany independent version decisionsOne coordinated Boot upgrade
Table 9 — Operational comparison

9Architecture & Design Considerations

  • Standardise on Boot for applications, on plain Spring (or plain Java) for libraries.
  • Know the generation pairs (Boot 4 ↔ Framework 7, Jakarta EE 11) and plan upgrades together.
  • Layer internal platforms on Boot's extension points rather than forking or wrapping it.
  • Train teams on the Framework first: Boot productivity without Framework understanding creates fragile systems.

10Interview Questions & Answers

Q1L1 · BasicConcept

What is the difference between Spring Framework and Spring Boot?

The Spring Framework is the programming model and container: dependency injection, AOP, transactions, data access, Spring MVC and WebFlux, events and the rest. Spring Boot is a separate project built on top of it that decides how an application is assembled and run. It chooses compatible dependency versions through starters and a managed BOM, creates infrastructure beans through conditional auto-configuration, embeds the server so the application runs as an executable jar, externalises configuration with profiles and @ConfigurationProperties, and adds production features through Actuator and Micrometer. Your controllers, @Transactional services and repositories are Framework code in both cases. In short, the Framework defines how components work; Boot defines how the application is put together.

Q2L1 · BasicConcept

Can you use Spring without Spring Boot?

Yes. Boot depends on the Framework, but the Framework has no dependency on Boot, and it was used for a decade before Boot existed. Without Boot you create the ApplicationContext yourself, for example with AnnotationConfigApplicationContext, declare infrastructure beans such as the DataSource, transaction manager and DispatcherServlet explicitly, choose and align library versions, typically through spring-framework-bom, and package a WAR for an external server or embed a server yourself. This is the right model for reusable libraries, for applications that live inside an existing application server, and for specialised runtimes. For new deployable services, though, it mostly means rebuilding by hand what Boot already provides, tests and maintains for you.

Q3L2 · IntermediateTricky

Does Boot change how @Transactional or dependency injection works?

No. Dependency injection, bean lifecycle, AOP proxies and transaction semantics are all implemented in the Framework, and they behave identically with or without Boot. What Boot changes is which infrastructure exists and how it is configured. For transactions, auto-configuration creates a JpaTransactionManager or DataSourceTransactionManager and enables transaction management, but propagation, rollback rules and the self-invocation limitation are unchanged. Boot does set a few defaults that look like behaviour changes, such as proxyTargetClass set to true so beans are proxied with CGLIB rather than JDK interface proxies, which affects whether injection by concrete class works. So when @Transactional misbehaves, read the Framework rules first and check Boot only for the configured manager.

Q4L2 · IntermediateTrade-off

When would you not use Spring Boot?

I would not use Boot for reusable libraries, because depending on starters forces Boot's versions and auto-configuration on every consumer; the library should depend on plain Spring, or nothing, and offer an optional starter. The second case is an application deployed into an existing application server that already provides the server, connection pools and operations tooling, where Boot's runtime adds little, although Boot can still be packaged as a WAR during a migration. The third is a specialised runtime or embedded use that needs full control over how the context is assembled. Even then, importing spring-boot-dependencies for version alignment is often worthwhile. For ordinary services, APIs, workers and batch jobs, Boot should be the default.

Q5L3 · Senior EngineerDesign

How do you provide Boot integration for a library without forcing Boot on its users?

Split the library into three artifacts, the same pattern Spring's own projects follow. The core library, for example acme-audit, depends only on plain Java or the Spring Framework and contains no Boot classes. An acme-audit-spring-boot-autoconfigure module holds auto-configuration classes registered in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports, guarded with @ConditionalOnClass and @ConditionalOnMissingBean so users can override any bean, plus a @ConfigurationProperties class with metadata for IDE hints. Finally, acme-audit-spring-boot-starter is a POM that combines the two. Boot users add the starter and get sensible defaults; other users add the core library and wire it themselves, with no Boot JARs on their classpath at all.

Q6L3 · Senior EngineerCode

How do you use Boot's dependency management without its runtime?

Import Boot's BOM, spring-boot-dependencies, without using SpringApplication or any starter. In Maven you add it under dependencyManagement with type pom and scope import, rather than inheriting spring-boot-starter-parent, so you get managed versions without Boot's plugin configuration. In Gradle you declare it as a platform dependency with the Boot version you target. You then declare spring-context, spring-jdbc, Jackson, Hibernate and other libraries without versions, and they resolve to the combination Boot has tested together. Nothing from Boot runs at runtime, because no Boot JAR is on the classpath. This suits libraries and non-Boot applications that want the same versions as the organisation's Boot services, and it eases a later migration.

Q7L4 · Technical ArchitectConcept

Why is Framework knowledge essential for Boot developers?

Because Boot only configures Framework mechanisms; it does not replace them. When a transaction does not roll back, a bean is injected as null, an aspect is not applied or a controller method is never reached, the cause lies in proxying, bean lifecycle, transaction propagation or MVC dispatch, which are all Framework topics. Boot's condition report can tell you which beans were created, but not why a self-invoked @Transactional method runs without a transaction. Developers who learned only Boot tend to fix such problems by adding annotations until something works, which produces fragile systems. Teams that understand the Framework can read auto-configuration source, override it precisely and debug production incidents from first principles.

Q8L5 · Solution ArchitectDesign

How would you define an organisation's policy on Boot versus plain Spring?

I would write it as a short standard with clear defaults and governed exceptions. Every deployable application uses Spring Boot on an approved release line, inherits a platform BOM and uses approved starters, including an internal starter for logging, observability and security conventions. Shared libraries depend on plain Spring or plain Java and ship optional Boot starters, never starters as hard dependencies. Legacy application-server deployments and specialised runtimes may use the Framework without Boot, but only through an architecture decision record with an owner and a review date. The policy also sets the upgrade cadence, for example adopting each new Boot minor release within six months, and is checked automatically in CI.

Test your knowledge on this topic →Flashcards from this topic's 8 questions, filtered by level and type.

Free question pack

Get 100 free Core Java interview questions

Subscribe for the Book 1 question pack (PDF, every answer explained) and new tutorials once a week. No spam, unsubscribe anytime. What is in the pack?

Almost done! Check your inbox and click the confirmation link. Your download link arrives as soon as you confirm.