A question !

236 views
Skip to first unread message

Motaz Hejaze

unread,
Jan 4, 2020, 6:28:24 PM1/4/20
to golang-nuts
Hello Guyz , 
This is Hejaze from Egypt
Currently i wok as a python django web developer
I am new to Golang and i want to ask you guys with experience 

1 - Is there really a big performance ( speed ) difference between using Python OR Golang in backend web development ? 
2 - What is the fastest resource to learn Golang ( efficiently ) ?
3 -  What is the ( best and most secured ) web framework for building a high traffic web services with Golang ?
4 - I know that go comes with builtin web server , is it reliable for production ? or shall we connect go with classic web servers aka ( nginx , apache ) ?
5 - What do you think about future job demands regarding Golang , i mean will take a decent share of job requests ?

Thanks and i hope you all be patient with my questions 

Justin Israel

unread,
Jan 4, 2020, 11:41:30 PM1/4/20
to golang-nuts


On Sunday, January 5, 2020 at 7:28:24 AM UTC+13, Motaz Hejaze wrote:

1 - Is there really a big performance ( speed ) difference between using Python OR Golang in backend web development ? 

There are a number of reasons why Go could out-perform Python when comparing django to a Go web backend. 
Firstly, in order to scale django across multiple cores on the same host, one generally deploys a python web framework under uwsgi which handles spawning multiple instances of the application and load balancing th request. Python is effectively single threaded because of the GIL so this is the solution for production python web servers. 
Go on the other hand can use all of the cores with just a single process and can be deployed directly. 

Aside from that, there could be other areas where Go performs better, depending on what your application is doing, because it is compiled and uses static types as opposed to python being interpreted and constantly using reflection. One can mitigate some of these performance issues with compiled python extensions. But again, it depends
 
4 - I know that go comes with builtin web server , is it reliable for production ? or shall we connect go with classic web servers aka ( nginx , apache ) ?

The stdlib web server is production grade and can be used to deploy the binary directly without the need for a proxy.
But the use of a proxy can still be valid for situations where you want load balancing, static file caching, or TLS terminatation, as a few examples. 
 

robert engels

unread,
Jan 4, 2020, 11:51:52 PM1/4/20
to Justin Israel, golang-nuts
Please everyone just benchmark this page https://www.techempower.com/benchmarks/

Rant ON... Python is not suitable for any high volume server application. It is designed for simple scripting. Rant OFF.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/f9e386d9-007a-4b1e-8841-474e098fbfeb%40googlegroups.com.

robert engels

unread,
Jan 5, 2020, 12:25:00 AM1/5/20
to Justin Israel, golang-nuts
Well, don’t benchmark it, bookmark it :)

Michael Ellis

unread,
Jan 5, 2020, 3:59:01 AM1/5/20
to golang-nuts
I came to Go from 10+ years of Python (and 20 years of C before that).  Go By Example was the online resource I found most useful in first few weeks of learning the language.  I also highly recommend getting a copy of The Go Programming Language and working your way through the chapters.  

For specific questions, this forum and Stack Overflow are both excellent.

Finally, it's been my experience that actually getting things done in any language comes down to mastery of its standard library. Plan to spend a lot of time in https://golang.org/pkg/.

Good luck in your journey!

Prabhu Chawandi

unread,
Jan 5, 2020, 5:06:05 AM1/5/20
to Michael Ellis, golang-nuts
Once you have little hands-on,  https://medium.com/golangspec is a great place to read.   

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.


--
Cheers
p.

Amnon Baron Cohen

unread,
Jan 5, 2020, 10:20:55 AM1/5/20
to golang-nuts

> 1 - Is there really a big performance ( speed ) difference between using Python OR Golang in backend web development ? 
Python suffers from poor performance, so moving to Go should give you a speedup of  well over an order of magnitude.
(See https://www.techempower.com/benchmarks/ for example benchmarks).

> 2 - What is the fastest resource to learn Golang ( efficiently ) ?

> 3 -  What is the ( best and most secured ) web framework for building a high traffic web services with Golang ?

I, personally, would probably start with the standard library. 

> 4 - I know that go comes with builtin web server , is it reliable for production ? or shall we connect go with classic web servers aka ( nginx , apache ) ?
The built-in web server in net/http is production grade, both in terms of performance, security and functionality.

Just one pedantic nit-pick. People call the language "Go" and not "Golang".

Best of luck, and enjoy!



Jake Montgomery

unread,
Jan 5, 2020, 4:56:43 PM1/5/20
to golang-nuts
Welcome Motaz!

This might be slightly OT from your question, but one big benefit of Go over Python for production code is that go is statically typed, and strongly typed. This may feel like a shackle at first, but it eliminates a whole universe of bugs, the kind that can strike without warning and are difficult to test for. Using Python for critical services always makes me nervous for that reason alone.

-Jake

On Saturday, January 4, 2020 at 1:28:24 PM UTC-5, Motaz Hejaze wrote:

Brian Candler

unread,
Jan 5, 2020, 6:48:43 PM1/5/20
to golang-nuts
Another advantage is that a single compiled binary is easy to deploy - without needing to set up a virtualenv, install dependent libraries, having to deal with different versions of python etc.

anderson...@blacklane.com

unread,
Jan 6, 2020, 8:57:12 AM1/6/20
to golang-nuts
2 - What is the fastest resource to learn Golang ( efficiently )

For me the best thing was Effective Go https://golang.org/doc/effective_go.html
Helps to understand "the go way"of coding and the main characteristics of the language

Motaz Hejaze

unread,
Jan 7, 2020, 9:44:28 AM1/7/20
to anderson...@blacklane.com, golang-nuts
Thank you all guys for your help..

May i ask what is the best deployment for more performance ?? 

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

David Riley

unread,
Jan 7, 2020, 2:49:04 PM1/7/20
to Motaz Hejaze, anderson...@blacklane.com, golang-nuts
On Jan 7, 2020, at 04:44, Motaz Hejaze <trapp...@gmail.com> wrote:
>
> 
> Thank you all guys for your help..
>
> May i ask what is the best deployment for more performance ??

I’m not quite sure what you mean. Do you mean what environment results in the highest-performing Go programs? I’d imagine the s390x architecture represents the biggest hammer, but it’s not one I’d suggest unless you know you need it.

Running on OS X and Linux (on any supported architecture) will likely yield the best mix of performance and pleasant development experience. But Go runs fine (modulo certain low-level compatibility issues) on Windows, FreeBSD, NetBSD, OpenBSD and a variety of other systems as well.

Deploying for production will likely be easiest with Docker containers or the like, albeit at the normal (relatively small, mostly) performance costs associated. You can deploy directly as a regular application, with all the associated maintenance issues that may involve.

What is the angle of your question?

Amnon Baron Cohen

unread,
Jan 7, 2020, 3:24:56 PM1/7/20
to golang-nuts


On Tuesday, 7 January 2020 09:44:28 UTC, Motaz Hejaze wrote:

May i ask what is the best deployment for more performance ?? 


Do whatever is easiest. If you have come from the Python/Django world 
then you will be blown away by Go's speed, whatever deployment you use.
I would also use the standard library's built in web-server rather than proxying 
behind nginx. 

A big benefit of Go's improved speed is that you can stop worrying about performance.

Motaz Hejaze

unread,
Jan 7, 2020, 11:57:09 PM1/7/20
to Amnon Baron Cohen, golang-nuts
Thank you guys for your help,
But do to lake of learning resources for golang , i decided flto go for node.js in my startup project , thank you all

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages