Need advice about which tool to choose?Ask the StackShare community!
Go vs Spring Boot: What are the differences?
Go: An open source programming language that makes it easy to build simple, reliable, and efficient software. Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language; Spring Boot: Create Spring-powered, production-grade applications and services with absolute minimum fuss. 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 very little Spring configuration.
Go can be classified as a tool in the "Languages" category, while Spring Boot is grouped under "Frameworks (Full Stack)".
"High-performance", "Simple, minimal syntax" and "Fun to write" are the key factors why developers consider Go; whereas "Powerful and handy", "Easy setup" and "Java" are the primary reasons why Spring Boot is favored.
Go and Spring Boot are both open source tools. Go with 60.5K GitHub stars and 8.37K forks on GitHub appears to be more popular than Spring Boot with 39.8K GitHub stars and 25.8K GitHub forks.
According to the StackShare community, Go has a broader approval, being mentioned in 901 company stacks & 606 developers stacks; compared to Spring Boot, which is listed in 333 company stacks and 615 developer stacks.
We have a lot of experience in JavaScript, writing our services in NodeJS allows developers to transition to the back end without any friction, without having to learn a new language. There is also the option to write services in TypeScript, which adds an expressive type layer. The semi-shared ecosystem between front and back end is nice as well, though specifically NodeJS libraries sometimes suffer in quality, compared to other major languages.
As for why we didn't pick the other languages, most of it comes down to "personal preference" and historically grown code bases, but let's do some post-hoc deduction:
Go is a practical choice, reasonably easy to learn, but until we find performance issues with our NodeJS stack, there is simply no reason to switch. The benefits of using NodeJS so far outweigh those of picking Go. This might change in the future.
PHP is a language we're still using in big parts of our system, and are still sometimes writing new code in. Modern PHP has fixed some of its issues, and probably has the fastest development cycle time, but it suffers around modelling complex asynchronous tasks, and (on a personal note) lack of support for writing in a functional style.
We don't use Python, Elixir or Ruby, mostly because of personal preference and for historic reasons.
Rust, though I personally love and use it in my projects, would require us to specifically hire for that, as the learning curve is quite steep. Its web ecosystem is OK by now (see https://www.arewewebyet.org/), but in my opinion, it is still no where near that of the other web languages. In other words, we are not willing to pay the price for playing this innovation card.
Haskell, as with Rust, I personally adore, but is simply too esoteric for us. There are problem domains where it shines, ours is not one of them.
With Python + Django it was so much faster to create a typical website like this. Using Go would take to long to launch the initial version. For example, Python could handle complex data type with less line of code. Django also has many built-in libraries and a huge ecosystem of libraries that can be easily used to build a feature.
Starting a new company in 2020, with a whole new stack, is a really interesting opportunity for me to look back over the last 20 years of my career with web software and make the right decision for my company.
And, I went with the most radical decision– which is to ignore "sexy" / "hype" technologies almost entirely, and go back to a stack that I first used over 15 years ago.
For my purposes, we are building a video streaming platform, where I wanted rapid customer-facing feature development, high testability, simple scaling, and ease of hiring great, experienced talent. To be clear, our web platform is NOT responsible for handling the actual bits and bytes of the video itself, that's an entirely different stack. It simply needs to manage the business rules and the customers experience of the video content.
I reviewed a lot of different technologies, but none of them seemed to fit the bill as well as Rails did! The hype train had long left the station with Rails, and the community is a little more sparse than it was previously. And, to be honest, Ruby was the language that was easiest for developers, but I find that most languages out there have adopted many of it's innovations for ease of use – or at least corrected their own.
Even with all of that, Rails still seems like the best framework for developing web applications that are no more complex than they need to be. And that's key to me, because it's very easy to go use React and Redux and GraphQL and a whole host of AWS Lamba's to power my blog... but you simply don't actually NEED that.
There are two choices I made in our stack that were new for me personally, and very different than what I would have chosen even 5 years ago.
1) Postgres - I decided to switch from MySql to Postgres for this project. I wanted to use UUID's instead of numeric primary keys, and knew I'd have a couple places where better JSON/object support would be key. Mysql remains far more popular, but almost every developer I respect has switched and preferred Postgres with a strong passion. It's not "sexy" but it's considered "better".
2) Stimulus.js - This was definitely the biggest and wildest choice to make. Stimulus is a Javascript framework by my old friend Sam Stephenson (Prototype.js, rbenv, turbolinks) and DHH, and it is a sort of radical declaration that your Javascript in the browser can be both powerful and modern AND simple. It leans heavily on the belief that HTML-is-good and that data-* attributes are good. It focuses on the actions and interactions and not on the rendering aspects. It took me a while to wrap my head around, and I still have to remind myself, that server-side-HTML is how you solve many problems with this stack, and avoid trying to re-render things just in the browser. So far, I'm happy with this choice, but it is definitely a radical departure from the current trends.
Pros of Go
- High-performance511
- Simple, minimal syntax375
- Fun to write343
- Easy concurrency support via goroutines289
- Fast compilation times261
- Goroutines183
- Statically linked binaries that are simple to deploy173
- Simple compile build/run procedures144
- Backed by google129
- Great community125
- Garbage collection built-in46
- Built-in Testing40
- Excellent tools - gofmt, godoc etc36
- Elegant and concise like Python, fast like C33
- Awesome to Develop28
- Flexible interface system22
- Used for Docker21
- Great concurrency pattern21
- Deploy as executable18
- Open-source Integration17
- Fun to write and so many feature out of the box14
- Its Simple and Heavy duty11
- Easy to read11
- Powerful and simple10
- Go is God9
- Safe GOTOs9
- Easy to deploy9
- Hassle free deployment7
- Rich standard library7
- Concurrency7
- Best language for concurrency7
- Easy setup7
- Used by Giants of the industry6
- Simplicity, Concurrency, Performance6
- Clean code, high performance6
- High performance6
- Single binary avoids library dependency issues6
- Simple, powerful, and great performance5
- Cross compiling5
- Garbage Collection4
- Excellent tooling4
- Very sophisticated syntax4
- Gofmt4
- WYSIWYG4
- Kubernetes written on Go3
- Keep it simple and stupid2
- Widely used1
- No generics0
- Operator goto0
Pros of Spring Boot
- Powerful and handy127
- Easy setup121
- Java111
- Spring83
- Fast79
- Extensible39
- Lots of "off the shelf" functionalities32
- Cloud Solid27
- Caches well21
- Many receipes around for obscure features19
- Modular18
- Productive18
- Integrations with most other Java frameworks17
- Spring ecosystem is great16
- Fast Performance With Microservices16
- Community14
- Auto-configuration13
- Easy setup, Community Support, Solid for ERP apps11
- One-stop shop11
- Easy to parallelize10
- Cross-platform9
- Easy setup, good for build erp systems, well documented9
- Easy setup, Git Integration8
- Powerful 3rd party libraries and frameworks8
- Kotlin2
- It's so easier to start a project on spring2
Sign up to add or upvote prosMake informed product decisions
Cons of Go
- You waste time in plumbing code catching errors38
- Verbose23
- Packages and their path dependencies are braindead22
- Dependency management when working on multiple projects15
- Google's documentations aren't beginer friendly12
- Automatic garbage collection overheads10
- Uncommon syntax7
- Type system is lacking (no generics, etc)6
- Collection framework is lacking (list, set, map)2
Cons of Spring Boot
- Heavy weight18
- Annotation ceremony17
- Many config files needed10
- Java7
- Reactive5
- Excellent tools for cloud hosting, since 5.x4