The story of Java backend.
Every annotation you'll meet, every layer you'll write, every odd pattern Spring Boot hides — all of it is the answer to a problem from somewhere in this 50-year story. By the end of today, you'll see through the magic.
Why we start with history
Most courses throw you into Spring Boot on day one. You learn an annotation, you copy a snippet, it works. Magic. Until something breaks. Then you have no idea why.
The reason most learners feel lost in Spring Boot is they meet the solution before they ever met the problem. Without the problem, the solution feels arbitrary.
So today we walk through the problems first — in order. Each problem produces a solution. Each solution creates new problems. That is the entire history of Java backend in one sentence.
1970sPrograms lived on one machine
Picture a developer in 1975. There is no internet. No browsers. No "websites." A program ran on a single mainframe — a refrigerator-sized computer. Users connected through dumb terminals (just keyboards and screens with no brain of their own).
The dominant language was C. Every database came with its own C library. There was no concept of "the network." Everything was on one machine.
Modern backend complexity exists almost entirely because we left this world. Microservices, REST APIs, JDBC, Spring — none of these would exist if programs still lived on one machine.
1980sC++ and the rise of OOP
C++ arrived. It added classes, inheritance, polymorphism — what we call Object-Oriented Programming. OOP was a way to organize bigger codebases without losing your mind.
C++ became the language of operating systems, compilers, and games — anything needing both performance and structure. But programs still lived on one machine. C++ was not used for "web development" because the web didn't exist yet for normal people.
OOP was invented to manage complexity within one program — not to build distributed systems. The patterns you'll meet later (Service, DAO, DTO) are OOP refinements applied to the web era.
1991–93The internet becomes public
Three things happened almost together: Tim Berners-Lee invents the World Wide Web at CERN (1989–91), the Mosaic browser launches (1993), and Internet Explorer + Netscape turn the web into a household thing by the mid-90s.
Suddenly, machines need to talk to each other over a network. This is a totally new problem that no language at the time was designed to solve cleanly.
How early websites worked
A browser asks for a page. A web server returns an HTML file (just text on disk). That's it. Static. Every visitor saw the same page. But people quickly wanted dynamic pages: "show me today's news", "log me in". How?
CGI scripts — the first "backend"
The first solution was called CGI (Common Gateway Interface). When a browser request came in, the web server would:
- Spawn a fresh process (start a new program from scratch)
- Run a script (usually Perl, sometimes C)
- Capture whatever the script printed
- Send that output back to the browser
This worked. It was the first time the web had dynamic pages. But it was painfully slow. Spawning an OS process per request is expensive. If 1000 users hit the site at once, the server collapsed.
The single performance problem of "one new process per request" is the reason every later technology — Servlets, Spring, Spring Boot — emphasizes long-lived, in-memory components. Hold onto this. It's the seed of everything that follows.
1995Java is born
Sun Microsystems releases Java with a marketing slogan: "Write Once, Run Anywhere." Compile your code once → it runs on Windows, Mac, Linux — without changes.
How? Java doesn't compile to machine code (the way C/C++ does). It compiles to bytecode — an intermediate language. Any computer with the JVM (Java Virtual Machine) installed can run that bytecode. The JVM translates it into the right instructions for whatever OS it's on.
Java came in three flavors:
| Edition | What it covered |
|---|---|
J2SE — Standard | The core language: OOP, collections, threads |
J2ME — Micro | Phones, embedded devices |
J2EE — Enterprise | Server-side web apps: Servlets, JSP, JDBC |
These terms are not real categories. They're informal labels invented by trainers and the Indian job market. "Core Java" loosely means J2SE; "Advanced Java" loosely means J2EE. Real engineers don't use these terms — but you'll see them in job ads, so just know what they mean.
But here is a critical fact most learners miss: Java alone could not handle HTTP. Java had no built-in way to receive an HTTP request, parse it, and return an HTTP response. The language was great, but it was deaf and dumb to the web. Something had to bridge Java and HTTP.
Applets — Java's failed first try
Sun's first idea was to put Java inside the browser. Tiny Java programs called Applets ran via a JVM plugin. It failed: slow, security concerns, browsers killed plugins. Philosophically — business logic should run on a server you control. Sun pivoted: Java would run on the server. This pivot gave us Servlets.
~1997Servlets — Java's first real backend
A Servlet is a Java class that handles an HTTP request. But a Servlet alone does nothing — it needs a runtime called a Servlet Container. The most famous one is Apache Tomcat.
CGI vs Servlets — the key shift
❌ CGI
- 1 request = 1 new OS process
- Heavy: process startup is slow
- No memory between requests
- Collapses under load
- Languages: Perl, C
✅ Servlets
- 1 Servlet object handles many requests
- Threads, not processes
- Stays loaded in memory
- Scales to thousands of users
- Language: Java
Holding a Servlet in memory and using threads is the same insight powering every modern web framework you'll touch. Spring Boot's controllers? Same model — long-lived objects, thread-pool serving requests. The pattern hasn't changed in 25 years.
What the Servlet container does NOT do
You asked the perfect question: where does JSON → object conversion happen? In Spring Boot, @RequestBody magically converts JSON to a DTO. In Servlets — that magic doesn't exist. You write it yourself.
✅ The container DOES handle
- Listening on the port
- Parsing HTTP method, URL, headers
- Wrapping the request in
HttpServletRequest - Routing to the right Servlet by URL
- Managing threads
- Form-encoded body →
req.getParameter()
❌ The container does NOT handle
- JSON body → your DTO class
- Validation of fields
- Object → JSON for the response
- Mapping URL path variables to method args
- Layered architecture wiring
- Database connection management
// Read the raw body bytes
String body = req.getReader().lines().collect(Collectors.joining());
// Manually call Jackson
ObjectMapper mapper = new ObjectMapper();
UserDto user = mapper.readValue(body, UserDto.class);
// Manually validate
if (user.getEmail() == null) { /* return 400 */ }
// ... then call your service ...Spring Boot's @RequestBody is doing exactly this code, hidden behind an annotation. The "magic" of Spring is just well-organized boilerplate that someone else wrote once. You'll see this pattern over and over.
The Servlet pain — and the layers we still use today
Imagine a registration form with 10 fields. In a raw Servlet, you'd extract each parameter, validate each, open a database connection, write SQL, close it, print HTML — all in one method. Horrible.
Developers in the early 2000s split this into layers:
Controller, Service, DAO, DTO were invented in the Servlet era, not in Spring. Spring did not invent layered architecture. It just made wiring the layers more convenient. Most learners think these layers are "Spring stuff." They are not. They are Java enterprise patterns that predate Spring by ~5 years.
JSP — escaping "HTML inside Java"
Writing HTML inside Java with out.println() was awful. Sun invented JSP (Java Server Pages): HTML files with embedded Java snippets. The Servlet container compiled JSP files into Servlets behind the scenes. JSP is mostly dead today — replaced by REST APIs returning JSON, with React/Vue/Angular handling HTML on the client. We won't write any JSP. You only need to know it existed.
2003Spring is born
By the early 2000s, Java enterprise apps had become a mess: heavy EJBs (Enterprise Java Beans) needing expensive application servers, hundreds of XML files, and tightly-coupled code (every class created its own dependencies with new, making testing nearly impossible).
A developer named Rod Johnson wrote a book in 2002 showing a lighter way. The ideas became the Spring Framework.
Spring's two killer ideas
Before Spring · tight coupling
class A {
B b = new B();
// A controls how B is built
// can't swap B for a fake
// in tests
}With Spring · IoC + DI
class A {
B b;
A(B b) { this.b = b; }
// B is given to A
// can swap easily
// can test in isolation
}You said this part felt confusing — that's totally fine. Week 3 (Days 15–21) is fully dedicated to IoC, DI, beans, and AOP. For Day 1, all you need is the one-line idea:
"Someone other than me is creating my objects and handing them to me."
That's it. The deep mental model comes later, when you have more context to attach it to.
2014Spring Boot
Spring Boot solved Spring's setup pain with two ideas:
Idea 1 · Convention over configuration
Sensible defaults everywhere. You only override what's truly different about your app.
Idea 2 · Embedded server
In the old world, you wrote a .war file then deployed it into a separately-installed Tomcat. Spring Boot ships Tomcat inside your JAR:
$ java -jar myapp.jar…and your web app is running. No external Tomcat. No web.xml. This is the world we live in today.
todayThe modern Java backend stack
| Layer | Modern choice | What it solves |
|---|---|---|
| Framework | Spring Boot | Wires everything, embedded server |
| Persistence | Spring Data JPA (on Hibernate) | Talk to DB without SQL boilerplate |
| API style | REST + JSON | Clean, stateless, language-agnostic |
| Frontend | React / Vue / Angular | Browser handles HTML; Java only returns data |
| Deployment | Docker | Consistent runtime, easy to ship |
| Architecture | Microservices + events | Independent teams, independent deploys |
The full story in one frame
What this means going forward
| When you see… | You'll know… |
|---|---|
@RestController | Tomcat receives an HTTP request, maps the URL to your method. Same Servlet model under the hood. |
@Autowired | Spring is doing IoC — handing you a dependency you didn't construct yourself. |
@Transactional | Spring wraps your method with a database transaction. Uses AOP — covered in Week 3. |
@Service / @Repository | Annotations on the same layered architecture from the Servlet era. |
@RequestBody | Spring's HttpMessageConverter doing what you'd write by hand — JSON → DTO via Jackson. |
java -jar app.jar | Embedded Tomcat. The server lives inside your JAR. |
Lock in today's learning
Take 10 minutes. Answer in your own words. If you can't, re-read the relevant section. Don't skip this.
- Why did CGI fail at scale? (Hint: process spawning)
- Why did Servlets succeed where CGI failed? (Hint: persistence + threading)
- Java alone cannot do HTTP. What bridges Java to HTTP?
- Were Controller, Service, DAO, DTO invented by Spring? If not, when?
- What problem does IoC solve that Servlet code had?
- What two problems did Spring Boot solve that plain Spring still had?
End of Day 1. Close the document. Let it sit overnight. The mental skeleton you just built will pay back every day for the next 8 weeks.