This repository contains the source code of the practical use case described in the book Learn Microservices with Spring Boot 3 (3rd Edition) . The book follows a pragmatic approach to building a Microservice Architecture. You start with a small monolith and examine the pros and cons that come with a move to microservices.
In Chapter 3, the goal is to build a Spring Boot application according to good practices:
- Domain-Driven Design. We analyze the boundaries of the Users and Challenges domains.
- 3-layer Application Design. This chapter focuses on two of the layers: Controller, and Service.
- Test-Driven Development. You write tests before building the functionalities.
- Monolith First. We keep two domains separate by using different root packages.
The next figure shows the status of the Multiplication application by the end of the Chapter, as it's also included in this repository.
There are two functional domains included in this first application: Users, and Challenges. See the figure below.
Note: You need to use JDK version 17 to run this project.
To start the Spring Boot application, you can use the command line with the included Maven wrapper:
$ ./mvnw spring-boot:run
- Do you have questions about how to make this application work?
- Did you get the book and have questions about any concept explained within this chapter?
- Have you found issues using updated dependencies? Don't hesitate to create an issue in this repository and post your question/problem there.
Are you interested in building a microservice architecture from scratch? You'll face all the challenges of designing and implementing a distributed system one by one, and will be able to evaluate if it's the best choice for your project.
You can buy the book online from these stores:
- Chapter 3. A professional 3-tier 3-layer Spring Boot app (this repo).
- Chapter 4. Building a basic frontend in React (backender-friendly)
- Chapter 5. The Data Layer Concepts and Spring Data JPA
- Chapter 6. Starting with Microservices - Synchronous
- Chapter 7. Event-Driven Architectures - Making our system asynchronous
- Chapter 8 (I). The Gateway Pattern in Microservice Architectures (Spring Cloud Gateway)
- Chapter 8 (II). Service Discovery and Load Balancing for Spring Boot Microservices (Consul / Spring Cloud Load Balancer)
- Chapter 8 (III). Centralized Configuration with Consul KV
- Chapter 8 (IV). Centralized Logs, Distributed Tracing, and Containerization with Docker (Buildpacks) and Docker Compose
Extra chapters: