Translation of an article from Basecamp’s official blog (creators of Ruby on Rails) about how Go is used in their company.Basecamp is a company totally tied to Ruby. All our client applications are written in Ruby on Rails, we use Ruby to automate using Chef, we deploy using Ruby through Capistrano, and for almost any task you will find a Ruby script here that does this work.
At the same time, more and more, the Go language has taken its place among our backend services and infrastructure in various ways.
')

- Our daemon for getting and storing data was rewritten from Ruby to Go in January 2013
- Our Ruby build scripts build new Ruby packages on our servers using Docker
- Our log parsing and storage system writes to Kafka, HDFS and HBase using a set of Go programs
- We back up our DNS records from Dynect with a utility written in Go.
- We keep a multi-master installation of Nagios using utilities on Go
- We support our GitHub post commit hooks using the Go program.
- The server part of our tracking system, which monitors users and page views in real time, is completely written in Go.
- We regularly download, decrypt and verify the integrity of our database backups using the Go program.
At the same time, there are many more experiments on Go that have not yet been produced: production support for several memcached instances in sync from package dumps (?), Campfire feedback via web-based tools, packaging of our Rails applications to docker containers and others. We are also very actively using third-party Go applications (
etcd and
sentinel ), which provide us with a file server between data centers.
Our use of Go is very natural. We did not sit down one day and did not decide - let's use it. People just took and started writing new things on Go.
Personally, I like Go thanks to the semantics of channels and gorutin, which are very convenient for programs that process data, and the performance inherent in Go programs means that I don’t need to worry that my parser will heavily load the server. In the language itself, it is very pleasant to write code — simple syntax, an excellent standard library, easy to refactor. I asked some of our people why they like Go:
Will : Go is a great find for Ops tasks. Error handling is very natural to fit into the way I want to write system software, and at the same time the code is able to effectively use multi-core, and makes it better and better with each release. It is also very simple, and where I used to think about how to package dependencies and configure Ruby versions, now I can just fill in the binary
Taylor : When you learn a new programming language, sooner or later a moment comes when you try to solve a real problem and thereby deepen your knowledge of the language and its strengths. Go's excellent documentation, ease of testing and deployment (compile once and run one binaries anywhere) even allow a beginner to write productive and reliable software from almost the very beginning. Where you can spend hours debugging a multithreading bug in your Ruby program, you can spend minutes rewriting it on Go using channels that just work here. And even for simple scripts that need competitiveness, this is a huge gain.
Of course, you are unlikely to ever see the Basecamp variant completely rewritten on Go, but Go has definitely taken a firm place in our infrastructure, and is unlikely to leave it.
If you have never tried Go,
try it today!