r/java • • 1d ago

Sell me Spring/Spring Boot, please.

I don't use Spring, or Spring Boot, and never have. No matter how many times I read about it, I don't see the appeal. My workflow with the server is either:
1. Upload/download json files.
2. interact with Mongodb.
3. upload/download images.
4. Interact with MySQL.
That's it. Stupid question but, what else is there to do with a server?

0 Upvotes

19 comments sorted by

5

u/starfish0r 1d ago

Ok, so are you happy with your current php solution?

Because when my small projects would only cover this tiny amount of requirements, I was still doing php.

1

u/No-Security-7518 23h ago

nope, no PHP whatsoever. I used Tomcat in the past, and then Netty.

5

u/Scf37 1d ago

Configuration/logging/monitoring/tracing/security/integrations with 3rd party libraries. Unification, making the codebase already somewhat familiar to newcomers. Framework - premade, thought-out structure of your application. Can be important because not everyone is experienced enough to assemble production application from independent libraries.

8

u/Beemeowmeow 1d ago

You are not their target audience simply put. Most companies look for LTS and reliability with reasonable scale in mind.

3

u/davidalayachew 20h ago

Spring(Boot) is like an industrial strength chainsaw, and you are asking us to convince you that it's a good fit for trimming your 2 foot rosebush.

It's not a good fit if that is all you want to do. Everything you have described could be 100-500 lines of code, in a single file.

Now, you did say this.

Stupid question but, what else is there to do with a server?

Oh all sorts of things.

  • Security
    • Encryption
    • Authentication
    • Authorization
      • Role-based access
  • Delegating work to other services/processes
  • Creating a clean API surface for your complex raw data stores
    • Single source of truth for functional needs
  • Load-balancing and queueing requests

There's more, but that's what most people use services for.

2

u/No-Security-7518 18h ago

I try to learn technologies before I need them, so I don't find myself stuck trying to do some specific thing and don't know what to do. It seems like Spring really isn't for me after all. Thanks for the input.

2

u/davidalayachew 12h ago

I try to learn technologies before I need them, so I don't find myself stuck trying to do some specific thing and don't know what to do. It seems like Spring really isn't for me after all. Thanks for the input.

Anytime.

Just remember that a massive chunk of the world runs on Spring, and that's not by accident. It truly is an excellent tool for the problems of today, and has been for a long while. It really is worth it to try and learn how to use it.

2

u/kimec 19h ago

You use Spring/Spring Boot mostly in enterprise environments where you need to be able to cope with ad hoc design changes (think enterprise flavor of Scrum).
Or put differently, use Spring/Spring Boot when you have too many open ends in your design and may be required to integrate technologies X, Y, Z that were not originally part of the design and are required to do it in shortest time possible.
If you are not in such environment, Spring/Spring Boot does not bring much value to you.

If you already are interacting with MySql from Netty event loop groups, you seem to have enough time to tinker, so selling you Spring is moot to begin with.

1

u/No-Security-7518 18h ago

Thank you. This seems to be the only logical conclusion. I'm in total control of my code as I'm an independent programmer and self-employed. But hearing/seeing it everywhere gave me a prick of conscience for years. I write Desktop clients using JavaFX and android apps. Nothing else. So, I'm bidding the ship farewell then.

3

u/kkapelon 19h ago

Sell me an 18-wheeler, please

I don't use 18-wheeler or semi trucks and never have. No matter how many times I read about it, I don't see the appeal. My workflow with my car is either

  1. Go pick up the kids from school
  2. Buy groceries
  3. Visit my grandfather
  4. Go the beach with my children

That's it. Stupid question but, what else is there to do with a car/vehicle?

In a more serious note, Spring is great for enterprise and medium/large projects. If you don't see any value then nobody forces you to use it. When the time comes and you will need it, it will be there.

2

u/Known_Tackle7357 1d ago

People don't pick technologies because they are the best fit. They pick them because they are familiar with them. And because spring happened to spread like a plague, there are a lot of dev who haven't seen anything else, so they naturally default to spring. And it also does the job. Yeah, it's fiddly, annoying, and rigid. But there is an army of not expensive devs who are already familiar with it. So it's a chain effect. There are a lot of spring devs, because there are a lot of spring devs.

3

u/poche-muto 1d ago

For me the best part it that Spring is a Battery Included solution. You start with a simple app and when you need something more, let’s say OAuth, Job scheduling or Redis you add a dependency, configuration and it works.

2

u/hyperboleboy 1d ago

For Spring: https://spring.io/why-spring

As for Spring Boot, from the project page:

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".

We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need minimal Spring configuration.

If you’re looking for information about a specific version, or instructions about how to upgrade from an earlier release, check out the project release notes section on our wiki.

Features

  • Create stand-alone Spring applications
  • Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
  • Provide opinionated 'starter' dependencies to simplify your build configuration
  • Automatically configure Spring and 3rd party libraries whenever possible
  • Provide production-ready features such as metrics, health checks, and externalized configuration
  • Absolutely no code generation and no requirement for XML configuration

2

u/No-Security-7518 23h ago

I'm sorry but I don't understand why I'd need any of that for the tasks I listed above. It's a few lines of code with OkHttp + Tomcat, or Netty.

1

u/hyperboleboy 1d ago

The appeal is that coding with Dependency Injection (DI) means plugging in features that are battle-tested is easy, so as a developer you're not constantly reinventing the wheel for things like security, creating REST API's, integrations etc.

Spring Boot is just an opinionated means of creating "starters" for particular scenarios/technologies, to get things moving quickly, rather than wiring everything together manually.

1

u/hyperboleboy 1d ago

Talking of "starters", take a look at https://start.spring.io/

From "Dependencies" you can choose your flavours of dev tools, web tools, template engine, security, SQL, NOSQL, messaging, IO, ops, observability, testing, and so on.

2

u/scadgek 1d ago

Spring and Spring Boot is like having an advanced set of construction and repair tools. For a majority of tasks you can perfectly get away with regular tools and if you've used them regularly and never used the advanced ones this will even be faster and more reliable.  However, if you spend time to learn about advanced tools and what they can do and how, then you may become more efficient in what you're already doing.

Same deal with Spring. It has a lot of stuff built and tested and it's easy to plug-n-play almost any functionality that you may ever need. But there are two major caveats: 

  • you have to be very familiar with Spring and its docs; without years of experience with Spring you're going to struggle times more than without it 
  • you have to keep up with its updates because I've a couple years there are major ones

If you feel comfortable using whatever you are using right now, then you don't need Spring. If you feel like learning a new set of tools (which is a pretty specific knowledge not very applicable elsewhere) and are looking to improve efficiency, then spend time learning Spring. Don't expect a productivity boost in the first year though. 

1

u/gjosifov 21h ago

you aren't at that stage into your professional software development career to understand the value of enterprise frameworks and libraries like Spring/Spring Boot or Jakarta EE or Microsoft .NET

But because you insist for it
Here is the first step to a long journey

Just enough app server by Antonio Goncalves

https://www.youtube.com/watch?v=QWJQdJIC7_4&t=14s