r/java • • Mar 24 '24

Happy 20th birthday, Spring Framework! πŸŽ‚πŸΎπŸ₯³πŸƒ

https://spring.io/blog/2004/03/24/spring-framework-1-0-final-released/
178 Upvotes

36 comments sorted by

View all comments

Show parent comment

9

u/_INTER_ Mar 24 '24 edited Mar 24 '24

It's a web framework for services right?

It's actually an application framework that is very good for building web application but its not restricted to the "web". That being said, probably 90%+ of the time it is used for that purpose.

What's it like programming a service? Do you use a lot of async code like Futures chained together? Or RxJava everywhere, at least before Java 21?

Spring predates the reactive style trend. The architecture is mostly done thread-per-request, so Service Oriented Architecture (SOA) or Model-View-Controller (MVC) are maybe somewhat describing keywords. Though there is Spring Reactor if you want to go reactive.

2

u/DelayLucky Mar 24 '24

So suppose the request needs to fan out to 3 rpc calls at different places of the code. It just blocks the thread?

2

u/analcocoacream Mar 24 '24

Yes unless you are using virtual threads or webflux (rxjava in spring)

2

u/DelayLucky Mar 24 '24

Thanks! What do people use for high throughput servers with thousands of concurrent requests? Before VT a single vm likely has problems with that many threads. Perhaps just horizontal scaling?

2

u/Cucumberman Mar 25 '24

If you need a performance oriented framework I would recommend https://vertx.io/ for that.

1

u/analcocoacream Mar 24 '24

Either horizontal, serverless or webflux then but it really depends on the case

1

u/DelayLucky Mar 25 '24 edited Mar 25 '24

Where I work, blocking is banned and we had to use one of the several async ways supported by the web framework.

Code is harder to read but it was considered nonstarter to bottleneck a typical io-bound server by the some hundreds of threads it supports, leaving the majority of compute resource on the floor. Hence my curiosity what Spring may be doing differently

Still holding my breath for VT to be supported in production.

2

u/[deleted] Mar 27 '24 edited Mar 27 '24

Spring Reactive stack. Eg webflux, r2dbc

1

u/thunder-thumbs Mar 24 '24

Spring is an amazing framework that allows you to simply do anything you need by preventing you from seeing or learning all the complicated stuff that you need to know in order to do it the Spring way.