Advanced Java Backend: Modules
This program supports the step from junior developer to someone who can own a real service independently. It concentrates on how the JVM and memory behave, on getting concurrency and database work right, and on diagnosing problems in production-like conditions. Code review is practised from both sides, as author and as reviewer.
01
The JVM and memory
How the JVM manages code and memory, and how to investigate memory problems with measurements.
- Heap, stack, metaspace and object lifetime
- Garbage collectors (G1, ZGC) and the notion of pauses
- Class loading and JIT compilation
- Reading heap dumps and GC logs
- Typical leak sources (caches, listeners, ThreadLocal)
Lab: Analyse a service with a deliberate memory leak using a heap dump, locate the source and fix it.
02
Concurrency and virtual threads
From the Java Memory Model to virtual threads: writing parallel code that is correct and safe.
- Java Memory Model, happens-before and visibility
- synchronized, Lock, atomics and concurrent collections
- ExecutorService, CompletableFuture and structured concurrency
- Virtual threads: when they help, and the pinning problem
- Diagnosing deadlock, livelock and starvation
- Reading thread dumps
Lab: Create a race condition in code that updates a shared balance, reproduce it with a test, then fix it in two different ways and compare.
03
JPA and Hibernate in depth
Safe work with JPA requires knowing how the persistence context, flush and lazy loading actually behave.
- Persistence context, dirty checking and flush modes
- Lazy versus eager loading and the N+1 problem
- Fetch joins, entity graphs and projections
- Batch insert/update and optimistic locking
- Transaction boundaries and the causes of LazyInitializationException
Lab: Measure an endpoint with an N+1 problem through SQL logs, fix it in three different ways and compare query counts.
04
SQL and query performance
Finding out why a query is slow from its plan and choosing the right index.
- Reading EXPLAIN / EXPLAIN ANALYZE
- B-tree indexes, composite indexes and column order
- Covering indexes and selectivity
- Pagination: offset versus keyset
- Isolation levels and locking behaviour
Lab: Analyse a slow query on a large table with its plan, add an index, and present before/after measurements in a written note.
05
Testing strategy
Deciding what to test at which level so that tests stay cheap and trustworthy.
- The test pyramid and its limits
- JUnit 5, Mockito and the over-use of mocks
- Integration tests against a real database with Testcontainers
- Slice tests (@DataJpaTest, @WebMvcTest)
- Causes of flaky tests and how to remove them
Lab: Write a test strategy document for an existing service and add a Testcontainers integration test for its critical flow.
06
Clean code in a growing codebase
Managing structure, naming and dependencies as a codebase grows.
- Package structure and dependency rules between layers
- Separating the domain model from service code
- Refactoring techniques and test-protected change
- Designing exceptions and an error model
- Making technical debt visible
Lab: Split a complex service class into small parts with clear responsibilities while keeping the tests green.
07
Diagnosing production-like problems
A systematic approach to slowness, memory growth and quiet failures.
- Structured logging and correlation IDs
- Micrometer metrics and the key signals
- Reading profilers and flame graphs
- Connection pool exhaustion and thread pool saturation
- A hypothesis-driven diagnosis method
Lab: Diagnose a deliberately broken service (pool exhaustion, slow query) using only logs, metrics and a profiler, and write up a postmortem.
08
Code review practice
Review is both a skill and a team habit; we practise it from both sides.
- Preparing small, well-explained Pull Requests
- A review checklist: correctness, readability, tests, risk
- Writing constructive feedback and responding to it
- Security and performance signals in review
Lab: Review a given Pull Request in writing, then answer the comments on your own Pull Request with reasoned replies.