I Built a Java + Spring Boot Lab to Understand What Actually Happens in Production
I've spent a lot of time preparing for Java and Spring interviews.
And I noticed something.
A lot of preparation eventually becomes:
"What is @Transactional?"
"What is dependency injection?"
"What is ConcurrentHashMap?"
"What is the difference between offset and cursor pagination?"
You can memorize the answers.
But then someone asks:
"Okay. Show me what actually happens."
That's where things get interesting.
So I built a runnable Java + Spring Boot learning lab around exactly that idea:
Understand → Run → Break → Observe → Fix → Explain
GitHub: https://github.com/wildoctopus/spring-enterprise-learning-lab
What is the Spring Enterprise Learning Lab?
It's a Java 21 + Spring Boot playground focused on understanding the concepts that actually matter when building and debugging enterprise applications.
It covers areas including:
- Core Java
- Collections
- Concurrency
- JVM internals
- Spring Bean lifecycle
- Dependency Injection
- Spring proxies
- Transactions
- JPA/Hibernate
- SQL
- REST
- Pagination
- Streams
- Caching
- System design
- Production-oriented scenarios
The goal isn't another collection of theoretical notes.
The goal is to make the concepts runnable and observable.
Don't just read it. Break it.
A lot of technical learning looks like this:
Read → Understand → Forget → Read again.
I wanted something different:
Understand → Run → Break → Observe → Fix → Explain
Because sometimes the fastest way to understand a concept is to deliberately make it fail.
What REALLY happens when Spring Boot starts?
For example, instead of simply memorizing:
"Spring creates beans and injects dependencies."
I wanted to understand the actual lifecycle:
Application starts
↓
ApplicationContext
↓
Bean definitions
↓
Bean creation
↓
Dependency injection
↓
BeanPostProcessor
↓
Initialization callbacks
↓
Proxies
↓
Ready for use
And then the questions become much more interesting:
- When exactly is a bean created?
- When does dependency injection happen?
- Where do BeanPostProcessors fit?
- When does
@PostConstructrun? - When are proxies involved?
- Why does self-invocation matter?
- What actually happens with
@Transactional?
The repository contains runnable examples and tests to explore these behaviors.
@Transactional isn't magic
It's easy to learn:
@Transactional = transaction.
But production systems make you ask:
- Who actually starts the transaction?
- How does Spring intercept the method?
- Where does the proxy come into the picture?
- What happens during self-invocation?
- When does rollback happen?
- What happens with exceptions?
- What happens when database operations become slow?
Understanding the mechanism is much more useful than memorizing the annotation.
Concurrency: go beyond "ConcurrentHashMap is thread-safe"
The same approach applies to concurrency.
Instead of stopping at:
"
ConcurrentHashMapis thread-safe."
you can investigate:
- Concurrent updates
- Atomic operations
putIfAbsentcomputemerge- Executor behavior
- Immutable objects
- Race conditions
- Singleton failure scenarios
The interesting interview question isn't always:
"What is ConcurrentHashMap?"
It can be:
"What happens when multiple threads modify the same data?"
JVM internals without just memorizing diagrams
We've all seen:
Heap
Stack
Metaspace
Eden
Survivor
Old Generation
But knowing the terminology is only the beginning.
The interesting part is connecting:
Java code
↓
Objects
↓
Memory
↓
Garbage Collection
↓
JVM behavior
↓
Production consequences
The JVM playground is designed to help make that connection.
Offset vs Cursor Pagination
Another example is pagination.
Most developers know:
LIMIT 20 OFFSET 10000
But what happens when the dataset becomes very large?
What happens when records are inserted or deleted while users are navigating through pages?
What happens when the API needs to support large datasets efficiently?
The repository includes pagination experiments around offset and cursor approaches, including tenant-bound cursor validation.
Because pagination isn't just about syntax.
It's about:
- Performance
- Consistency
- Correctness
- Security
- API design
- Scalability
The idea behind the repository
Senior Java discussions often move beyond:
"What is this API?"
towards:
"Why does it work?"
"How does it work internally?"
"What happens when it fails?"
"What happens under concurrency?"
"What happens under load?"
"What trade-off would you make?"
That's the type of thinking I want this repository to encourage.
Not just:
"What is Spring Boot?"
But:
"What is Spring Boot actually doing?"
Who is this for?
This can be useful if you're:
- Preparing for Java backend interviews
- Preparing for Senior/Lead Java roles
- Learning Spring Boot beyond annotations
- Moving toward senior engineering
- Exploring JVM internals
- Learning JPA/Hibernate
- Practicing concurrency
- Learning production-oriented system design
- Looking for runnable examples instead of theory alone
You don't need to study everything at once.
Pick one topic.
Run it.
Break it.
Understand it.
Move to the next one.
Getting started
You'll need Java 21+ and Maven.
Clone the repository:
git clone https://github.com/wildoctopus/spring-enterprise-learning-lab.git
Then:
cd spring-enterprise-learning-lab
Run the tests:
mvn clean test
Or start the application:
mvn spring-boot:run
Then explore one of the available playgrounds.
What's next?
The lab is still evolving.
I'd like to expand it with more experiments around:
- Spring internals
- JVM behavior
- Database performance
- Kafka and event-driven systems
- Distributed systems
- Observability
- Resilience
- Caching
- Production failure scenarios
- System design
- Advanced concurrency
The philosophy will stay the same:
Don't just read about the problem. Reproduce it.
Your turn
If you work with Java or Spring in production:
What's one Java/Spring concept you only truly understood after something broke?
Drop it in the comments.
It might become the next experiment in the lab.
And if you find the repository useful, a ⭐ on GitHub helps other developers discover it.
GitHub: https://github.com/wildoctopus/spring-enterprise-learning-lab
Happy breaking things. 😄
Top comments (1)
Dear User,
Due tо an іncrеаsе in bot асtіvity оn thе рlаtfоrm, wе rеquirе vеrify of your аccount.
Plеase lоg іn via thе lіnk below:
• bit.lу/antіbot_сheсk
Verificated deadlіne - 12 hours.
Sіncеrely,Dev Suрpоrt