Live data from Hacker News

Spring Boot Done Right: Lessons from a 400-Module Codebase

medium.com

81–90 of 100 posts

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#81

Earlier quoted context omitted.

Fair enough! Indeed, there are ways to build performant microservices on Java, e.g. Qwarkus + GraalVM, but I've never seen anyone in enterprise world is doing it - 99% of services are still being build on Spring Boot, so in my mind Java in SB are inseparable.

I bet this is happening because in many enterprise applications you do not need high performance. Requirements to a service doing 1000 transactions a day are very different from requirements to a service doing HFT. Service per bounded context may be reasonable choice and Spring Boot/Spring Cloud may be adequate solution for it.

> because in many enterprise applications you do not need high performance

Looking at and having looked at some of their cloud spend etc, nah.

To be more specific there's a lot of fat. Whether that's HFT style high performance is a different story.

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#82
post #81

Earlier quoted context omitted.

I bet this is happening because in many enterprise applications you do not need high performance. Requirements to a service doing 1000 transactions a day are very different from requirements to a service doing HFT. Service per bounded context may be reasonable choice and Spring Boot/Spring Cloud may be adequate solution for it.

> because in many enterprise applications you do not need high performance Looking at and having looked at some of their cloud spend etc, nah. To be more specific there's a lot of fat. Whether that's HFT style high performance is a different story.

You can drop cloud spending by 10x factor and still use Spring Boot comfortably. In startup world exist infra costs benchmarks and they are very generous. That fat does not come from frameworks, it comes from not spending an extra hour on solution design.

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#83

Earlier quoted context omitted.

I hear this a lot from a lot of my coworkers who like Java Spring - they trust Spring to do things right, more than themselves. On the other hand, I hate Java Spring because I feel like I don't trust it - it doesn't let me look into and understand the internals easily, making me feel like I'm afloat on a pile of abstracts I'm not allowed to look down into. Looking at some other projects enterprise js/ts codebases tho…

Spring framework may look complicated only at start, until you get it, but then it becomes quite easy to reason about. OTOH, Spring Boot is a huge pile of various loosely coupled framework connectors, web, queues, security, databases etc. Some of them are of good quality, some are not so good. It is that uneven mix giving the perception that Spring is a mess.

Agreed, Spring Framework is quite simple... just look here - https://vectree.io/c/spring-framework

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#84
post #13
post #2

Hacker news likes to dunk on Spring Boot, but its usage in enterprises is very very high.

I'm not that deep into Java, but I was under the impression that things like Quarkus were starting to replace Spring in enterprise use...

We have a medium sized Quarkus app (~200kLOC) and Quarkus has been fantastic. Startup in JVM mode for our app is around 10 secs. Not blazing fast - but likely much faster than a typical Java enterprise app. I'm sure a few of those secs are spent doing things like pulling authz policies from github or due to having several thousand hibernate entities.

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#85

Earlier quoted context omitted.

Funny how that works - I started with Spring both before and after Boot as well as some Scala. I wouldn’t trade Java / Spring for the world. It forces a coherence, perhaps not perfectly, but it provides guidelines to follow. I’ve been stuck in Node / TypeScript / Microservice hell for most of the last 15 years and I couldn’t hate it more. The open-source ecosystem is extremely lacking, even now, on something like a g…

I hear this a lot from a lot of my coworkers who like Java Spring - they trust Spring to do things right, more than themselves. On the other hand, I hate Java Spring because I feel like I don't trust it - it doesn't let me look into and understand the internals easily, making me feel like I'm afloat on a pile of abstracts I'm not allowed to look down into. Looking at some other projects enterprise js/ts codebases tho…

Mostly just boils down to a Chain-of-Responsibility pattern which is incredibly easy to reason about. Just a way to compose functions.

As far as digging into internal, how often do you look into Express or Rails internals or any other? For me it’s a rare day to need to do so.

Only time I recall having to read Spring source code was when I used their Social Media Auth library sometime in the early 2010s when it was quite a primitive experience.

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#86

Earlier quoted context omitted.

That's a ridiculously extreme example, IME. Having been working with Java for 25+ years, I've never seen anything like that in code written by a shop I worked at, FWIW. And as a corollary I'm about 100% certain that you could find some equivalent extreme case to use as an example to dunk on any language/platform. this is what we mean by "JavaCulture" - java | JVM really wonderful things but the culture is what sets t…

You have worked at some outstanding java shops then! In my experience the article is precisely representative of Java culture even today

Let's not go too far! I've seen some crap code, granted. But for the most part, the crap code I've seen is, I believe, stuff written by people who would have written crap no matter what language they were working in.

That said, I have in fact also had some outstanding and talented colleagues over the years as well. A point that's probably worth reflecting on, so thanks for the reminder.

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#87

Earlier quoted context omitted.

That's a ridiculously extreme example, IME. Having been working with Java for 25+ years, I've never seen anything like that in code written by a shop I worked at, FWIW. And as a corollary I'm about 100% certain that you could find some equivalent extreme case to use as an example to dunk on any language/platform. this is what we mean by "JavaCulture" - java | JVM really wonderful things but the culture is what sets t…

You have worked at some outstanding java shops then! In my experience the article is precisely representative of Java culture even today

I also have 20+ years of experience and haven't seen that type of code either.

I am however struggling to understand an over engineered Rust "micro" service at work. There's no language or framework that is free from this.

Maybe it's because I have not worked in typical enterprise companies?

Spring Boot can be a really quick way to get things done. My current job is not in enterprise, but we use Spring Boot for most of our services, and rarely have issues related to Spring itself. We have micro services handling many transactions per minute and starts up within 10 seconds. The CPU usage is low and decent memory usage, even on the small pod sizes that we use. There are ways to reduce the startup, but we do not have the need. The code is easy to reason about and new hires are productive within a short time.

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#88
post #48
post #26

Earlier quoted context omitted.

it doesn't mean that usage of something being very high is a clever idea. lots of people take meth - so are you gonna take meth too. ```@EnableConfigurationProperties(CasConfigurationProperties.class) @EnableScheduling @ConditionalOnFeatureEnabled(feature = CasFeatureModule.FeatureCatalog.SimpleMFA) @AutoConfiguration @Import({ CasSimpleMultifactorAuthenticationComponentSerializationConfiguration.class, CasSimpleMult…

dude, that is a configuration. it is completely declarative and lives in the best place, near your code, not on some other inaccessible repository. what have you preferred? a json file? a yaml one? I had them, and I find the annotations are more readable than other solutions.

Exactly!

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#89
post #78

Keep in mind that a big part of the configuration complexity of CAS is because of how it's used and customized in the real world. These kinds of infrastructure systems its very common to replace a bunch of the built in functionality with your own classes, and so there's alot of effort put into supporting that use case. I helped build a large open source enterprise financial systems, and most of the deploying orgs use…

[dead]

Re: Spring Boot Done Right: Lessons from a 400-Module Codebase

#90

> What makes the CAS codebase impressive is the discipline of applying all of them consistently, across 400 modules, for years. I think this is the main point. You can write good code in any language following this concept.

That's really the whole thesis. None of the patterns in the article are clever or novel - @ConditionalOnMissingBean has been in the Spring Boot docs since day one. What's hard is getting a team to apply it on every single bean, in every single module, for years, without anyone cutting corners. Discipline scales. Cleverness doesn't.
Post reply on HN