KatInterview

Spring Framework vs Spring Boot: What Boot Actually Adds

System DesignModel answer
MediumModel answerSystem Designjavaspringspring-boot

Last updated

Explain how Spring Boot relates to the core Spring Framework, covering configuration, auto-configuration, servers, dependencies, startup and when to pick each.

A teammate new to the Java ecosystem asks: "If we already use Spring, why do people keep saying we should use Spring Boot? Aren't they the same thing?"

Give a structured comparison of the Spring Framework and Spring Boot. Your answer should cover:

  1. Relationship: how the two relate to each other.
  2. Configuration style: what you write by hand in each, with a short example.
  3. Auto-configuration: the mechanism behind it and how you control or override it.
  4. Server model: external application server versus embedded server.
  5. Opinionated defaults and dependency management.
  6. Startup flow: what happens from process start to a running application in each model.
  7. Use cases: when you would still choose plain Spring, and when Boot is the better fit.

Be concrete: name annotations, files and build artifacts, and call out common misconceptions.

Hints

Hint 1

Start with the relationship: one of the two is built on top of the other, so decide whether this is a 'versus' at all.

Hint 2

For auto-configuration, think about three things: where the candidate classes are registered, which conditions guard them, and what happens when you define your own bean.

Hint 3

For startup, compare who is in charge of whom: in one model a server launches your app, in the other your `main` method launches the server.