像 Dropbox 这样从 Python 转到 Go 语言是不是新的趋势?
为了更好的后端效能,Dropbox 一年前便开始从 Python 转到 Go.
> Dropbox owes a large share of its success to Python, a language that enabled us to iterate and develop quickly. However, as our infrastructure matures to support our ever growing user base, we started exploring ways to scale our systems in a more efficient manner. About a year ago, we decided to migrate our performance-critical backends from Python to Go to leverage better concurrency support and faster execution speed. This was a massive effort–around 200,000 lines of Go code–undertaken by a small team of engineers. At this point, we have successfully moved major parts of our infrastructure to Go.
Source: Open Sourcing Our Go Libraries
回复内容:
看来回答问题的多是程序员。我从一个前运维人员的角度提供一下思路。Go从设计上就已经偏向工程化,对自动集成、部署和运维都相当友好。
当资源限制已经不再局限于一台或一组服务器后,偏工程化的编程语言会开始显现出更大的威力。
设备水平扩展的速度越快,对运维不友好的编程语言的弱点会被放大得越明显。 go本来是想吸引c++程序员,结果反而是Python程序员转go的比较多。
Python 的生态比go成熟,这在早期可以节约开发时间,但项目进行到后期阶段,项目会越来细化,复杂度会越来越高,省的开发时间就不明显了。这时候架构或性能这样的其它需求就出来了。详细情况下文有描述:
“这背后大约是200,000(二十万)行Go语言代码。此时,我们成功地把架构的大部分迁移到了Go语言。”
This was a massive effort–around 200,000 lines of Go code–undertaken by a small team of engineers. At this point, we have successfully moved major parts of our infrastructure to Go.
Dropbox 开源其 Go 语言库
另外最近node.js里express的作者TJ Holowaychuk最近也转向了golang
ExpressJS作者弃用Node.js,转向Go语言
这两个标志性事件应该会加速python和node.js 程序员向golang的转移。
附:python之父在dropbox,dropbox也是python的标杆案例之一。
tj是node.js开源社区贡献量最大的人,没有之一。
在github平台上,他的followers排在第三位,第一是linus.
=================================================================
徐酿泉,底层不熟
如果一个项目越来越大,正常而言会越来越模块化接口化,把一个性能要求高的模块重写一下算什么大事……
回复如下:
python这边使用go重构的是架构模块20多万行代码,不是仅仅性能提升。写过项目的都应该知道架构是什么意思。都应该知道架构的重要性。 估计Python程序员嫌Python太慢,又喜欢被逼着遵循特定的排版规范,所以都转向go了。
可以预见接下来go社区里会就缩进一个tab还是4个空格的问题爆发一场圣战 这个问题我要答,不邀自答。
- 先回答题目:是一种新的趋势,全世界都在往更“现代化”的编程语言转型,包括转到 go 以外的其它新语言。
- go 很难吸引到 c++ 程序员,在 c++ 程序员看来这货有点“半残”的样子,用起来难免觉得自己智力过剩。rust 更受他们欢迎,看看 rust 的第一个应用社区居然是 rust-gamedev 就知道了。
- @李四保 说得对,go 很符合 python 程序员的习惯、审美,而且同样不能利用多核,简直就是 python+gevent 的加强版。如果我不是 c++ 程序员出身,我也会喜欢的。
- 但 @柳杰 说“golang 天生就适合服务器端开发”,我表示不认同。go 的字符处理能力个人表示呵呵,做 web 开发的人甘苦自知;没有泛型支持,处理复杂的业务逻辑(如 game play)更要表示呵呵。
- dropbox 使用 go 的做法是对的:1、写性能相关的代码,如 hash2;2、写业务逻辑简单的代码,如 net2、caching 等。知其长,避其短,用得老道。
- 以上是个人愚见,欢迎探讨。但是请认识到个人是 go 黑,立场可能有偏颇。
最讨讨厌盲目跟风的 dropbox用户量已经巨大,需要更智能的语言来帮助处理复杂的分布式问题 不会只是python, golang天生就就适合服务器端开发,我们实际使用下来也比较满意,个人认为未来会成为服务器端的主流语言之一。
目前,肯定会有很多脚本语言开发的项目用golang重写,虽然golang比脚本语言要增加一些开发工作量,但性能会提高好几倍。
c/c++项目基本不会用golang重写,因为与之相比,golang性能上没有优势。开发新的项目时才会考虑用golang替代。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Python is widely used in the fields of web development, data science, machine learning, automation and scripting. 1) In web development, Django and Flask frameworks simplify the development process. 2) In the fields of data science and machine learning, NumPy, Pandas, Scikit-learn and TensorFlow libraries provide strong support. 3) In terms of automation and scripting, Python is suitable for tasks such as automated testing and system management.

You can learn basic programming concepts and skills of Python within 2 hours. 1. Learn variables and data types, 2. Master control flow (conditional statements and loops), 3. Understand the definition and use of functions, 4. Quickly get started with Python programming through simple examples and code snippets.

It is impossible to view MongoDB password directly through Navicat because it is stored as hash values. How to retrieve lost passwords: 1. Reset passwords; 2. Check configuration files (may contain hash values); 3. Check codes (may hardcode passwords).

As a data professional, you need to process large amounts of data from various sources. This can pose challenges to data management and analysis. Fortunately, two AWS services can help: AWS Glue and Amazon Athena.

The steps to start a Redis server include: Install Redis according to the operating system. Start the Redis service via redis-server (Linux/macOS) or redis-server.exe (Windows). Use the redis-cli ping (Linux/macOS) or redis-cli.exe ping (Windows) command to check the service status. Use a Redis client, such as redis-cli, Python, or Node.js, to access the server.

To read a queue from Redis, you need to get the queue name, read the elements using the LPOP command, and process the empty queue. The specific steps are as follows: Get the queue name: name it with the prefix of "queue:" such as "queue:my-queue". Use the LPOP command: Eject the element from the head of the queue and return its value, such as LPOP queue:my-queue. Processing empty queues: If the queue is empty, LPOP returns nil, and you can check whether the queue exists before reading the element.

Question: How to view the Redis server version? Use the command line tool redis-cli --version to view the version of the connected server. Use the INFO server command to view the server's internal version and need to parse and return information. In a cluster environment, check the version consistency of each node and can be automatically checked using scripts. Use scripts to automate viewing versions, such as connecting with Python scripts and printing version information.

Navicat's password security relies on the combination of symmetric encryption, password strength and security measures. Specific measures include: using SSL connections (provided that the database server supports and correctly configures the certificate), regularly updating Navicat, using more secure methods (such as SSH tunnels), restricting access rights, and most importantly, never record passwords.
