🔥 Launch Offer: Interview Preparation Bundle @ ₹2,499 ₹9,999 • 75% OFF. Offer expires in 🔥 Launch Offer: Interview Preparation Bundle @ ₹2,499 ₹9,999 • 75% OFF. Offer expires in Interview Preparation Bundle @ ₹2,499 ₹9,999

00:00:00 Get Bundle
home spring boot the-complete-evolution-of-java-backend-cgi-%e2%86%92-servlet-%e2%86%92-jsp-%e2%86%92-spring-%e2%86%92-spring-mvc-%e2%86%92-spring-boot-%e2%86%92-microservices
Interview guide Spring Boot 22 sections

The Complete Evolution of Java Backend: CGI → Servlet → JSP → Spring → Spring MVC → Spring Boot → Microservices

Most developers learn Spring Boot directly without understanding why each technology was created. Every evolution happened because the previous approach had limitations. Let's go through the complete evolution…

Start reading
By javainterviewprep June 9, 2026 5 min read

Most developers learn Spring Boot directly without understanding why each technology was created. Every evolution happened because the previous approach had limitations.

Let’s go through the complete evolution as a story.


Evolution of Java Web Development

1995
│
├── Core Java
│
├── CGI (Not Java)
│
├── Servlets
│
├── JSP
│
├── Servlet + JSP (MVC)
│
├── Struts
│
├── Spring Framework
│
├── Spring MVC
│
├── Spring Boot
│
├── Microservices
│
├── Spring Cloud
│
└── Cloud Native Applications

Notice something?

Spring Boot is NOT a replacement for Servlets.

It is built on top of the Servlet API.


Phase 1 — Before Servlets (CGI)

Around 1993–1996

Before Java web development, websites mostly used CGI (Common Gateway Interface).

Architecture

Browser
│
HTTP Request
│
Web Server
│
Creates NEW Process
│
Runs Program
│
Returns Response

Suppose 100 users open your website.

The server creates

100 Processes

Processes are expensive.

Problems

❌ Slow

❌ High memory

❌ Poor scalability

People needed something better.


Phase 2 — Servlets (1997)

Java introduced Servlets.

Instead of creating a new process for every request,

the server creates

One Servlet

Many Threads

Architecture

Browser

↓

Tomcat

↓

Servlet

↓

Business Logic

↓

Database

Example

@WebServlet("/hello")
public class HelloServlet extends HttpServlet {

protected void doGet(HttpServletRequest req,
HttpServletResponse res) {

res.getWriter().println("Hello");
}
}

Communication

Browser

↓

Tomcat

↓

Servlet

↓

Database

Huge improvement.

Instead of

100 Processes

we now have

1 Process

100 Threads

Much faster.


Problems with Servlets

Imagine building Amazon.

You would need

@WebServlet("/login")
LoginServlet

@WebServlet("/products")
ProductServlet

@WebServlet("/orders")
OrderServlet

@WebServlet("/payment")
PaymentServlet

@WebServlet("/wishlist")
WishlistServlet

Thousands of servlets.

Every servlet contains

Business Logic

Database Code

HTML

Everything together.

This became known as

Spaghetti Code


Phase 3 — JSP

To separate Java code from HTML,

Java introduced JSP (JavaServer Pages).

Before

out.println("<html>");

out.println("<body>");

out.println("Hello");

out.println("</body>");

Very ugly.

Instead

<html>

<body>

Hello

</body>

</html>

Cleaner.

Architecture

Browser

↓

Tomcat

↓

Servlet

↓

JSP

↓

Browser

Problem?

Business logic was still mixed with UI.


Phase 4 — MVC Pattern

Developers realized

Different people should write different things.

UI Developer

↓

Business Developer

↓

Database Developer

So MVC was born.

Model

View

Controller

Architecture

Browser

↓

Controller

↓

Model

↓

Database

↓

View (JSP)

↓

Browser

Much cleaner.


Phase 5 — Struts

Around 2001

Apache introduced Struts.

Now you no longer had to manually write lots of servlet code.

Instead of

Servlet

↓

Database

You had

Action

↓

Business Layer

↓

JSP

Framework handled routing.

But configuration was mostly XML-based and verbose.


Phase 6 — Spring Framework (2003)

This changed everything.

Rod Johnson asked:

“Why is enterprise Java so complicated?”

Spring introduced:

  • Dependency Injection (DI)
  • Inversion of Control (IoC)
  • Easier testing
  • POJO-based programming
  • Transaction management
  • Integration modules

Before Spring

OrderService service = new OrderService();

After Spring

@Autowired
OrderService service;

The container manages object creation and wiring.

Communication

Controller

↓

Service

↓

Repository

Instead of everything in one servlet.

Huge improvement.


Phase 7 — Spring MVC

Spring still needed a better web framework.

So Spring MVC was introduced.

Instead of writing

public class UserServlet
extends HttpServlet

You simply write

@RestController

public class UserController {

@GetMapping("/users")
public List<User> users(){

}

}

Spring automatically creates the servlet infrastructure behind the scenes.

Communication

Browser

↓

Tomcat

↓

DispatcherServlet

↓

HandlerMapping

↓

Controller

↓

Service

↓

Repository

↓

Database

Notice

There is still a Servlet.

DispatcherServlet is itself a servlet.

This is a common interview question.


Phase 8 — Spring Boot (2014)

Spring Framework had become powerful but configuration-heavy.

Developers often had to write:

  • XML files
  • Bean definitions
  • Servlet registrations
  • Build server setup
  • Database setup
  • Logging setup
  • View resolver setup

Spring Boot simplified this.

Example

Without Boot

Hundreds of configuration lines.

With Boot

@SpringBootApplication

public class App {

public static void main(String[] args){

SpringApplication.run(App.class,args);

}

}

Communication remains

Browser

↓

Embedded Tomcat

↓

DispatcherServlet

↓

Controller

↓

Service

↓

Repository

↓

Database

Notice

Spring Boot did not change the request flow.

It only automated the configuration and setup.


Phase 9 — Microservices

Applications became too large to manage as a single deployment.

Instead of one huge application:

Amazon

↓

One Giant Project

We split into independent services.

User Service

Product Service

Order Service

Payment Service

Inventory Service

Each service has:

  • Its own database (ideally)
  • Its own deployment
  • Independent scaling

Communication between services happens using:

REST APIs (HTTP)

or

Kafka

or

RabbitMQ

or

gRPC

A typical flow:

Client
│
▼
API Gateway
│
▼
Order Service
│
├──────────────► Inventory Service
│
├──────────────► Payment Service
│
└──────────────► Notification Service

Phase 10 — Cloud Native

Today, Spring Boot applications are commonly deployed as containers.

Developer

↓

Git

↓

GitHub

↓

CI/CD Pipeline

↓

Docker Image

↓

Kubernetes

↓

Cloud (AWS/Azure/GCP)

Communication is no longer just between applications, but also with cloud infrastructure, service discovery, distributed tracing, centralized logging, and observability tools.


Communication Flow Comparison

1. CGI

Browser

↓

Web Server

↓

NEW Process

↓

Program

↓

Response

2. Servlet

Browser

↓

Tomcat

↓

Servlet

↓

Database

↓

Response

3. Servlet + JSP

Browser

↓

Servlet

↓

Business Logic

↓

JSP

↓

Browser

4. Spring MVC

Browser

↓

Tomcat

↓

DispatcherServlet

↓

HandlerMapping

↓

Controller

↓

Service

↓

Repository

↓

Database

5. Spring Boot

Browser

↓

Embedded Tomcat

↓

DispatcherServlet

↓

Controller

↓

Service

↓

Repository

↓

Database

6. Spring Boot Microservices

Client

↓

API Gateway

↓

Order Service

↓

Inventory Service

↓

Payment Service

↓

Kafka/Event Bus (optional)

↓

Database

The Most Important Thing to Remember

Many developers think each new technology replaced the previous one. That’s not how the Java ecosystem evolved.

Instead, each layer builds upon the previous one:

Spring Boot
│
▼
Spring MVC
│
▼
Spring Framework
│
▼
Servlet API
│
▼
Java

So when someone sends a request to a Spring Boot application today, the request is still ultimately handled by the Servlet API. An embedded servlet container (like Tomcat) receives the HTTP request, passes it to DispatcherServlet (which extends HttpServlet), and Spring MVC takes over from there.


Interview Insight

If an interviewer asks:

“Does Spring Boot replace Servlets?”

A strong answer is:

No. Spring Boot does not replace Servlets. It is built on top of the Servlet API for traditional web applications. In a Spring Boot MVC application, the embedded servlet container (such as Tomcat) receives the request, and the DispatcherServlet—which is itself a servlet—acts as the front controller. Spring Boot mainly reduces configuration through auto-configuration, starter dependencies, and embedded servers, while still relying on the Servlet infrastructure underneath.