Chapter 1.1☕ 15 min read

What is Spring Boot?

Spring Boot is not a new framework — it's a smarter Spring.

01The Concept: Frameworks and Auto-Configuration

The Hyderabad Tiffin Center Analogy:

Imagine you want to start a Tiffin center in Hyderabad to serve meals.

If you use plain Java (Servlets and JSP), it is like building the Tiffin center from scratch. You have to mix the cement, lay the bricks, install the gas stove, buy the plates, and hire the servers. You have total control, but it takes months before you can serve a single plate of Idli.

If you use the Spring Framework (the older, traditional version), it is like renting a fully-built commercial kitchen. The stoves and sinks are there, but you still have to manually connect the gas line, set up the exhaust fan, arrange the tables, and decide where the Sambar goes. It is powerful, but the setup (XML configuration) is exhausting.

Spring Boot is like buying a franchise from a top-tier Tiffin brand. You just say, "I want to open a branch," and they deliver a fully configured kitchen. The gas is already connected, the Sambar is pre-made, the servers know their jobs, and the moment you unlock the door, you are ready to serve.

Spring Boot looks at what you want to build (e.g., a web API) and automatically provides all the setup, configurations, and tools required to run it immediately. This is called Auto-Configuration.

02Why Spring Boot is the Industry Standard
  1. Embedded Server: In the old days, Java developers had to build their code, export a .war file, and deploy it to an external server like Tomcat. Spring Boot comes with Tomcat inside it. You just click "Run", and your server starts.
  2. Starters: Instead of hunting the internet for 15 different jar files (libraries) for JSON parsing, database connections, and web routing, Spring Boot gives you "Starters". You add one dependency (spring-boot-starter-web), and it pulls in everything you need.
  3. Production-Ready: It comes with built-in health checks and monitoring (Actuator) out of the box.
03Full Working Code: Your First Spring Boot App

To prove how easy this is, let's look at a complete, runnable Spring Boot 3.x application. This is a basic REST API that returns a welcome message.

The Maven Configuration (pom.xml)

Every Spring Boot project needs a pom.xml file if you are using Maven.


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0

org.springframework.boot
spring-boot-starter-parent
3.2.0


com.devinhyderabad
my-first-app
1.0.0
my-first-app

17



org.springframework.boot
spring-boot-starter-web





org.springframework.boot
spring-boot-maven-plugin



04The Java Code (Application.java)

The Java Code (Application.java)

Here is the actual Java code with the main method and a simple API endpoint.

package com.devinhyderabad;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

@RestController
class WelcomeController {
@GetMapping("/welcome")
public String welcome() {
return "Welcome to DevInHyderabad! Your Spring Boot app is running.";
}
}

If you run the main method, your app will start on port 8080. Open http://localhost:8080/welcome in your browser to see the message. No external servers, no XML configuration. Just Java.

05Why It Matters / Interview Note

Interview Question: "What is the difference between Spring and Spring Boot?"

Answer: Spring is a framework that provides comprehensive infrastructure support for Java applications, but it requires manual configuration (XML or Java). Spring Boot is an extension of the Spring framework that eliminates the boilerplate configuration. It uses "Auto-configuration" to intelligently guess what you need based on the dependencies in your pom.xml and sets it up automatically. Spring Boot also provides an embedded server (Tomcat), allowing you to run applications as standalone Java processes, whereas traditional Spring requires deploying a WAR file to an external server.

Enterprise Note: In real-world IT companies in HITEC City (Microsoft, Amazon, Deloitte), nobody starts a Java project from scratch. They always use Spring Boot because it saves hours of setup time and enforces standard architecture across all teams.

Key Takeaways

  • ✅ Spring Boot is an extension of Spring with auto-configuration
  • ✅ Embedded Tomcat means no external server setup needed
  • ✅ Starters bundle compatible dependencies into one package
  • ✅ Spring Boot 3 requires Java 17+ and uses Jakarta namespace