Why Spring exists, and the problem it solves
Spring is the framework most enterprise Java backends in India are built on, and Spring Boot is the version of it that gets a fresher hired. But Spring has a reputation — deserved — for magic: annotations that do things you cannot see, applications that wire themselves together by mechanisms that are not obvious. This course's promise is to remove the magic: to explain what Spring is actually doing, so that when something breaks you can reason about it rather than searching Stack Overflow for the annotation that makes the error go away. This first lesson is what Spring is, the problem it solves, and when it is — and is not — the right tool.
The problem Spring solves: wiring
Imagine building a backend without a framework. You have a web server, a database, business logic, and dozens of objects that depend on each other — a controller needs a service, the service needs a repository, the repository needs a database connection, everything needs configuration. Someone has to create all those objects, in the right order, and hand each one its dependencies. Done by hand, this "wiring" code grows into a tangle: every object knows how to build every object it needs, configuration is threaded through by hand, and changing one thing ripples everywhere.
Spring's core job is to do that wiring for you. You declare what each object needs; Spring creates the objects, works out the order, and hands each one its dependencies. That mechanism — the IoC container and dependency injection — is the heart of Spring, and the next two lessons are entirely about it. Everything else Spring does is built on top of solving this one problem well.
What Spring and Spring Boot are
Two names, often confused:
- Spring Framework — the core: the IoC container, dependency injection, and a huge ecosystem of modules (Spring MVC for web, Spring Data for persistence, Spring Security for auth, and many more) that all plug into that container.
- Spring Boot — a layer on top that makes Spring fast to start with. It provides auto-configuration (sensible defaults wired up automatically), starters (curated dependency bundles), and an embedded server (your app runs as a plain executable, no separate server to install). Spring Boot is how modern Spring is used — almost nobody starts a new project on the raw framework.
The mental model: Spring is the engine (the container and the ecosystem); Spring Boot is the car built around it so you can just drive. When people say "Spring" today they usually mean "Spring Boot", and this course does too — but you will understand the engine underneath, which is what the "no magic" promise requires.
What Spring is genuinely good for
Spring Boot is at its best building server-side applications, especially:
- REST APIs and backends — the overwhelming common case, and what this course builds (a courier and parcel-tracking API called Dakiya). Controllers, services, a database, security, all wired by the container.
- Enterprise applications — systems with real business logic, transactions, security and integrations, where the ecosystem (Spring Data, Spring Security, transaction management) saves enormous effort.
- Microservices — Spring Boot's fast-to-start, self-contained, executable model suits services you deploy independently.
If your job is "a Java backend that serves data over HTTP, talks to a database, and enforces business rules and security" — which is most Java backend work in India — Spring Boot is very likely the right and the expected choice.
When Spring is not the right tool
The honest limits, so you meet them deliberately, not by surprise:
- A tiny script or a one-off tool. Spring's machinery is weight you are not using; plain Java (or a script in another language) is simpler.
- A frontend, or a mobile app. Spring is server-side. The browser is JavaScript/TypeScript (see the Web UI and TypeScript courses); Android is Kotlin. Spring may serve the API those clients call, but it is not what runs on the client.
- When you need the absolute lightest footprint or fastest cold start — a small serverless function, say. Spring Boot has improved dramatically here (and GraalVM native images help), but a minimal framework can still start faster and smaller for a trivial function.
- When the team does not know Java. Spring is a Java (or Kotlin/JVM) framework; it is the wrong choice for a team whose language is Python or Node — use their ecosystem's frameworks (Django, NestJS).
None of these are Spring being bad. They are Spring being a server-side JVM application framework — excellent for that, unnecessary or ill-fitting elsewhere.
Why the "magic" reputation, and this course's answer
Spring feels magical because so much happens implicitly: you annotate a class and it becomes a web endpoint; you declare an interface and a working database repository appears; you add a dependency and half your configuration happens by itself. This is powerful — it is why Spring is so productive — but it means that when something goes wrong, a developer who only knows "add this annotation" is stuck, because they do not know what the annotation did. This course's approach throughout: every time Spring does something for you, we say what it did and how. Dependency injection is not magic, it is a container creating objects. Auto-configuration is not magic, it is conditional configuration classes reacting to what is on your classpath. Understanding the mechanism is what turns you from someone who uses Spring into someone who can debug it — which is the difference the course is written to make.
This course assumes Java. If you are not comfortable with Java — classes, interfaces, generics, exceptions, build tools — take the Java Complete Foundation course first. Learning Java and Spring at once is how people end up unable to tell which half of what they are typing is the language and which is the framework.
Check your work
The problem Spring solves. Object wiring — creating the objects an application needs and handing each its dependencies — via the IoC container and dependency injection; everything else builds on that.
Spring versus Spring Boot. Spring Framework is the core (container + ecosystem: MVC, Data, Security); Spring Boot adds auto-configuration, starters and an embedded server so it is fast to start with. "Spring" today means Spring Boot.
What Spring is good for. Server-side apps — REST APIs/backends (this course's focus), enterprise applications, and microservices — where the ecosystem saves real effort.
When not to use it. Tiny scripts, frontends/mobile (it is server-side), ultra-light serverless cold starts, and teams not on the JVM.
Why it seems magical, and the course's answer. So much is implicit (annotations, auto-config, generated repositories) that "add an annotation" users get stuck when it breaks; the course explains the mechanism each time, so you can debug, not just use.
Practice
- Write down three backend projects and decide, for each, whether Spring Boot is a good fit and the deciding factor.
- List the "magic" things you have seen or heard Spring do (endpoints from annotations, repositories from interfaces); note that each is a mechanism this course will explain.
- Distinguish Spring Framework from Spring Boot in your own words, and name one thing Boot adds.
- For the Dakiya courier API this course builds, argue in three sentences why Spring Boot suits it — and name one part of a courier product Spring would not build (a client app).
- Read Spring Boot's own overview and note one capability this lesson did not mention.
Official documentation
- Spring Boot — Overview — What Spring Boot is and provides.
- Spring Framework — Overview — The core framework and the IoC container.
- Spring — Guides — Short, official getting-started guides.
Next: dependency injection and inversion of control.
Stuck on this lesson?
Being stuck is part of it — but being stuck alone for three days is not. Our internship programme pairs this curriculum with code review and one-to-one help from working developers, and it is free.
About the internship