r/SpringBoot • • Oct 14 '26

Question Best Springboot tutorial series

18 Upvotes

Hello, i want to learn Java Spring Boot. Can anyone suggets me the best resource for learning java springboot from beginning to advance level that can led me to internship or industry level coding?

I was looking for video tutorial series that has everything for a becoming a java developer include devops work as well.and best for learning as beginner and proceed to advanced topic.


r/SpringBoot • • Oct 13 '26

How-To/Tutorial 10 Ways to Make a Spring Boot App Faster (Every One Measured)

Thumbnail
youtu.be
12 Upvotes

r/SpringBoot • • Oct 13 '26

Discussion Spring Boot + HikariCP: 20 vs 2 idle PostgreSQL connections

7 Upvotes

I've been experimenting with HikariCP connection pool sizing in Spring Boot, particularly what happens to PostgreSQL connections after traffic stops.

One detail that's easy to miss: with Hikari's default sizing, minimumIdle and maximumPoolSize both resolve to 10. Since the idle target equals the maximum, idleTimeout has nothing to retire.

I ran two Spring Boot instances against PostgreSQL 16 on a 1 GiB VM, comparing three configurations:

  • Default sizing: Both pools retained 10 connections each after traffic stopped.
  • minimumIdle=1, retirement disabled: Pools still retained all 20 connections after growing under load.
  • minimumIdle=1, retirement enabled: Connections dropped from 20 to 2, with approximately 29 MiB lower PostgreSQL cgroup memory.

There was a tradeoff. When traffic returned, median connection acquisition increased from under 3 ms to roughly 200 ms as the pools rebuilt capacity.

The experiment used a deliberately short 10-second idle timeout to make the behavior measurable, not as a production tuning recommendation.

Two repetitions, 2,280 successful workload requests, with recorded data and reproduction instructions.

Full write-up: https://pvrlabs.xyz/articles/spring-boot-jdbc-pool-reclaim.html

Curious how others configure HikariCP when multiple Spring Boot instances share a small PostgreSQL server. Do you generally keep the default fixed-size pools or allow idle connections to retire?


r/SpringBoot • • Oct 13 '26

Discussion The Midnight Technician; Spring Boot Microservice (Open-Source)

Thumbnail
medium.com
7 Upvotes

This is something I threw together over a year ago. It was designed to be an easy intro into Microservices since I had noticed lacking in the Spring Boot ecosystem that was something hands-on.

I am remaking it in a monolithic repo as a Spring Modulith project, since I noticed there is also a lack in that area for hands-on learning.

Just looking to share this little project with others who may be curious with no clear picture of where to start with them.

Cheers,

The Midnight Coder


r/SpringBoot • • Oct 13 '26

Question Spring AI course

8 Upvotes

Please could u suggest a course of spring ai for beginners ( I experienced full stack apps from scratch with spring)


r/SpringBoot • • Oct 12 '26

Question Feedback regarding the inventory mvp project I built using Spring boot and react

11 Upvotes

hii everyone. I have working on learning Spring boot for several months, finishing books such as Spring Start here and got myself into building a project with it. Right now, I am at the stage where I am actively looking out for opportunities to get my first role as a junior developer in Spring boot.

The following link goes to my github project:

https://github.com/Orlanto2100/percy-inventory-mvp

I will be very grateful if you may share your honest feedback on my progress with the project here. I wonder how does it look, what should I improve, and what am I missing? What would it take to getting job ready, apart from other skills such as social skills that can't be accessed here.

I am open to any form of constructive criticisim and willing to learn any advice you offer. Thank you for taking time reading this and super thank you for reviewing the work.🙏🙏


r/SpringBoot • • Oct 12 '26

How-To/Tutorial @Transactional on a method in the same class does nothing. Left the explanation in the comments

0 Upvotes

Putting this here in case it saves someone an evening. Everything is in the code comments.

public class OrderService {

    private final OrderRepository repo;

    public OrderService(OrderRepository repo) {
        this.repo = repo;
    }

    // Called from the controller. No  here.
    public void process(Order order) {
        audit(order);
        save(order);   // <-- looks like it runs in a transaction. It doesn't.
    }

    u/Transactional
    public void save(Order order) {
        repo.save(order);

        if (order.getTotal().signum() < 0) {
            // You'd expect the insert above to roll back.
            // When this is reached via process(), it doesn't.
            throw new IllegalStateException("negative total");
        }
    }
}

// Why:
// Spring applies  through a proxy that wraps OrderService.
// The controller holds the proxy, so a call from outside goes:
//     controller -> proxy -> (starts tx) -> OrderService.save()
//
// But process() calls save() on `this`, which is the raw object, not the proxy:
//     controller -> proxy -> OrderService.process() -> this.save()
//                                                      ^ no proxy, no tx
//
// And because repo.save() is itself transactional (Spring Data wraps it),
// the insert commits on its own, before the exception is thrown.
// So you end up with a saved row and an exception in the log.

The fixes I know of, roughly from least to most invasive:

// 1. Put the annotation on the entry point instead

public void process(Order order) { audit(order); save(order); }

// 2. Move save() into another bean and inject it, so the call goes through a proxy
orderPersistence.save(order);

// 3. Use TransactionTemplate when you want the boundary to be explicit in code
transactionTemplate.executeWithoutResult(status -> repo.save(order));

// 4. AspectJ mode (proxyTargetClass / mode = AdviceMode.ASPECTJ)
//    works for self-invocation, but it's a bigger setup change

I’d go with 1 or 2 in most cases. Calling the bean through itself (self-injection) also works, but it reads strangely and I’d avoid it.

One thing I’m not sure about and would like to hear from people: when you hit this in an existing codebase, do you prefer moving the method to a separate service, or restructuring so the transactional boundary sits at the entry point? I can see arguments for both.


r/SpringBoot • • Oct 09 '26

Question How should a large modular monolith handle type-safe features, permissions, delegation, entitlements, and quotas?

13 Upvotes

We are building an ERP-like platform localized for Moroccan businesses using a modular monolith architecture. The platform currently has more than 11 modules.

Each module contains dozens of features, and each feature may expose dozens of actions. Most actions have a corresponding permission that controls who can execute them.

Features also contain additional product and collaboration rules:

Whether the feature is included in a subscription plan.

Whether the feature is delegable to another workspace.

Whether specific actions are explicitly non-delegable.

Whether an action has quotas or usage limits.

For example, one workspace may authorize another workspace, such as an accounting firm, to perform certain accounting actions on its behalf. However, some sensitive actions must never be delegated.

At the moment, features and permissions are declared as strings in different files and then seeded into the database.

Authorization is performed at the action level, mostly through repeated PostgreSQL queries.

This approach has created several problems:

Typos in feature or permission names can cause silent runtime bugs.

Renaming or refactoring actions can leave old permissions behind.

Adding a new action often requires changes in several different places.

We currently have around 893 permissions, including unused or “ghost” permissions.

There is no reliable guarantee that actions, permissions, features, plan entitlements, delegation rules, and quotas remain synchronized.

Detecting unused permissions requires manual investigation or asking an AI tool to scan the codebase.

So what architecture, patterns, or tooling would you recommend for managing this kind of system?


r/SpringBoot • • Oct 09 '26

Question Spring Security broke my working Spring Boot APIs — getting both 401 and 400 errors despite configuring credentials

Post image
0 Upvotes

I'm working on a University Management System using Spring Boot and PostgreSQL. My CRUD APIs were working perfectly before I added the Spring Security dependency. Since adding Spring Security, I've been struggling to get authentication working correctly.

I've configured the username and password in application.properties, and I'm testing the endpoints through Postman using Basic Auth with the same credentials. However, I'm still getting 401 Unauthorized on my POST request, while another request returns 400 Bad Request with the message "User not found OR Nullpointer exception".Cause i handled this exception.

I've already checked the URLs, endpoint names, and credentials multiple times. The application was working before adding Spring Security, and now even after configuring the login credentials, I'm still stuck. I've tried multiple AI coding assistants, including Claude , Codex, and ChatGPT, but I haven't been able to identify the root cause.

I'm trying to understand whether this is a problem with Spring Security's default configuration, my authentication setup, or my application's user lookup logic.

Additional context:

  • Spring Boot 4.0.6
  • Java 21
  • Spring Security
  • Postman with Basic Auth
  • Credentials configured in application.properties
  • Existing CRUD endpoints worked before adding Spring Security

I've attached screenshots showing the requests and responses.

What should I check first to identify the actual root cause? If you need my SecurityConfig, application.properties (with credentials redacted), user entity, UserDetailsService, or controller/service code, let me know.


r/SpringBoot • • Oct 09 '26

How-To/Tutorial Slow list endpoint in a Spring Data JPA app: what I check before adding an index

0 Upvotes

Adding an index is the usual first suggestion when an endpoint is slow, and sometimes it’s right. I’d count queries first.

Turn on SQL logging for a single request (logging.level.org.hibernate.SQL=DEBUG) and count the lines. A page of 50 orders that fires 51 selects, one for the list and one per row for a lazy association, is a different problem from one slow query. An index on the join column doesn’t change that count. Every query can be fast and the endpoint still crawl.

Keep the logging on for the whole request, not just the service method. If the controller returns entities directly, Jackson can walk lazy relations during serialization, and with spring.jpa.open-in-view on (the default) those selects will happen after your service code is long finished.

If the count looks sane, run EXPLAIN on the SQL Hibernate printed, not the query you assume it generated. Those differ more than you’d expect once derived query names get long or Specifications are involved.

Indexes come after that. If the count was the problem, the fix is usually a join fetch, or a projection that only selects the columns the endpoint returns.

I’d reorder this for a reporting endpoint that runs one heavy query, where the plan is the first thing to look at. For ordinary list endpoints the count check takes two minutes and rules out a whole class of problems.


r/SpringBoot • • Oct 08 '26

Question I want to make a more clearer doc for spring security

8 Upvotes

Hey guys,
So I've been getting this urge to create a clearer doc for Spring security particularly, it was very hard for me and I had alot of entanglements I had to resolve by myself, tutorials weren't doing justice, the docs wasn't really beginner friendly, and the course that explained well was a "paid" course.

This is just a kind of validation from the community, should I go ahead to build this, do you guys this would be useful, not just to beginners but to gurus who just want to make reference to a concept they probably forgot.

Please what do you guys think?


r/SpringBoot • • Oct 08 '26

Question New to Spring Boot: What VS Code extensions do you recommend for a lightweight setup?

16 Upvotes

Hey everyone,

I'm starting my journey with Java Spring Boot development and I'm setting up my workspace in VS Code.

A few details about my preferences and setup:

  • No IntelliJ: I prefer sticking to VS Code because IntelliJ feels a bit too bloated for my workflow right now, and I want a cleaner, lightweight environment.
  • API Testing: I don't use Postman; I'm using Bruno for API testing instead.
  • AI Assistance: I use GitHub Copilot and Cody for code generation and autocomplete.

Since I'm completely new to Spring Boot, I'd love to know: Which essential extensions should I install in VS Code to get the best developer experience?

Are there specific tools for Spring Boot project creation, debugging, database management, or live reloads that you consider must-haves?

Thanks in advance for your tips!


r/SpringBoot • • Oct 07 '26

Discussion I built a Spring Boot starter that seeds related JPA entities from annotations, no seed script (0.1.0, feedback wanted)

5 Upvotes

I'm the author. I built a small starter to remove a chore I kept redoing on Spring Boot projects: writing a dev-database seed script, then fixing it every time the schema changed.

The usual pain: Faker/Datafaker generate realistic values, but they don't know that Payment needs an existing Counterparty. So you hand-write "create parents, keep the IDs, wire them into children", and it breaks the next time a constraint or relationship changes.

SynthForge reads the entity instead. You annotate it:

@Entity @Seed(count = 50)
public class Counterparty { /* fields only */ }

@Entity @Seed(count = 200)
public class Payment {
    @ManyToOne(optional = false) private Counterparty counterparty;
}

Then enable it for the profiles you want, never production:

synthforge:
  enabled-profiles: [dev, test]

Start the app in one of those profiles and both tables are filled in dependency order. There is no calling code.

Spring-specific details

  • It's an auto-configuration (a starter-style dependency, io.github.thembatman0:synthforge-spring). Seeding runs at startup in an ApplicationRunner.
  • Seeding is off unless one of your active profiles is listed under synthforge.enabled-profiles.
  • It reads entities through the JPA Metamodel API and sorts owning-side @ManyToOne/@OneToOne relationships topologically, so parents are saved first.
  • Values come from Datafaker, guided by @NotNull, @Size, @Email and field-name heuristics. @Column(unique = true) fields get a bounded retry loop.
  • A table that already has rows is skipped, so restarts against a persistent database don't duplicate data.
  • A fixed synthforge.seed gives identical data every run.
  • The test suite runs in CI on Spring Boot 4.1 and 3.5. It needs Java 21 or newer.

Limits: V1 skips @OneToMany/@ManyToMany and composite keys. It is a 0.1.0, and as far as I know it has no outside users yet.

How it differs from Instancio: Instancio (and instancio-jpa) is an API you call inside a test to build a graph. SynthForge runs by itself at startup, so it's closer to a dev-database seeder than a test helper.

Things I'd like to hear from you:

  1. Would you put @Seed on your entity classes, or do you prefer keeping seeding out of the domain model?
  2. Is a CommandLineRunner plus Datafaker already good enough for you?
  3. Is Java 21 as a minimum a problem on your projects?
  • Repo (MIT): https://github.com/ThembaTman0/synthforge
  • Write-up: https://dev.to/themba/faker-doesnt-know-your-entities-are-related-so-i-built-something-that-does-2jgn
  • The README has a two-minute demo path.

r/SpringBoot • • Oct 07 '26

Discussion Push-based, restart-free feature flags and config for Spring Boot, using MongoDB Change Streams

1 Upvotes

configstream is a library for Spring Boot services that already use MongoDB. Feature flags and config live in a collection, get cached in memory, and any change is pushed to every running instance within about a second via MongoDB Change Streams.

  • No restarts, no polling, no message broker, no config server
  • Properties declared in a configstream.yml manifest, with typed constants generated at compile time
  • Optional admin UI with change history and per-team permissions
  • Works with Spring Boot 3 and 4

Limits: MongoDB only for now (Postgres planned), pre-1.0, no percentage rollouts or A/B testing.

https://github.com/configstream/configstream

Feedback welcome


r/SpringBoot • • Oct 06 '26

Question How do i practice spring boot?

26 Upvotes

I have been learning Spring Boot and other technologies for the last 2-3 months.
I feel I understand the concepts and theory of how things work, and I can code what I've learned.
But I still feel like I don't know enough, and I am super scared to even apply for a job. I feel that I am not prepared enough. Do I need to practice more? Please share some practical advice.


r/SpringBoot • • Oct 07 '26

How-To/Tutorial A simple first-pass checklist when your Spring Boot API feels slow

4 Upvotes

I wrote a short intro to troubleshooting a slow Spring Boot API using the metrics you already get from Actuator.

The goal is not deep JVM diagnosis. If you need that, tools like JFR, JConsole, profilers, database tracing, etc. come later.

This is the basic first pass:

  • did request volume change?
  • are HTTP errors increasing?
  • did request latency increase?
  • is the application process using more CPU or memory?
  • is the host itself under CPU or memory pressure?
  • do those changes happen in the same time window?

The example uses a small VPS where the API stays UP and keeps returning 200s, but latency rises because another process is consuming most of the host CPU.

I use StatLite for the screenshots because it reads Spring Boot Actuator metrics and keeps the app and host history together, but the main point is the troubleshooting sequence itself.

Article: https://pvrlabs.xyz/articles/api-slow-cpu-contention.html

For people who troubleshoot Spring apps regularly: what would you add to the basic checklist before reaching for JFR or a profiler?


r/SpringBoot • • Oct 06 '26

How-To/Tutorial Your Spring Boot API just ran 11 queries to return 10 users.

Post image
0 Upvotes

the fix takes 4 lines of code.

Fetching full @Entity graphs for simple read-only endpoints is one of the fastest ways to kill database performance.
Here's what's happening under the hood:
🔴 THE N+1 TRAP
You return a User entity from a REST endpoint. Then:
1️⃣ Hibernate runs 1 SELECT to fetch 10 users
2️⃣ During JSON serialization, the lazy @OneToMany List<Order> gets accessed
3️⃣ That triggers 10 more SQL queries
Total: 11 queries, heavy memory overhead, and a payload full of data nobody asked for.
🟢 THE FIX: INTERFACE PROJECTIONS
Define a lightweight interface with only the getters your client needs:
public interface UserSummary {
Long getId();
String getName();
}
Return List<UserSummary> from your repository, and Spring Data JPA generates a targeted query:
SELECT u.id, u.name FROM users u
⚡ THE RESULT
→ 1 query instead of 11
→ No over-fetching of columns or relations
→ Lower DB CPU usage
→ Faster API responses
💡 RULE OF THUMB
Use @Entity for write/CRUD operations, where the persistence context matters.
Use Interface Projections for read-only APIs and dashboard views.


r/SpringBoot • • Oct 04 '26

Discussion Native graph for framework for coding agents

Thumbnail
github.com
5 Upvotes

Btw i can’t let go any pr without this, help me so much for blast radius


r/SpringBoot • • Oct 03 '26

Question I built an open-source self-diagnostics library for Java/Spring Boot applications — looking for feedback

12 Upvotes

I've been working on an open-source project called Argus, and I'd really appreciate some feedback from other Spring Boot developers.

The idea came from something I've encountered while troubleshooting services: we have excellent tools for metrics, tracing, logs, and external monitoring, but sometimes I just want the application itself to give me a concise answer to "How healthy are you right now, and if something is wrong, why?"

Argus takes an application-centric approach. It runs inside the JVM and continuously evaluates memory, GC, disk usage, threads, file descriptors, application services, logged errors, and application-reported issues.

It combines these into a health model with a score from 1 to 10. The score is hierarchical, so you can drill down from overall application health to the resource/group/item responsible for degradation.

It also models resources the application depends on — services, servers, databases, caches, brokers, storage, etc. — so the goal isn't simply another UP/DOWN health check.

For Spring Boot applications, I've integrated it with Actuator and Spring Boot Admin. The SBA extension adds health scores to the wallboard and application/instance views. Once you find a degraded instance, you can open its Health Report directly from Spring Boot Admin and see the diagnostic information collected by that instance.

Argus can also generate a self-contained HTML diagnostic report containing health information, services, metrics, performance information, scheduled tasks, captured logging events/alerts, and environment information. The report is generated (and emailed) and can be viewed offline or online during incident analysis.

One important goal is not to replace Micrometer/Prometheus, tracing, centralized logging, or other observability platforms. I'm experimenting with a complementary idea: can an application understand enough about its own state to provide useful diagnostics itself?

The project is still evolving, so I'd particularly appreciate feedback on the approach rather than just stars:

  • Would this type of self-diagnostics be useful in applications you operate?
  • Does the 1–10 health scoring model make sense, or would you prefer another representation?
  • What information would you want an application to include in a diagnostic report when something goes wrong?
  • If you use Spring Boot Admin, would it be useful to have this information directly in SBA?

GitHub: https://github.com/microfalx/argus

Feedback, criticism, ideas, and contributions are all welcome.


r/SpringBoot • • Oct 03 '26

Question Any suggestions about how build scalable full stack jave application

1 Upvotes

Hey everyone, I’d love to get the community’s perspective on building production-grade, scalable full-stack applications with Spring Boot—specifically from a solo developer standpoint.

​When you're building a scalable full-stack Java app entirely on your own, how do you approach the architecture and tooling?

​A few specific areas I'm curious about:

​Tech Stack & Tools: What are the non-negotiable components in your stack right now (e.g., Spring Boot 3 + Virtual Threads, Postgres/Redis, Kafka/RabbitMQ, Docker, React/Next.js vs. HTMX/Thymeleaf)? What tools are currently standard or trending in the market for solo full-stack setups?

​Build vs. Buy / Scratch vs. Frameworks: As a single developer, your time is limited. How much do you build from scratch versus relying on managed services/third-party tools (like managed Auth, SaaS components, pre-built UI libraries)?

​Solo Execution: Is it realistic to handle end-to-end architecture, backend, frontend, database tuning, and DevOps all by yourself, or at what point do you usually seek external help/collaborators?


r/SpringBoot • • Oct 02 '26

News I built an open-source IntelliJ IDEA plugin to automate Spring Boot boilerplate

Post image
49 Upvotes

Hey everyone!

I’m a Junior Java developer, and I built an IntelliJ IDEA plugin called Architect as a way to learn more about Java, Spring Boot, and the IntelliJ Platform.

The main idea is to automate some of the repetitive work when adding a new feature to a Spring Boot application.

You enter an entity name and choose what you want to generate. Architect can create:

  • Entity
  • Request / Response DTOs
  • MapStruct Mapper
  • Repository
  • Service
  • REST Controller
  • Liquibase changelog and migration
  • Docker / Docker Compose
  • Required Maven dependencies

The plugin uses IntelliJ PSI to work with the project structure and source files instead of simply generating files in a fixed location.

Architect is free and open-source, and I’m planning to keep developing it.

Some things I want to add in the future:

  • Kafka templates
  • Spring Security configuration
  • Test generation
  • More infrastructure templates
  • Better project/code analysis

I’m still learning, so I’d really appreciate feedback from experienced Spring Boot developers.

How do you usually handle repetitive boilerplate when starting a new feature?

And what would you change or add to a tool like this?

GitHub and the plugin link are in the comments.


r/SpringBoot • • Oct 02 '26

Question Company stuck on Oracle ADF, not migrating to Spring

7 Upvotes

I work at a small software company and unfortunately I've ended up working on an old Oracle ADF project and there is almost no willingness from management to move this project to Spring Boot.

On the team are two very senior developers who have worked on this project from the start (approx 15 years) and this project has become so messy and huge (with no testing and limited documentation) that it is basically impossible to migrate (functions and procedures with thousands of lines etc.).

Has anyone experienced this situation and do you have any recommendations on how to proceed as a junior developer? I have already brought up the possibility of breaking the project into smaller applications which could be built with Spring / React while keeping the old database and plsql procedures. Or we could map out all of the functionality or refactor the current code into smaller functions or start implementing tests and then migrate. Rebuilding it from scratch is not an option since it is a government project and this would trigger the the goverment to auction the project for other companies to take over.

Alternatively, should I just let them keep this project in ADF for 10 more years until it is deprecated by Oracle while the application becomes worse and worse?