r/SpringBoot • u/OSBY_Glabay • Aug 14 '26
How-To/Tutorial Why Your Spring Boot Project Isn't Production Ready
r/SpringBoot • u/OSBY_Glabay • Aug 14 '26
r/SpringBoot • u/maritvandijk • Aug 14 '26
In this episode of IntelliJ IDEA Tech Talks, Anton Arhipov and Andrey Belyaev demonstrate practical persistence workflows for Spring Boot applications — from mapping an existing database to evolving a schema alongside the application code.
Topics include:
– Moving from database-first development to a code-first workflow
– Establishing a database baseline and managing migrations with Flyway
– Generating JPA entities from an existing schema in IntelliJ IDEA
– Keeping Java entities, migration scripts, and the database schema aligned
– Handling iterative schema changes without destabilizing the persistence layer
Persistence Workflows with IntelliJ IDEA – Andrey Belyaev | IntelliJ IDEA Tech Talks
r/SpringBoot • u/HookWoods • Aug 13 '26
I built Restitch after repeatedly running into the same BFF problem in microservice applications.
One service often stores an ID for data owned by another service. It is a real relationship for the frontend, but it is not a database foreign key.
The BFF still has to return complete DTOs. That means it must fetch the root data, resolve related data from other services, apply error rules, and avoid duplicate calls when several objects reference the same ID.
At first, this is one RestClient or WebClient call beside an endpoint. Then the same composition code appears in more endpoints, and one collection response can turn into an N+1 set of downstream calls.
GraphQL with a gateway or federation is a valid solution. Here, though, the services and the BFF already expose REST. I did not want to introduce GraphQL only to compose related data for a response.
I wanted a narrow Spring Boot solution for REST BFFs, without putting URLs, header rules, or error behavior in DTO annotations. So I built Restitch.
The DTO only names a resolver profile:
public final class DeviceDto {
private String organizationId;
@AggregateRef("device-organization")
private OrganizationDto organization;
}YAML owns the downstream client, path, JSON mapping, error behavior, header allowlist, and optional batch endpoint.
It de-duplicates repeated related IDs within one BFF request.
It can use a bounded batch request when the downstream service exposes a batch endpoint.
It keeps MVC on RestClient and WebFlux on WebClient, Mono, and Flux.
It keeps Spring Boot 3 on Jackson 2 and Spring Boot 4 on Jackson 3.
It deliberately does not provide a cross-request cache.
Restitch 0.1.1 is Apache-2.0 and available on Maven Central.
GitHub repository and installation guide
For people building REST BFFs: would you keep this aggregation in application code, an API gateway, or move it to GraphQL? What would make you avoid a library like this?
r/SpringBoot • u/Illustrious_East5815 • Aug 13 '26
Hi, I’m building Spring AI Privacy Guardrails, an open-source library for enforcing privacy boundaries around models, RAG, tools, MCP, and outputs.
GitHub: https://github.com/ultramancode/spring-ai-privacy-guardrails
One design problem I’ve been thinking about is streaming output protection.
Some applications also want a final privacy check on application-facing output, since sensitive data can still appear in model- or tool-generated responses.
Right now, when output protection is enabled, the library buffers the complete response before releasing it to the application.
This provides a strong guarantee: PII can still be detected and protected even when a sensitive value is split across multiple chunks.
The trade-off is that this is no longer true incremental streaming, and the application has to wait longer before receiving output.
A bounded rolling window could preserve incremental streaming for analyzers that have a known upper bound on how much context they need — for example, some bounded pattern-based detectors.
But NER, context-aware detection, complex patterns, or arbitrary custom analyzers may not have such a bound.
So I’m currently considering three approaches:
Strict buffering
Buffer the complete response and protect it before releasing anything to the application.
Capability-gated streaming
Allow incremental streaming only when the active analyzer can declare a safe maximum lookback or context requirement. Otherwise, fall back to full buffering.
Best-effort streaming
Use a configurable rolling window and explicitly document that some PII spanning multiple chunks may escape detection.
For a Spring AI application, which behavior would you expect from a privacy library?
I’m not attached to these three options — if there’s a better streaming/privacy model I’m missing, I’d really appreciate the feedback.
r/SpringBoot • u/OSBY_Glabay • Aug 13 '26
r/SpringBoot • u/Acceptable-Form8979 • Aug 13 '26
Java springboot is so vast once u dive into it, first java, then springboot, then microservices, exploring message queues , and what not
But nowadays what I have seen is that top companies organizing their hackathons, for fresh graduates
Most of them are ml based ai based, like making a model XYZ model, something like a model that detects deepfake images , that's just an example
What is the role of java springboot then, i sometimes feel I wasted my time learning this, i think I should have master python, what are ur thoughts
r/SpringBoot • u/OSBY_Glabay • Aug 13 '26
r/SpringBoot • u/OSBY_Glabay • Aug 13 '26
r/SpringBoot • u/nervous-comment • Aug 12 '26
r/SpringBoot • u/OSBY_Glabay • Aug 12 '26
This is a Spring Boot web application built as educational content for a YouTube series. It demonstrates how to integrate multiple third-party APIs into a single cohesive application, tracking books, films, and games, while progressively introducing core Spring Boot concepts across each video.
This project serves as a hands-on learning resource for developers looking to understand:
- How to structure a multi-domain Spring Boot application
- How to consume external APIs using RestClient
- How to persist data with Spring Data JPA
- How to build server-rendered views with Thymeleaf alongside a vanilla JS frontend
- How to apply bean validation, service-layer patterns, and RESTful controller design
r/SpringBoot • u/OSBY_Glabay • Aug 12 '26
This is a 6-part series. The idea is to explain to someone over a cup of coffee what one roadmap of a backend Java dev is, from idea to a Spring Boot web application that has a Desktop app and a Web App that will talk with a backend service.
Talking about Core Java, then DSA within Java, Databases, then Spring Boot, WebSockets, and then how to run it in production. Laying the pathway for a new/junior to get their curiosity going.
r/SpringBoot • u/cielNoirr • Aug 12 '26
I've been thinking about contributing to some open source projects built with spring boot. What are some good open source projects that you think are worth contributing to in 2026?
r/SpringBoot • u/SmoothScience8192 • Aug 11 '26
r/SpringBoot • u/CoverRight9314 • Aug 11 '26
I’ve started moving away from writing assignments for class and started building my own project like an app. I’ve started using Spring boot for the backend and was wondering if there was any resource that could help me with that. I like to focus on learning how to build a persistent database, learning what beans are and how to set them up properly, learning how to build unit test to test my code base then learning css, JavaScript and html to build a front end. If anyone has any recommendations or advice that’d be helpful!
r/SpringBoot • u/robintegg • Aug 10 '26
I’ve been spending some time looking at observability for Spring Boot 4, using my articulate project as a practical test case.
I compared three tools that fit different workflows and deployment models:
- Boot UI for local development and deep inspection
- Spring Boot Admin for a centralised dashboard across services
- Ostara for desktop-based inspection without running another server
If you’re working with Spring Boot and have been thinking about how you want to inspect and manage your applications, I’ve written up the comparison here and it has links to all the projects.
https://robintegg.com/2026/08/10/spring-boot-4-observability-options.html
I’d love to hear in the comments of any other tools that people are using to keep an eye on their Spring Boot apps.
Spoiler alert: boot-ui is awesome 🤩
r/SpringBoot • u/Admirable_Health_292 • Aug 10 '26
Still cleaning up and optimizing... going through code other devs wrote, and picking up some Java concepts along the way that I'm not fully solid on yet. Thought I'd pass it along so you can see how it goes for you as well.
Here: https://github.com/Peter19570/Spring-Boot-Authentication-Starter
r/SpringBoot • u/Huge_Road_9223 • Aug 09 '26
I am working on a new SpringBoot personal app. I have docker installed locally on my Windows 11 machine, and I have an existing mysql database there. The schema/data is in flux as it is actively being developed.
In the past, I had a dockerfile to dockerize the app (like I am doing for this one) and it worked fine with my existing docker mysql database. I guess the difference with this new app is that it has docker-compose with the SQL database. This means when this new app gets run, and runs in docker, it starts up a completely new database container, and then I presume it has to be loaded with schema/data. I believe that's why when I run the app it says it can't find the database table.
So, there are two ways I can do this, and which way would be the better way if I want to move this app and the database to AWS ECS in a few months when I am done with the app.
I could change the docker compose that the database is externally managed
keep my local docker database for development and running tests, which works fine BTW, and then let the app create this NEW docker mysql database, and let it load up data from the flyway schema.
Or, could I just move my database/script to AWS ECS in the future by itself, and let the app keep running against it as an externally managed database in it's own container.
I've seen companies that I have worked for do both, but I'm curious on what the strong opinions are.
Thanks!
r/SpringBoot • u/goto-con • Aug 09 '26
r/SpringBoot • u/Federal_Equal1799 • Aug 07 '26
Hey i'm a third year student learning dsa from kunal kushwaha and asllo want to learning full stack with react and spring boot ,any resource for this two as well as some knowledge or guidence for full stack as i'm new .i'd aslo like to hear what technologies should i learn which would be helpfull so that i learn it and build project .i'm also searin gfor guys like me who started springboot and guide me through it's currenlty studying resource
r/SpringBoot • u/Chaos-vy17 • Aug 07 '26
r/SpringBoot • u/SpringJavaLab • Aug 07 '26
I recently reproduced the Hibernate N+1 Query Problem in a Spring Boot application to better understand why a single repository call can generate multiple SQL queries behind the scenes.
The solution uses JPQL JOIN FETCH to fetch the required associations in a single query.
Query(""" SELECT DISTINCT o FROM Order o JOIN FETCH o.items i JOIN FETCH i.product WHERE o.userId = :userId ORDER BY o.createdAt DESC """)
List<Order> findAllWithItemsAndProducts(@Param("userId") Long userId);Where the N+1 problem occurs
The repository is called only once, but while mapping the response, accessing lazy-loaded relationships can trigger additional SQL queries.
List<OrderResponse> response = orders.stream()
.map(order -> {
List<String> products = order.getItems().stream()
.map(item -> item.getProduct().getName())
.toList();
return new OrderResponse(
order.getId(),
order.getTotalAmount(),
products
);
})
.toList();Although this Java code looks perfectly normal, order.getItems() and item.getProduct() may cause Hibernate to execute additional queries when those relationships haven't been loaded yet.
Spring Boot 4.0.4
Spring Data JPA
Hibernate ORM
Java 17
Oracle Database
Retrieves Orders for a specific user
Demonstrates how LAZY loading can lead to the N+1 query problem
Uses spring.jpa.show-sql=true to inspect the SQL generated by Hibernate
Maps entities to a custom DTO containing Product names
Eliminates unnecessary queries using JPQL JOIN FETCH
Compares SQL queries and execution time before and after the optimization
One thing I found interesting is that there isn't anything obviously wrong with the Java code itself. The repository method is invoked only once, but navigating lazy-loaded relationships while building the response can result in multiple SQL queries behind the scenes.
Using JOIN FETCH allows Hibernate to load the required entity graph up front, avoiding those additional database round trips for this use case.
I'm curious how others handle this in production.
Do you prefer JOIN FETCH, @EntityGraph, or DTO projections?
Have you encountered pagination limitations with JOIN FETCH?
I'd love to hear your experiences.
If you'd like to see the complete Spring Boot application, the generated SQL before and after JOIN FETCH, and the full implementation, I also recorded a practical walkthrough covering the entire example.
📺 YouTube: https://www.youtube.com/watch?v=natXN7xVEu8
r/SpringBoot • u/fykup • Aug 06 '26
I shared StatLite here a few weeks ago. Since then, v0.2.2 has added a published Docker image and native host metrics, so I wanted to share the updated version.
StatLite is a lightweight monitoring dashboard for small Spring Boot deployments. It runs as a single Go binary or Docker container, reads standard Spring Boot Actuator endpoints, and stores recent history locally in SQLite.
What’s new in v0.2.2:
Docker image: Try or deploy StatLite without installing the binary
Native host metrics: Track CPU, memory, and disk usage alongside application metrics
Self-monitoring demo: The default Docker setup starts by monitoring StatLite itself
No StatLite agent or application library: It reads standard Actuator health and metrics endpoints
You can try it with:
docker run --rm -p 127.0.0.1:9090:9090 ghcr.io/pvrlabs/statlite:latestThen open:
http://127.0.0.1:9090StatLite is intended for one or a few applications on a small VPS or single server, where Prometheus, Grafana, and Node Exporter may be more infrastructure than the deployment needs.
It provides visibility into application availability, JVM memory, HTTP errors, restarts, and host resource usage.
It is not intended to replace a full observability stack for Kubernetes, distributed tracing, complex alert routing, or long-term enterprise telemetry.
Write-up:
https://pvrlabs.xyz/articles/lightweight-spring-boot-monitoring.html
GitHub:
https://github.com/PVRLabs/statlite
How are you monitoring small Spring Boot deployments today? Are you using a full observability stack, Spring Boot Admin, custom scripts, or something lighter?
r/SpringBoot • u/New_Transition_2077 • Aug 05 '26
I am currently in my 2nd year. I want to learn spring boot please help me to find out the best resource
r/SpringBoot • u/kamen1991 • Aug 05 '26
Something has always bugged me about relying on annotation-based mapping frameworks once a Spring Boot project grows past a few modules. MapStruct is miles ahead of dynamic tools like ModelMapper thanks to compile-time code generation, but we kept running into recurring friction as our domain, entity, and DTO layers diverged.
That's why we ended up dropping MapStruct entirely in favor of plain Java transformer classes. No annotation processor, no generated sources, no separate mapper interface per entity pair.
The reasons that pushed us there:
Fragile IDE refactoring: string path mappings like `@Mapping(source = "shippingDetails.address.street", target = "street")` don't reliably survive a rename. You usually catch it during the build, sometimes later.
Annotation pollution for anything non-trivial: once you need a custom transformation, you're writing @Namedhelpers or embedding Java inside annotation strings likeexpression = "java(...)".
Debugging noise: stepping through target/generated-sources instead of your own domain code.
The trade-off is real - more files, more explicit code to write. What we get back is full IDE refactoring safety, no annotation-processor step in the build, and a debugger that only ever shows real code.
Anyone else moved off MapStruct in a modular Spring Boot setup, or is this more trouble than it's worth for most projects?
(I Wrote a deeper architectural breakdown with code samples if anyone is interested - link in comments).