r/SpringBoot • • Sep 26 '26

Discussion Dear JPA

105 Upvotes

Dear JPA ,

i hate you.

i hate how you changed the SQL flow that I'm used to.

i hate your ManyToMany relationships.

i hate your orphanremoval ,dirty checking.

i hate your way for entity relationships.

i hate your cache.

i hate your performance issues.

i hate your billion rules.

i hate spending time on : if Y is referenced by X with cascade not including PRESIST and x is managed but y is removed ............... but if Y was detached .............

i hate becoming obsessed with your behaviors and rules and worrying about every ORM line , will it work correctly ? , did i miss something ?, worrying about modifying entity X might unexpectedly affect entity Y , coz I might not know one of the billion rules you have.

i hate worrying about falling in one of the undefined behaviors you have

i hate thinking about the entities lifecycle + cascading types when all mixed together

i hate spending days on that documentation instead of spending that on one of the CS core concepts

i hate the following the other side which is incomplete nondetailed toturial or following AI

i really hate you.


r/SpringBoot • • Jul 10 '26

Discussion Spring Data 2026.0 (ships with Spring Boot 4.1) introduced type-safe property paths.

102 Upvotes

If you've ever written this:

Sort.by("lastName")

You know the problem. It compiles, IDE says nothing and your tests pass.

Then someone renames lastName to familyName and this line will start throwing runtime error with PropertyReferenceException.

No warning and type checking. Just a string that nobody knows is connected to a field name.
 
Instead of strings you can use method references:

Sort.by("lastName") => Sort.by(Person::lastName)

Criteria.where("lastName") => Criteria.where(Person::lastName)

Criteria.where("address.country") => Criteria.where(PropertyPath.of(Person::address).then(Address::country))

Same result but now the compiler checks it and your IDE autocompletes it.
 
This works across Spring Data JPA, JDBC, R2DBC, MongoDB. It's a Spring Data Commons feature so every module gets it.
 
For records the accessor is Person::lastName.
For classic beans it's Person::getLastName.
 
It's a small feature but massive impact on code safety.


r/SpringBoot • • Aug 15 '26

Discussion Not to be racist but is there any non-Indian YT channel about Java and Spring Boot?

100 Upvotes

As the title says


r/SpringBoot • • Jan 03 '25

Spring is overwhelming.

99 Upvotes

Started learning Spring boot right after finishing java core, jdbc and lil bit of maven, all these new annotations, methods, dependencies and bean stuffs are truly overwhelming and too much information to handle.

How should a beginner learn in the early stages? Orelse does it get easy down the line?


r/SpringBoot • • Jul 04 '26

Discussion Some of the rules I learned about file uploads based on my experience

98 Upvotes

I have built file upload features in a few projects over the years. Below are some rules that might save you some time.

  1. Never route files through your backend. Always generate a presigned url and let the client upload directly to s3. Let your backend just handles the permission check and stores metadata.

  2. Always validate file type by content not by extension. someone can rename virus.exe to photo.jpg and your system will accept it. Try to check the magic bytes server side. jpegs start with FF D8 FF, pngs start with 89 50 4E 47. Don't trust the extensions blindly.

  3. Use chunked uploads for anything above a few MBs. s3 supports multipart uploads natively. It can be done in spring boot also in multi part uploads.

split the file into 5-10mb chunks, upload independently, retry only the failed chunk. add resume tokens so users on flaky networks can continue from where they left off instead of restarting.

4) You should not serve files immediately after upload. every file should go through a scan queue first. virus scan passes then mark it ready. fails then quarantine it. Try to always have a gate between upload and access.

5)Don't expose raw s3 paths to users. Always generate signed download urls that expire in 15 minutes and then let backend checks user permissions before generating the url. Never share raw s3 links.

6) Always process everything async after upload. thumbnail generation, image compression, video transcoding, indexing...etc. none of this should block the upload response. return 201 immediately. let s3 events trigger workers in the background.

7) Set file size limits and rate limits based on your use case. Don't leave it open.

what rules do you follow for file uploads?


r/SpringBoot • • May 03 '26

Question Spring Boot Apps with Claude Code in IntelliJ

98 Upvotes

First, I have 35 yoe overall. I have been doing Java for a long time, since version 3. I have been using Spring and SpringBoot since 2007 (18 yoe) and creating secured RESTful services. It was mostly in STS (Spring Tool Suite) which as you know is Eclipse. I switched to IntelliJ about 2.5 years ago because of a contract role, and that is what they used.

This contract role I had, they use GitHub as a repo which is fine, and they were using testing CoPilot and asked people to comment on it, to see what the issues were, good and bad. Then we all know that Microsoft changed to pay by token, and that is the only plan they have. I believe this will increase the cost a lot, but I couldn't tell you how much!

Anyway, That position has come to an end after 2.5 years, and a new company I may be interviewing with is using Claude Code. They want someone who can use Claude Code, and review any code generated by it, which I can do. I obviously can code without the use of AI since I have been doing it my whole career.

I've looked at ONE YT video, which showed how to use IntelliJ to create an app, and it was very impressive. One of the things done in the video was to create entities/repositories based on a table in the database. Ok, that's great, but I was doing that with OSS JBoss Tools 10 years ago. I also saw how Claude Code generated both Swagger and OpenAI documentation for the API's. I think there are already other non-AI tools that can do that also. They also generated Postman tests for the API's as well, and I am sure there are other tools around that can do the same thing, or there could be.

So, when Claude Code did these things I saw the massive amount of tokens being generated. I posted in the /ClaudeCode and /ClaudeAI sub-reddits, and it seems that their users are die-hard fanatics of the tool, and do not accept any skepticism of Claude Code or AI in general. IMHO, they have really drunk the kool-aid, and think that if I don't learn it and use it, then I'll be left behind and unable to get a job. I think that's a little extreme.

What I DID find out was that if I create my own account on Claude Code, I have to pay! Since, I am unemployed, I didn't know if I did want to pay the $20/month for it. From other resources across the internet the $20/month is a joke, and the tokens allowed can be used in 4 hours of heavy coding. I also found out that the $20/month is WAY BETTER than paying per API token which would add up very quickly.

Yes, I am a skeptic of AI, IMHO (which means nothing), I think we are in an AI bubble. If Claude Code ALSO changes to pay by token ONLY, then it will drive the costs up. It has been speculated that ALL AI companies will eventually go this way, driving up costs.

But just because I am a skeptic of AI, I was also a skeptic of Hibernate, SpringBoot, Lombok, I never liked these to begin with but learned how to use them anyway. I have been learning new technologies for years, and have no problem learning how to use Claude Code.

So, the question to the folks here is: How many of you have used Claude Code or any API to help you code your Spring Boot apps, and was it within IntelliJ, or something else? I'm interested to hear your experiences with it, the good and the bad. Did you create new apps with it as a greenfield application? Did you use it to fix existing applications?

Thanks for putting up with the long post.

Thoughts?


r/SpringBoot • • Jul 17 '25

How-To/Tutorial Spring Boot Authentication, step by step

96 Upvotes

Hi! I've struggled with the Spring Security topic myself, and that'as why I decided to write a small article about how to simply secure a website with a username and password. It is divided in the following sections:

  • Create a non-secured web

  • Introduce Authentication

  • Activate default Spring Security

  • Define a custom hardcoded user/plain password in the configuration

  • Encode the password

  • Specify the encoder

  • Use a custom User Details Service that contains the hardcoded user/password

  • Retrieve the user/password from an in-memory database (H2)

  • Retrieve the user/password from an on-disk database (MySQL)

I felt like every article or official documentation introduced too much stuff, like authorization, roles etc. which I understand are important too, but it felt like trying to learn what a variable is and having to deal with streams directly.

I'll be happy to get any feedback.


r/SpringBoot • • Jul 06 '26

News JobRunr (distributed background job processing for the JVM) is now available on start.spring.io (Spring Initializr)

93 Upvotes

JobRunr is now available in the Spring Initializr dependency list, so you can add it straight from start.spring.io when you create a new project. No more wiring the starter in by hand afterwards.

For people who don't know us:

JobRunr is an open-source library for background job processing on the JVM: fire-and-forget, scheduled, delayed, durable, and recurring (cron) jobs.

You enqueue work as a lambda and it runs asynchronously, in the same app or across a cluster of workers.

BackgroundJob.enqueue(() -> myService.sendInvoice(invoiceId));

BackgroundJob.schedule(Instant.now().plus(5, DAYS), () -> reminderService.send(userId));

What tends to make people switch to it:

  • No extra infrastructure. Jobs are persisted in your existing SQL or NoSQL database. No Redis, RabbitMQ, or separate broker to run and babysit.

  • Automatic retries with backoff on failure, so transient errors don't lose work.

  • Distributed by default. Run multiple instances and jobs are picked up once across the cluster, no double execution.

  • Built-in dashboard to see enqueued, scheduled, succeeded, and failed jobs, and retry them.

  • Spring Boot autoconfiguration via the starter, plus first-class support for virtual threads (Loom) and Spring Boot 3 & 4

It sits in the same space as Quartz or @Scheduled, but aimed at durable, distributed background work rather than just triggering methods on a timer.

You can even use it for durable jobs. With runStepOnce, each step in a job runs exactly once and is checkpointed, so if the job fails and retries, the steps that already succeeded are skipped instead of re-run:

BackgroundJob.enqueue(() -> processOrder(orderId, JobContext.Null));

public void processOrder(UUID orderId, JobContext context) {
  context.runStepOnce("order-confirmation", () -> orderService.sendConfirmation(orderId));
  context.runStepOnce("warehouse-notification", () -> orderService.notifyWarehouse(orderId));
  context.runStepOnce("shipment-initiation", () -> orderService.initiateShipment(orderId));
}

Thanks to Josh Long and the Spring team for helping get it onto Initializr. We'll be around in the comments to answer anything, including the honest limitations.


r/SpringBoot • • Feb 11 '26 Bravo

How-To/Tutorial Spring Boot Roadmap From Zero to Microservices

Thumbnail
github.com
92 Upvotes

I created a 35-week Spring Boot roadmap that is broken into three levels, beginner, intermediate, and advanced. It covers almost everything you need from absolute zero (not knowing Java programming) to expert (building with the microservices architecture).

Each week consists of topics, resources, tasks, bonuses, and some notes.

The resources are versatile as I included official documentations, youtube videos, and online articles.

You can view it from this link and feel free to give any feedback:)

https://github.com/muhammadzkralla/spring-boot-roadmap


r/SpringBoot • • Sep 10 '25

Question Why start a new Spring Boot app with Java instead of Kotlin?

90 Upvotes

Hey everyone,

I’ve been wondering about this for a while. Kotlin today is very well supported by Spring Boot — it’s fully compatible with the Java and Spring ecosystem, provides more features out of the box, reduces boilerplate, and feels cleaner overall.

The Kotlin community has also grown a lot, and the tooling feels very modern and idiomatic. A good example is testing: libraries like Kotest and MockK give you a cleaner, more idiomatic approach compared to the more “traditional” style of testing in Java. Yes, Kotlin tools are often built on top of existing Java ones, but they give you a much nicer developer experience.

So my question is: why would someone still choose to start a brand-new Spring Boot project in Java instead of Kotlin

Would love to hear your thoughts and experiences.

Update: I’m not looking to argue, and I’m not biased — I genuinely just want to ask and hear your answers


r/SpringBoot • • Jun 18 '25

Question What should a junior Spring Boot dev actually know?

89 Upvotes

Hey all,

I’m applying for junior backend roles and most of them mention Spring Boot. I’ve built a basic project before, but I’m still unsure what’s really expected at a junior level.

Do I need to know things like Spring Security, Spring Cloud, etc., or is it enough to just build REST APIs and use JPA?

Would love to hear from anyone who’s been through interviews or works in the field. Thanks!


r/SpringBoot • • Nov 11 '25

Question Difference between Spring Data JPA vs. JPA vs. Hibernate vs. JDBC

88 Upvotes

Can you explain it to a beginner like me and please I could not understand it by myself and also with searching on Internet so consider that, one thing that also when saying that "JPA is just a specification" what even that means. I use Spring Data JPA in my small projects little but I do not know the relations between all of these things, also i have not tried them.

If you have images or just "great videos" that would supports my understanding with all the comments.


r/SpringBoot • • Jun 16 '26

Question How are you actually running Spring Boot in production on the cloud in 2026?

85 Upvotes

I'm trying to get a sense of what real setups look like beyond the tutorial defaults.

If you run Spring Boot in production, I'd love to hear:

- Where does it run? (ECS/Fargate, EKS/Kubernetes, Cloud Run, App Runner, plain EC2/VMs, Elastic Beanstalk, etc.)

- JVM or native (GraalVM)? Did cold starts / memory push you one way?

- How do you handle config and secrets? (Spring Cloud Config, Vault, AWS Parameter Store, env vars)

- Build/deploy pipeline and image strategy (Jib, buildpacks, plain Dockerfile)?

- Anything you'd do differently if starting today?

Mostly curious what's common vs what's hype. Stack size / team size context welcome.


r/SpringBoot • • Aug 13 '25

Discussion Why no one promotes to use springboot as other backend tech stack

85 Upvotes

Hey everyone. I just surfing the X and everyday I saw someone praising node js or mern stack or any other backend tech stack and these guy's have their role models who teach all these backend tech stacks and they teach very good. But that's raise a question in me that why no one promotes springboot as other promotes other backend tech stack soo much and why there is no such tech guy like other's have . Is there something drawback in Springboot than other's or its just harder to learn than any other tech stack.

Anyone can share their opinion, their journey or incident guy


r/SpringBoot • • Sep 23 '25

Question Java devs who switched to Kotlin for Spring Boot: Was it worth it?

84 Upvotes

Hey everyone, I'm a software engineer (I have some experience in java/springboot) considering using Kotlin for a new Spring Boot project. I've heard a lot about its benefits like less boilerplate, null safety, and data classes, but I'm curious about the real-world experience from those who have made the switch.
I'm hoping to get some real insights beyond just the syntax differences. Thanks in advance!

For those of you who had little to no Kotlin experience before, how was the learning curve? What were the biggest "aha!" moments, and what were the most confusing parts? What are some things you wish you knew when you started?

On the flip side, what did you miss about Java?

I'm hoping to get some real insights. Thanks in advance!


r/SpringBoot • • Aug 13 '22

Am I stupid or spring security is too damn hard

82 Upvotes

it is been like 3 days trying to figure out how to implement authentication and authorization, but all the resources are so bad, none of them is actually worked, it seems the only one who worked is the JWT but i couldn't figured out how to destory the token as soon as user logout .

if there is any resource that help me to understand Spring Security please provide it to me Edit: My idea was basically is to create cookie as soon as user login and it will store a cookie in both client side and redis so no matter server which server he’s on his session won’t be revoked and also as soon as i logout i want to destroy this cookie from both client side and redis.


r/SpringBoot • • Sep 03 '26

How-To/Tutorial Migrating to Spring Boot 4. The parts your AI agent will miss

Thumbnail
youtube.com
81 Upvotes

Here's a migration guide to Spring Boot 4.

Of course you can delegate it to an AI agent. No problem with that.

But you still need to understand what it changed and why, to catch the cases where the app compiles, tests pass, and something silently breaks in prod.

Are you still migrating manually? Or are you handing it to an agent?


r/SpringBoot • • Jun 20 '25

Guide Perfect springboot microservices project to build over the weekend

81 Upvotes

If you’ve got some time over the weekend, take a look at this Springboot course covering microservices.

It covers a lot of topics such as:

  • DB migration with Flyway

  • Circuit breaker with Resilience 4J

  • Docker Compose files

  • Hibernate / JPA

  • Rest API

  • Kafka topics

  • Postman

  • Auth with Keycloak

  • API Gateway

  • and others

https://youtu.be/-pv5pMBlMxs?si=hLNdYBOzqaEzGQHx

Hope you find it useful


r/SpringBoot • • Nov 24 '22

guys is this the spring boot that everyone keeps talking about ?

Post image
81 Upvotes

r/SpringBoot • • Oct 22 '25

Question Is this the Spring Boot we are all talking about?

Post image
79 Upvotes

r/SpringBoot • • Jun 24 '25

Guide How I write production-ready Spring Boot applications

79 Upvotes

My approach to production-ready Spring Boot architecture (detailed guide with code examples)

I've been working with Spring and its ecosystem for most of my 25+ year Java career. Here's how I currently structure Spring Boot applications for maintainability and testability.

Key patterns:

  • Organizing packages around aggregate roots instead of technical layers

  • Breaking service classes into focused use cases

  • Repository abstractions that provide value without ceremony

  • Clean separation between domain, use cases, and web layers

Why not Hexagonal Architecture? While solid, I find it adds too much ceremony for typical Spring Boot apps. This approach gives you the benefits of clean architecture without fighting Spring's conventions.

Includes working code examples using a pet clinic scenario. The patterns scale well from small apps to enterprise systems.

What patterns do you use? Always interested in how other developers approach Spring Boot architecture.

https://www.wimdeblauwe.com/blog/2025/06/24/how-i-write-production-ready-spring-boot-applications/


r/SpringBoot • • 6d ago

How-To/Tutorial Spring Boot 4: what’s new and how to migrate from 3.x (cheatsheet)

Thumbnail
mariolecker.github.io
78 Upvotes

Feedback and missing gotchas welcome


r/SpringBoot • • Jun 19 '25

Guide Pure JWT Authentication - Spring Boot 3.4.x

Thumbnail mediocreguy.hashnode.dev
76 Upvotes

No paywall. No ads. Everything is explained line by line. Please, read in order.

  • No custom filters.

  • No external security libraries (only Spring Boot starters).

  • Custom-derived security annotations for better readability.

  • Fine-grained control for each endpoint by leveraging method security.

  • Fine-tuned method security AOP pointcuts only targeting controllers without degrading the performance of the whole application.

  • Seamless integration with authorization Authorities functionality.

  • No deprecated functionality.

  • Deny all requests by default (as recommended by OWASP), unless explicitly allowed (using method security annotations).

  • Stateful Refresh Token (eligible for revocation) & Stateless Access Token.

  • Efficient access token generation based on the data projections.


r/SpringBoot • • May 27 '25

News Spring Boot 3.5.0 available now

Thumbnail
spring.io
76 Upvotes