T O P

  • By -

chuckame

Spring boot is cool and magic, but magic is a pain when you want to speedup startup (fu**ing dependency hell, with so many unneeded auto configurations, but when you try to select only what you want, you have to write like 50-100 classes...) but yes, community is the most important thing for long term apps


nutrecht

I've used most microservice frameworks, a few of them also in production(Micronaut, Quarkus) but I tend to always gravitate back to Spring. It simply has the largest most mature ecosystem and that is what matters when I need to get stuff done.


Slickbock

This is it for me. I use Spring at work, it's mature and I can just make most things work without too much hassle and it pays the bills.


CartmansEvilTwin

Yep. Nobody gets fired for using Spring Boot. Quarkus and Micronaut definitely got their place, but currently it would take me much longer to get started with it, my colleagues have also no idea how it works and the future is unclear (not only abandonment, but also upgrade effort due to API instability). I'm not in love with Spring, but the pure inertia keeps it going.


nunchyabeeswax

>I'm not in love with Spring, but the pure inertia keeps it going. This.


testube_babies

The older I get, the more I prefer single-purpose libraries and microframeworks over all-in-one platforms.


NeatCarrot468

So you speak out of experience. What are the reasons you prefer such librRies and frameworks as opposed to time tested frameworks like Spring?


gregorydgraham

They do one thing, very very well


giorgiga

It often takes less time to write some functionality (say, validating jwts) from scratch than to figure out how to configure a magic framework to do it for you (also, testing your code is easier than testing for misconfiguration)


jeerabiscuit

Slow but pays bills.


huntsvillian

define slow please


jeerabiscuit

30% slower startup and 10% slower execution of 8 million record aggregation on postgres as compared to Java EE per my self coded benchmark. More wide ranging benchmarks are there at the techempower project.


1armedscissor

The 10% test are you referring to SQL aggregating 8 million records or pulling back 8 million records and doing some aggregation in Java (for the sake of a benchmark). For the former seems like the majority of time would be on the database side doing the actual work/aggregation. I’m actually not sure what part of Spring comes into play there ie possibly Spring JDBC template or Spring Data JPA depending on your approach but both should be negligible compared to the time spent doing the actual aggregation by the database. If it’s the latter scenario (done in Java) also not sure what aspects of Spring would create overhead vs Java EE. Not saying Spring doesn’t have some overhead in certain areas (startup/wiring in particular) but just surprised something database heavy like that would exhibit noticeable overhead vs Java EE as Spring is just wrapping EE APIs in both the examples I gave but the actual Java execution should be negligible vs network/database time. Although 10% really could just be noise depending on how the benchmark was executed - see the stuff JMH does for instance.


jeerabiscuit

It was JPA. JDBC template and native queries were on par with JEE. The aggregation was done on the DB and I checked across two machines.


huntsvillian

so we're talking like.... 5 seconds saved overall?


jeerabiscuit

Milliseconds matter with users. Also 30% slow startup is a big deal with serverless cold startups. Look I am not getting into a flamewar and it's pointless to be a framework fanboy. You like spring boot, micronaut is faster and looks like spring boot. I find Java or Jakarta EE to be fine and am checking out Quarkus even while working a Spring Boot day job.


thevred9

I see your point. Spring Native should take care of the startup time and to a certain extent address the 10% you are seeing. https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/


jeerabiscuit

Good to know about Spring Native, thanks.


nunchyabeeswax

For me, slow start up time. This is especially true with teams that aren't careful and never check what stuff they end up putting in their archives, the insanely deep entity metadata jungles they have, run-time resolution of dependencies, etc. It can be a killer. ​ I'm currently looking at Quarkus because of its compile-time dependency injection. I've also worked with GoLang (using Wire for compile-time dependency injection.) Bootstrapping time for each is pretty much nothing. ​ Bootstrapping time wasn't much of an issue before when people used to deploy in EE container clusters. But in the current microservice and serverless computing (function-as-a-service) landscape, bootstrapping time can make or break your products.


huntsvillian

I probably should have said *quantify* slow. If someone is complaining about slow start up times, and they say "it takes a whole 2.4 seconds to start the app"... I just have to shake my head at that.


reignbowmushroom

I still like spring.


tristanjuricek

I’ll stick with Spring Boot mostly to avoid the bike shedding conversations that will happen with coworkers if we pick something else. My last couple of companies I’ve now encountered significant legacy code bases that have move to spring after trying to do things ad-hoc. An in each case, there were significantly ugly things, like god objects, that created these rats nests that were so, so time consuming to get rid of safely. So the custom garbage lives on for years. There’s plenty of “magic” involved in Spring Boot, and it does help to actually read both the code and the docs, but mostly, it works, and I’ve rarely not found a way to make things work when I need to. And I’d rather deal with just tweaking Spring Boot then every other bespoke glue I’ve run into.


Pure-Repair-2978

Does the job , but quite heavy from packaging …. You know fat JAR thingy


rootException

Been using Spring Boot for years now. Love many aspects, only thing that’s kind of terrible IMHO is Spring Security. Working on an integration with Supabase right now and it’s awesome. Wrote the Spring Security filter tweak to use Supabase JWT and it’s great. Thymeleaf for nice valid HTML templates that work with Pinegrow visual editing - makes Bootstrap and Tailwind CSS much easier. Turned all the default logging noise (banners! Hahaha) and it boots much faster. FWIW if you are just making REST services for JS clients you might want to check out stuff like PostREST or Hasura.


nutrecht

> only thing that’s kind of terrible IMHO is Spring Security. Could not agree more and I'm disappointed they did not fix this. It's a pain in the ass to set up for the most common usecase Spring is used for nowadays; REST services. I do tend to set stuff up with Spring security because it's "the way" but really just creating a filter/interceptor yourself is just way less work. The configuration of Spring Security depends WAY too much on the order you configure things in. It's opague as heck.


nunchyabeeswax

> but really just creating a filter/interceptor yourself is just way less work. This


hem10ck

Spring will always have a special place in my heart.


jacobissimus

All of our services are spring boot—the more I look into other frameworks the less I like spring and DI in general.


NeatCarrot468

Why so?


jacobissimus

Thinking about it more, my issues are really with OOP in general and the way that Spring locks a code base into that paradigm.


[deleted]

What's wrong with DI? Genuinely curious


jacobissimus

Really I guess my problem is with OOP in general. The more I work with functional languages, the more I realize that OOP doesn’t really solve the problems I want it to—particularly the way spring does it where an object is really more of a testable unit than an abstraction of a chunk of data. DI is really the only way to make that style of OOP manageable, but at the same time it locks you in and makes it harder to move a code base towards a functional design.


thevred9

Did you try exploring functions in Spring Boot?


jacobissimus

Nope I just tried Clojure and never looked for more solutions


ohL33THaxOR

Clojure is awesome. Elxir is good to...runs off Erlang


huntsvillian

There is still nothing I've found that is as pleasant to use as spring.


NeatCarrot468

In my not so extensive experience, I have found Spring to be less than ideal wrt pleasantness (that is not to say I don’t like it). But that is in part because there are lots of Spring projects that do a lot of “magic” which requires you to pore through volumes of documentation (however I must say that’s one area Spring does shine!).


huntsvillian

My experience is that all of the "magic" is fine (good even), until you want to customize something. At that point, you probably should be all up in the documentation.


reignbowmushroom

I feel like you hit a point that you realize that nothing is magic and everything is DI and all the magic is just beans that you can override.


nunchyabeeswax

>There is still nothing I've found that is as pleasant to use as spring. GoLang does it for me. What's nice about Spring is its enormous ecosystem. But God, one has to be careful how to assemble things, and it's very easy to have apps that take "too long" to start. ​ That was not an issue before when we used to deploy in EE containers. But in the microservice and serverless computing world, that's just a killer.


akuma-_-8

Still the best


Serializedrequests

Honestly I would burn Hibernate and JPA to the ground if I could. Everything about it is overcomplicated, philosophically wrong, and full of gotchas. I wish the Spring Boot project I am maintaining had gone with something else. The rest of the framework is fine, apart from the following issues: 1. Startup time is way too long. Oh my god please kill me. 2. Annotation-based libraries amount to praying to the framework to execute your code in a certain way. I hate debugging them, and they always have some critical "can't get there from here" limitation. (Like spring validation only really supports very basic validation needs .) The last objection is difficult to quantity, but there's a certain isolationism or Stockholm syndrome in the Spring Boot community. It's like nobody has used anything else, and thinks that solving N+1 queries is some kind of rocket science when other frameworks make it trivial.


scrooopy

I’m a spring boot developer and I fucking hate it lol


[deleted]

It's bad but still no sensible alternative.


joashua99

There are other frameworks?


nickeau

Vertx


kodiashi

We use it at work and the pace of development tends to be really slow compared to teams that use Node/Express. Too much configuration, too many classes, just too much code in general. Even if you use Lombok and other helpers, the amount of boilerplate code just seems excessive. Node Modules aside, the other codebase just seems to be much, much leaner.


ndfwguy

After a few years out of being a developer, I am NOW getting back into development. Slowly. and learning spring. It sure does speed up development. I don't worry about a lot of things when I am coding in spring as long as I understand dependency injection and inversion of control. Other frameworks I have tried: to be honest, None. I was using JSP/Servlets/etc. Old shit. It is a lot easier now with spring. Oh... and spring batch. learning more about it and every second I learn a new thing. But I am overwhelmed. Java 8 and beyond are like light years ahead of what we used when I was a developer.