Microservices with Spring Boot and Docker
Build a 3-service e-commerce platform with Spring Boot, Resilience4j, Docker, and Docker Compose. Learn microservices architecture, circuit breakers, containerization, and multi-service orchestration.
View badge details
About This Course
Course Curriculum
14 Lessons
Microservices Architecture Principles
Learn the foundational principles of microservices architecture — monolith vs microservices tradeoffs, bounded contexts, the ShopNest decomposition strategy, synchronous vs asynchronous inter-service communication, CAP theorem basics, and when NOT to adopt microservices.
Service Decomposition - Lab Exercises
Build the ShopNest Product Service from a skeleton — add the Product JPA entity, ProductRepository, full CRUD REST endpoints, seed the H2 database, and verify the service returns data.
Inter-Service Communication with REST
Learn synchronous REST communication between microservices — RestTemplate vs WebClient, the DTO pattern to avoid domain coupling, HTTP error propagation between services, and the Order→Product call chain.
REST Communication - Lab Exercises
Build the ShopNest Order Service — Order entity, ProductDto, RestTemplate bean, OrderCreationService with HTTP error handling, and a POST /api/orders endpoint that calls Product Service to validate stock before creating orders.
Service Discovery and Configuration
Why hardcoded URLs break in production, externalizing application.properties, @Value vs @ConfigurationProperties, environment variable injection, and Spring Cloud Config basics.
Service Discovery - Lab Exercises
Extract all service URLs and timeouts into application.properties, bind them with @ConfigurationProperties, and verify both services still communicate correctly.
Resilience — Circuit Breakers and Retries
Why distributed systems fail, Resilience4j circuit breaker states (CLOSED/OPEN/HALF_OPEN), @CircuitBreaker and @Retry annotations, fallback methods, and bulkhead patterns.
Resilience - Lab Exercises
Add Resilience4j to Order Service — @CircuitBreaker and @Retry on the Product Service call, fallback method, YAML configuration of thresholds, and observing circuit state transitions.
Containerizing Spring Boot with Docker
Why containers solve the "works on my machine" problem, Docker image layers, multi-stage Maven builds, EXPOSE vs port binding, environment variable injection, and .dockerignore.
Docker - Lab Exercises
Write Dockerfiles for all three ShopNest services using multi-stage Maven builds, create .dockerignore files, build images, and verify each service runs as a standalone container.
Multi-Service Orchestration with Docker Compose
Docker Compose YAML structure, service naming and DNS resolution, depends_on with health checks, named volumes for MySQL persistence, environment variable substitution, and docker-compose.override.yml.
Docker Compose - Lab Exercises
Write docker-compose.yml wiring all three ShopNest services, implement NotificationPoller with @Scheduled, configure MySQL as the backing store, and verify the full stack with docker compose up.
Capstone Briefing
Review of all course concepts — bounded contexts, REST communication, config externalization, Resilience4j, Docker multi-stage builds, Docker Compose orchestration. Capstone project requirements: add a discount-service to the ShopNest stack.
Capstone Project
Build and integrate a fourth discount-service into the ShopNest platform — scaffold the service, containerize it, update Order Service to call it with a circuit breaker, add it to Docker Compose, and verify the full four-service stack.