Grokking Spring Boot
Vote

0% completed

​

Welcome to Grokking Spring Boot

Who This Course Is For

What the Course Covers

The Booking Service

How the Code Runs

How the Lessons Work

Key Takeaways

Practice Questions

This course teaches you to build a backend service with Spring Boot, and to explain how each part of Spring makes that service work.

Both halves matter. Spring Boot lets a developer start a working web service in a few minutes. It does so by making many decisions on the developer's behalf. The same decisions cause many of the confusing problems later: a bean that was never created, a transaction that did not roll back, a setting that seems to be ignored. A developer who knows only the annotations can follow a tutorial. A developer who knows the mechanism behind them can find the cause of a problem and choose a fix with confidence.

This introduction explains who the course is for, what it assumes you know, the service it builds, how its code runs, and how its lessons are arranged.

Who This Course Is For

The course is written for Java developers who are starting with Spring Boot, and for developers who already use it but want to understand what it does for them. It suits a backend engineer joining a Spring team and a developer moving from another framework. It also suits anyone who has copied a configuration without knowing why it works.

You need basic Java: classes, interfaces, collections, and exceptions. You do not need earlier Spring experience. The course reviews the modern Java features that Spring code uses, such as lambdas, streams, records, and annotations, before it relies on them. Every Spring term is defined where it first appears.

What the Course Covers

The lessons follow the order in which a service grows:

  1. Getting started: what Spring Boot is, what a project contains, and how the application runs and is packaged.
  2. Modern Java for Spring: lambdas, streams, Optional, records and enums, annotations and reflection, and the build tools Maven and Gradle.
  3. The container: inversion of control, how beans are created and connected, their scopes and lifecycle, and how Spring changes a bean after creating it.
  4. How Spring Boot works: starters, auto-configuration, the embedded server, configuration, and the startup sequence.
  5. Building REST APIs: controllers, data transfer objects, validation, error handling, pagination, versioning, and API documentation.
  6. Data and transactions: connection pools, plain SQL, JPA and Spring Data, loading strategies and the N+1 problem, schema migrations, transactions, and locking.
  7. Proxies and AOP: the mechanism behind transactions, caching, asynchronous methods, and retries.
  8. Security: the filter chain, passwords, tokens, sign-in with OAuth2, method security, CORS, and CSRF.
  9. Testing: unit tests, slice tests, full application tests, and tests of security and the HTTP layer.
  10. Performance and resilience: caching, asynchronous work, virtual threads, pool sizing, calls to other services, retries, and timeouts.
  11. Events, messaging, and production: application events, Kafka, the transactional outbox, health checks, metrics, container images, and graceful shutdown.
  12. A capstone: one booking request through every layer, then design reviews of transactions, failures, data access, security, and scaling.
The course builds one booking service, from a single endpoint to a service ready for production.
The course builds one booking service, from a single endpoint to a service ready for production.

Notice that the container and the workings of Spring Boot, steps 3 and 4, come before the API, data, and security features that depend on them. Step 7 then explains proxies, the mechanism behind the transaction and caching annotations, so a transaction that did not roll back has a clear cause.

The Booking Service

Every lesson uses one example: the booking service of an event ticketing app. Venues hold events, events have seats, and customers book seats. One evening concert at Riverside Hall, with 20 rows of 30 seats, supplies most of the numbers.

The service has four business rules. A seat is booked at most once per event. A booking exists only after payment succeeds. A customer may cancel before the event starts. Only venue staff create and change events. Much of the course is about protecting these rules. The first one leads to transactions and locking, the second to failure handling, and the last to security.

The app and its numbers are fictional. They stay consistent from lesson to lesson, so a class or a setting introduced in one lesson keeps the same name in the next.

How the Code Runs

Many lessons include a Java program that you can run here, in the course player, with the Run button. These programs use only the Java standard library, so they need no installation. Several of them build a small version of a Spring mechanism in plain Java. Examples are a container that reads constructors, a proxy that wraps a method in a transaction, and a condition evaluator. You see the mechanism work before you use the real one.

The Spring code in the lessons is shown read-only, because a Spring application needs a build tool and a running server. Every Spring listing, setting, log line, and error message in this course comes from a real run of Spring Boot 4 on Java 21. When a behavior could not be run, such as a feature that needs Docker or a PostgreSQL server, the lesson says so plainly.

Programs that run in the player, and Spring code that was run on a real project.
Programs that run in the player, and Spring code that was run on a real project.

Notice that the two kinds of code work together. The plain-Java program shows how a mechanism works, and the Spring listing shows the same mechanism in a real service.

How the Lessons Work

Each lesson teaches one idea through the booking service. Diagrams are animated to show the order in which things happen, and each one is also complete as a still picture. A lesson ends with its key takeaways, a link to the next lesson, and four practice questions whose answers stay hidden until you open them.

Key Takeaways

  • The course teaches how to build a service with Spring Boot and how to explain the mechanism behind each feature.
  • It assumes basic Java and reviews the modern Java features that Spring code uses.
  • One booking service and its four business rules run through every lesson.
  • Runnable programs build small versions of Spring mechanisms in plain Java.
  • Every Spring listing and log line comes from a real run of Spring Boot 4 on Java 21.

The first question is what Spring Boot actually takes over from your code. What Spring Boot Is starts from a plain Java service and answers it.

Practice Questions

1. Do you need to know Spring before you start this course?

<details><summary>Show answer</summary>

No. The course assumes basic Java only. It defines every Spring term where it first appears, and it reviews lambdas, streams, records, and annotations before it relies on them.

</details>

2. Why does the course build small versions of Spring mechanisms in plain Java?

<details><summary>Show answer</summary>

Because a mechanism you have built is one you can reason about. Once you have seen a small container read constructors, or a proxy wrap a method in a transaction, the behavior of the real Spring feature has a clear cause, including when it fails.

</details>

3. Why can the plain-Java programs run in the player while the Spring code cannot?

<details><summary>Show answer</summary>

Because the plain-Java programs need only the Java standard library, while a Spring application needs its libraries, a build tool, and a running server. The Spring code was run on a real project instead, and the lessons show the output of those runs.

</details>

4. Which business rule of the booking service leads the course to transactions and locking?

<details><summary>Show answer</summary>

The rule that a seat is booked at most once per event. Two requests for the same seat can overlap, and protecting the rule under concurrent requests needs transactions and locks.

</details>

Reading Progress

0%


Vote for new content

On This Page

Who This Course Is For

What the Course Covers

The Booking Service

How the Code Runs

How the Lessons Work

Key Takeaways

Practice Questions