When to use Golang over Python for web app backend?
To be honest if it's a personal project for fun i'd write it in whatever language you are trying to learn, if it a project for a customer/work/etc I would write it in the language I am better able to maintain and be productive in.
Will Go likely process more requests for the same amount of CPU/memory allocation? Surely!
Will python bottleneck your personal project ? Probably not. People have used python and ruby to build amazingly large scaled websites and APIs!
There isn't a number of users that will be the tipping point since much of it depends on what your app is doing and if your database will collapse first.
I would write it in Go personally, because that is what I am writing my backend APIs in right now. If you asked on a clojure forum or C++ forum you'd probably get answers advocating for those languages too.
More on reddit.comShould I choose Golang or Python for backend development?
Should I learn Go, NodeJS, or stick with Python for backend web development?
When should I use golang in web programming?
Is Golang better than Python?
Golang is slightly better than Python in terms of execution speed. But Python’s simplicity allows a faster development procedure that can be done by the developers.
Which is fast- Golang or Python?
Which one is easy to learn- Python or Golang?
Videos
A friend of mine told me I should write the backend of my booking app in Go instead of Python (using Django). Is this sound advice? I've heard Go is much more scalable. At how many users does this make a difference? What else should I consider?
To be honest if it's a personal project for fun i'd write it in whatever language you are trying to learn, if it a project for a customer/work/etc I would write it in the language I am better able to maintain and be productive in.
Will Go likely process more requests for the same amount of CPU/memory allocation? Surely!
Will python bottleneck your personal project ? Probably not. People have used python and ruby to build amazingly large scaled websites and APIs!
There isn't a number of users that will be the tipping point since much of it depends on what your app is doing and if your database will collapse first.
I would write it in Go personally, because that is what I am writing my backend APIs in right now. If you asked on a clojure forum or C++ forum you'd probably get answers advocating for those languages too.
When it comes to scalability of a web backend there is more at play than just the language you use. If you're comfortable with Go then sure go ahead and use it, but if you have a better understanding of Python then you'll be more productive in that.
If this app is something you're doing in your free time as a hobby, then sure you could go ahead and write it in Go as an educational exercise. The learning curve may be steep though as you get to grasp with the idioms of Go.
Below are some libraries that could help you with building a web app in Go:
-
gorilla/mux - Routing
-
gorilla/schema - Parsing form data into structs
-
jmoiron/sqlx - Parsing SQL row data into structs
When it comes to ORMs in Go most people recommend gorm, personally I've had better experience with query builders, something I've written about before.
I am not liking JS/TS with express or Nest for backend. I think its better to use it for frontend only.
I have been thinking to opt python for backend like writing APIs and my future plan is to work on cloud and data engineering, probably more cloud. I have seen many videos on YT and read a few posts on reddit but its not clear whether I should choose python or golang based on my future plans. I have no plans for AI btw.
Please share your thoughts on this as I am very confused. Also I believe that if someone is comfortable with golang, he/she should be doing golang and same goes for python. I am comfortable with both. I tried golang and i felt comfortable.
I need to decide based on the market needs and future requirements in the industries and stick to it, not roaming around for days on what to choose. It feels so depressing not land on a language for sure.
Few people says the companies are moving from python to golang, python is much slower, you need imported libraries and in golang these are not an issue. Golang is better in terms of building cloud applications blah blah….
What should I do? Maybe after a few discussions and guidance from the well experienced developers I will be confident on either python or golang.