Java & Spring Developer Beginner to Expert
An ordered path from Java syntax and the JVM through Spring dependency injection, Spring Boot, REST APIs, Spring Data JPA, Spring Security, testing, messaging, Spring Cloud, and deployment.
Almost everyone learning Spring learns it in the wrong order. They start with Boot, because Boot is the part that produces a running application quickly, and end up with a framework that works but cannot be reasoned about. The fix is boring: learn the Java underneath first, then learn the container, and only then the annotations.
Two topics in here are worth more than their position suggests.
Concurrency is in stage 3, and it’s the one people skip hardest. A @Service is a singleton, so every request thread calls the same instance. Mutable field state in one is a race condition that will pass every test you write on your laptop and fail under load in a way that looks like a database problem.
And Spring AOP is in stage 5 because it explains the most confusing behaviour in the whole framework. @Transactional and @Cacheable work through a proxy the container wraps around your bean, which means calling an annotated method from another method of the same class bypasses the annotation entirely. People lose hours to that one, and it takes ten minutes to understand once you know proxies are involved.
Stages are ordered by dependency rather than by difficulty. Topics marked required are the ones you’ll be asked about and the ones you’ll debug; recommended and optional can wait until a real project asks for them.
Java language foundations
Syntax, types, and control flow
Primitives against their boxed wrappers, the difference between == and equals, string immutability, and why switch expressions and pattern matching in modern Java remove most of the verbosity people still associate with the language.
Classes, interfaces, and records
Encapsulation, inheritance and composition, plus records for immutable data carriers. A record replaces about forty lines of getters, equals, hashCode and toString, and it is the right default for a DTO.
What the JVM actually does
Compilation to bytecode, class loading, the heap against the stack, and garbage collection at a conceptual level. You do not need to tune a collector yet, but you do need to know that an OutOfMemoryError and a StackOverflowError have different causes.
Interfaces with default methods, sealed types
Default methods are how the standard library evolved without breaking implementers, and sealed interfaces let you close a hierarchy so pattern matching can be exhaustive. Both show up in modern framework code.
Collections, generics, and streams
The collections framework
List, Set, Map, Deque, and which implementation to choose. ArrayList against LinkedList in practice, HashMap against TreeMap against LinkedHashMap, and the contract between equals and hashCode that makes a HashSet work at all.
Generics, bounded types, and wildcards
Type parameters, extends and super bounds, and why List<? extends Number> is read-only. Type erasure explains most generics error messages, including why you cannot write new T[].
Streams and collectors
map, filter, flatMap, reduce, and Collectors.groupingBy. Streams are lazy until a terminal operation runs, and a stream is single-use. Reach for a loop when the stream version is harder to read, which happens more often than stream enthusiasts admit.
Optional, used properly
Spring Data returns Optional, so this matters immediately. Use map, filter and orElseThrow; calling .get() without checking defeats the entire purpose. Optional is for return values, not for fields or parameters.
Exceptions and concurrency
Checked against unchecked exceptions
When to use each, and why Spring wraps checked JDBC exceptions in unchecked DataAccessException subclasses. Never swallow an exception silently, and never catch Exception to make a compiler complaint go away.
try-with-resources
Any AutoCloseable is closed automatically, in reverse order, including when the body throws. It is the correct way to handle a stream, a connection or a file, and it removes an entire class of resource leak.
Threads, and why a Spring bean is shared
The single most important concurrency fact for a Spring developer: a @Service is a singleton, and every request thread calls the same instance. Mutable field state in one is a race condition that passes every test on your machine and fails under load.
The concurrency toolkit
ExecutorService, CompletableFuture, AtomicInteger, ConcurrentHashMap, and the synchronized keyword. Prefer immutability and the concurrent collections over hand-written locking.
Virtual threads
Project Loom, stable since Java 21. A blocking call on a virtual thread no longer ties up an OS thread, which changes the calculus for thread-per-request web applications and is why Spring Boot 3.2 can turn them on with one property.
Build tools and project layout
Maven fundamentals
The POM, the build lifecycle, dependency scopes, and transitive resolution. mvn dependency:tree is the command that resolves most version conflicts, and knowing that the nearest definition wins explains the ones it does not.
Gradle fundamentals
The alternative, with a Kotlin or Groovy DSL and better incremental build performance. Worth being able to read even if your team uses Maven, because a lot of library documentation assumes it.
Spring Boot starters and dependency management
A starter is a curated set of dependencies with versions already reconciled. This is why you add spring-boot-starter-web without a version and why overriding one Spring version by hand usually breaks something else.
Spring core and dependency injection
Inversion of control and the application context
Your code stops constructing its collaborators and declares what it needs instead. The container builds the object graph and hands dependencies in. Every annotation you learn later is a way of describing something to this container.
Beans, scopes, and lifecycle
Singleton by default, plus prototype and request scopes. @PostConstruct and @PreDestroy hooks, and why a singleton depending on a request-scoped bean needs a proxy.
Constructor injection, and why not field injection
Constructor injection makes dependencies explicit, allows final fields, fails fast on a missing bean, and lets you build the object in a unit test without a container. Field injection with @Autowired does none of that. Prefer constructors, always.
Component scanning and configuration
@Component, @Service, @Repository and @Controller are all component stereotypes with different semantic intent. @Configuration with @Bean methods is how you register something you do not own the source of.
Spring AOP and proxies
How @Transactional, @Cacheable and @Async actually work: the container hands you a proxy that wraps your bean. This explains the single most confusing Spring behaviour, that calling an annotated method from another method of the same class bypasses the annotation entirely.
Spring Boot fundamentals
Auto-configuration, and how to see it
Boot configures beans based on what is on the classpath, and backs off when you define your own. Run with --debug for the auto-configuration report showing every decision and its reason. This turns Boot from magic into something you can reason about.
Configuration properties and profiles
application.yml, @ConfigurationProperties for type-safe binding with validation, and profiles for per-environment values. Learn the property resolution order, because an environment variable silently overriding your YAML is a confusing hour otherwise.
The embedded server
Tomcat by default, with Jetty and Undertow as alternatives. Your application is a jar that starts a server rather than a war deployed into one, which is what makes containerising it straightforward.
Spring Boot DevTools
Automatic restart on classpath change and sensible development defaults. A small quality-of-life gain that shortens the feedback loop.
REST APIs with Spring MVC
Controllers and request mapping
@RestController, @GetMapping and friends, @PathVariable, @RequestParam, @RequestBody. Return an object and let Jackson serialise it rather than building JSON by hand.
DTOs, and why entities do not belong in a response
Returning a JPA entity from a controller couples your API to your schema, leaks fields you did not mean to expose, and triggers lazy-loading exceptions during serialisation. Map to a record. This is the single most valuable habit in this stage.
Validation with Bean Validation
@Valid on the parameter plus @NotNull, @Size, @Email and custom constraints on the DTO. Validation belongs at the boundary, so invalid input never reaches your service layer.
Global exception handling
@RestControllerAdvice with @ExceptionHandler methods, returning a consistent error shape. Follow RFC 9457 problem details, which Spring 6 supports natively, rather than inventing your own error envelope.
API documentation with OpenAPI
springdoc-openapi generates a specification and a Swagger UI from your controllers and DTOs. Generated documentation stays accurate; hand-written documentation does not.
Pagination and sorting
Pageable and Page in a controller signature, wired straight through to Spring Data. Any endpoint returning a collection needs this before it reaches production, not after a customer with 40,000 rows finds it.
Data access with Spring Data JPA and Hibernate
Entities, mappings, and relationships
@Entity, @Id, generation strategies, and @OneToMany, @ManyToOne, @ManyToMany with their owning side. Default to FetchType.LAZY on every association, because EAGER loads a graph you did not ask for on every query.
Repositories and derived queries
Extend JpaRepository and Spring generates the implementation. Method-name derivation such as findByEmailAndActiveTrue, with @Query for JPQL when a name would become unreadable.
The N+1 query problem
Loading 100 orders and then a customer for each is 101 queries. Fix it with a JOIN FETCH, an @EntityGraph, or a projection that selects only what you need. Turn on SQL logging and count your queries; almost every slow endpoint is this.
Transactions and propagation
@Transactional belongs on the service, because the transaction boundary is a business decision rather than a persistence detail. Understand propagation and the default rollback rule, which rolls back on an unchecked exception and, surprisingly, not on a checked one.
The persistence context and lazy loading
Entities are managed inside a transaction and detached outside it, which is why touching a lazy collection in a controller throws LazyInitializationException. Fetch what you need inside the boundary and map to a DTO before leaving it.
Schema migrations with Flyway or Liquibase
ddl-auto is a development convenience and a production hazard. Versioned migration scripts in source control are the only defensible way to evolve a schema, and Boot runs them at startup.
Projections and native queries
An interface or record projection selects only the columns you need, which is often a large win over loading full entities. Drop to a native query when JPQL cannot express what the database can, and accept the loss of portability.
Spring Security
The filter chain
Security is a chain of servlet filters that runs before your controller, which is why an unauthorised request never reaches your code and why you cannot debug it by adding logging there. Learn to read the chain, and use logging.level.org.springframework.security=DEBUG.
Authentication and authorisation
Authentication establishes identity; authorisation decides what that identity may do. SecurityFilterChain configuration, @PreAuthorize for method-level rules, and the difference between a role and an authority.
Password storage
PasswordEncoder with bcrypt or Argon2, and DelegatingPasswordEncoder so stored hashes carry their algorithm prefix and can be migrated. Never store a password reversibly, and never write your own hashing.
JWT and stateless authentication
Issuing and validating tokens, choosing an expiry, and the refresh-token pattern. Understand what a JWT cannot do: you cannot revoke one before it expires without server-side state, which is the tradeoff people discover too late.
OAuth2 and OpenID Connect
Spring Security as a resource server validating tokens, and as a client performing a login flow. The authorisation code flow with PKCE is the correct choice for a browser or mobile client; the implicit flow is deprecated.
CSRF, CORS, and the security headers
When CSRF protection is needed and when it is not, why a stateless token API usually disables it, and how CORS differs from it entirely despite being confused with it constantly. Set the standard headers, including a content security policy.
Testing
JUnit 5 and AssertJ
Lifecycle annotations, parameterised tests, and nested test classes. AssertJ's fluent assertions produce failure messages you can read, which matters more than it sounds when a test fails in CI at 6pm.
Mockito, and what not to mock
@Mock, @InjectMocks, stubbing and verification. Mock the collaborators at your boundaries, not everything: a test that mocks five things and asserts on the interactions tests your mocks rather than your logic.
Slice tests against full context tests
@WebMvcTest loads only the web layer, @DataJpaTest only persistence. Both start far faster than @SpringBootTest, which loads everything. Reach for the full context only when the test genuinely spans the application.
Testcontainers
A real PostgreSQL, Kafka or Redis in Docker for the duration of the test. It ends the class of bug that only appears against the real database, and it is now the default recommendation over an in-memory substitute.
Integration testing an API
MockMvc for the servlet layer without a network, WebTestClient or TestRestTemplate against a running port. Test the contract, including error responses and validation failures, since those are what break for callers.
Messaging, caching, and performance
Asynchronous messaging with Kafka
Producers, consumers, topics, partitions and consumer groups through Spring for Apache Kafka. Delivery is at-least-once, so a consumer must be idempotent. That requirement is the whole design problem, not a detail.
RabbitMQ and Spring AMQP
The alternative model: exchanges, queues and bindings, with per-message acknowledgement. A better fit than Kafka for task queues and request-reply, and a worse fit for a replayable event log.
Caching with Spring Cache
@Cacheable, @CachePut and @CacheEvict over Redis or Caffeine. The annotations are trivial; the difficulty is invalidation and choosing a TTL. Remember that the proxy means an internal method call skips the cache entirely.
Connection pooling
HikariCP is the Boot default. Pool sizing is the most commonly misconfigured performance setting in Spring applications, and a bigger pool is usually slower. Match it to what the database can actually serve concurrently.
Async and scheduled work
@Async for fire-and-forget with an explicit executor, @Scheduled for periodic tasks. Never rely on the default executor in production, and remember @Scheduled runs on every instance unless you add coordination.
JVM tuning and profiling
Heap sizing, choosing a collector, and reading a heap dump. Learn one profiler properly: async-profiler or JDK Flight Recorder. Measuring first is the difference between a fix and a guess.
Microservices, observability, and deployment
When not to split
A well-structured monolith beats a distributed system you did not need, because a network call between modules turns a compile error into a runtime one and a stack trace into a correlation-ID hunt. Split for independent deployment and scaling, not for tidiness.
Spring Cloud fundamentals
Service discovery, centralised configuration, and an API gateway with Spring Cloud Gateway. Understand what each one buys you before adopting it, because each is also a component that can fail.
Resilience patterns
Circuit breakers, retries with backoff, timeouts and bulkheads through Resilience4j. A retry without a backoff and a jitter is an accidental denial of service against your own dependency.
Actuator and metrics
/actuator/health for readiness and liveness probes, and Micrometer publishing to Prometheus. Expose the endpoints you need on a separate port, and never expose them all publicly.
Distributed tracing and structured logging
Micrometer Tracing propagating a trace ID across services, with logs emitted as JSON carrying that ID. Without this, debugging across services means correlating timestamps by hand.
Containerising a Spring Boot application
Layered jars or Cloud Native Buildpacks via mvn spring-boot:build-image, so a code change does not invalidate the dependency layer. Handle SIGTERM by enabling graceful shutdown, and set container-aware heap limits.
CI/CD and deployment
Build, test and image publishing in a pipeline, then a rolling deploy to Kubernetes or a managed platform. Configuration through environment variables and secrets from a real secret store rather than a file in the image.
Native images with GraalVM
Ahead-of-time compilation for startup in milliseconds and much lower memory, at the cost of longer builds and reflection configuration. Worth it for serverless or heavy horizontal scaling, and unnecessary for a long-running service.
Comments
Was this useful?
Continue on this topic
The same subject, covered a different way from the roadmap above.
ArticleIntroduction to Spring Boot Framework
Many developers use the Spring Boot framework to build web apps and microservices. It's built on top of the Spring Framework and adds a number of conveniences that make it a popular choice. This post covers what Spring Boot is, why it's useful, and how to create a basic Spring Boot application.
QuizSpring Boot: Java Application Framework Essentials
Test your knowledge of Spring Boot covering dependency injection, auto-configuration, REST controllers, Spring Data, and production-ready features.
Case StudyMigrating a Monolith to Kubernetes Without a Big-Bang Cutover
Using the strangler-fig pattern to move a large monolith onto EKS service by service, with a routing facade, gradual traffic shifting, and a rollback at every step.
Code SnippetPostgreSQL Query Optimization: Indexes, EXPLAIN ANALYZE & Execution Plans
Master PostgreSQL query optimization with practical examples. Learn EXPLAIN ANALYZE interpretation, effective index strategies, query rewriting, and connection pooling to identify and fix slow queries in production microservices.
You might also enjoy
More posts on similar topics

Go Developer Beginner to Expert
Go is small enough that you can read the whole specification in an afternoon, and that is precisely why people plateau. The syntax stops being the obstacle within a week, and the remaining difficulty

Python Developer Beginner to Expert
Python is easy to start and deceptively deep, which produces a common shape of developer: fluent in syntax, productive in a framework, and unsure what happens when the code meets real traffic. This ro

Node.js Developer Beginner to Expert
Node.js Developer Beginner to Expert This roadmap takes you from JavaScript foundations and the event loop through building APIs, working with databases, streams, testing, and security, and on to r

React Developer Beginner to Expert
React Developer Beginner to Expert This roadmap takes you from JavaScript prerequisites through JSX, hooks, and state management, and on to data fetching, meta-frameworks, performance, and testing.

Full-Stack Developer Beginner to Expert
Full-Stack Developer Beginner to Expert This roadmap walks you from your first web page to shipping and operating a complete production application. Work the stages in order. Build the frontend fun

Backend Developer Beginner to Expert
Backend Developer Beginner to Expert This roadmap walks you from your first server-side program to designing scalable, secure systems. Work through the stages in order. Nail a language, the command
6 related posts