So what is Go?

Go is Google’s second open source programming language released in 2009. The Go language is optimized for programming applications on multiprocessor systems, and programs compiled using Go can be as fast as C or C++ code, while being more secure and supporting parallel processes.

Go as the most popular server-side development language in recent years, because of its low learning threshold, high development efficiency, quickly occupy the major companies in the field of server-side development!

What are the big advantages of the Go language?

Go has three advantages:

Simple deployment: The Go compilation produces a static executable with no external dependencies other than glibc. This makes deployment extremely convenient: only a basic system and necessary management and monitoring tools are required on the target machine, and there is no need to worry about the dependencies of various packages and libraries required by the application, greatly reducing the burden of maintenance. This is a huge difference from Python. For historical reasons, the Python deployment tool ecosystem is quite messy (setupTools, Distutils, PIP, buildout for different applications and compatibility issues). The official PyPI source often had problems and required a private image to be built, which took a lot of time and effort to maintain.

Good concurrency:

Goroutine and Channel make it fairly easy to write highly concurrent server-side software, in many cases without having to worry about locking and all the problems that come with it. A single Go application can also effectively utilize multiple CPU cores and perform well in parallel. This is a far cry from Python. Multi-threaded and multi-process server programs are not easy to write, and due to the global locking of the GIL, multi-threaded Python programs can not effectively use multi-core, can only be deployed in multi-process mode; Using the Multiprocessing package in the standard library will also create a lot of monitoring and management challenges (we use the Supervisor to manage processes, which does not support fork). Python applications are usually deployed with one application per CPU core, which causes a lot of waste of resources. For example, if a Python application needs 100MB of memory after being started, and the server has 32 CPU cores, Leaving one core on the system and running 31 copies of applications wastes 3GB of memory resources.

Excellent performance:

While not as good as C and Java, it is usually an order of magnitude higher than native Python applications and suitable for writing some bottleneck business. The memory footprint is also very low.

Go is the future of server-side development!

To learn Go well, you must master the best practice of Go language theory and application, high concurrency server development experience, massive log system architecture design and practice, high concurrency buying system architecture design and practice.