When it comes to migration, there are a lot of case studies that why companies are migrating from Python to Go. You can find a list of companies that are using Golang.
But here are the case studies of 3 companies that I want to show you why they have migrated from Python to Golang.
- Stream
- Salesforce
- Khan Academy
Before showing you the case studies of the companies, first, discuss which problem Golang solves.
Go (programming language)
Go (also called Golang or Go language) was designed by taking inspiration from the productivity and relative simplicity of Python, with the ability of C. Some of the problems that Go addresses are slow build time, uncontrolled dependencies, effort duplication, difficulty in writing automatic tools, and cross-language development.
Go works by using "goroutines," or lightweight processes, which allows further efficiencies. Go also uses a collection of packages for efficient dependency management.
1. Stream Case Study
Stream is the SAAS company that provides paid APIs that powers chat messaging and activity feeds that can scale to billion of users.
In one of their article titled "Why we switched from Python to Go", they discussed 9 reasons for their migration from Python to Golang.
One of the reasons they stated about the performance of Python is:
We’ve been optimizing Cassandra, PostgreSQL, Redis, etc. for years, but eventually, you reach the limits of the language you’re using. Python is a great language but its performance is pretty sluggish for use cases such as serialization/deserialization.
They also stated the productivity of Golang by saying:
Go forces you to stick to the basics. This makes it very easy to read anyone’s code and immediately understand what’s going on.
Although they discussed some of the disadvantages also like error handling, lack of frameworks, etc but they overall liked Golang and now using it.
2. Salesforce Case Study
Before we start with why Golang was chosen by Salesforce for Einstein Analytics let us understand what is “Einstein Analytics”
What is Einstein Analytics?
Salesforce launched Einstein Analytics in 2017. Einstein Analytics is the application that visualizes all the activities that occur in your Salesforce environment. Whatever may be the use-case of Salesforce, the visibility tool helps you with insights into the information of your users added to CRM every day like accounts, contact, campaign, etc.
Before Salesforce launched Einstein Analytics, the query engine and dataset creation tools that eventually became Einstein Analytics were written in C "for performance" and a Python wrapper that provided functionality like parsing queries, and a REST API server.
The salesforce principal architect Guillaume Le Stum explains.
Python is great for quickly writing higher-level applications but doesn't always deliver the high performance needed at an enterprise level. C creates highly performant executables, but adding features takes a lot more time.
Go, on the other hand, is built for huge applications suitable for Google's production systems. So Salesforce decided to shift Einstein Analytics from a hybrid C-Python application to a completely Go application.
3. Khan Academy Case Study
Another company is the Khan academy which is a non-profit organization providing courses on various subjects. It has 7+ million subscribers on its YouTube channel.
Back on MAY 13, 2021, they posted an article titled "Half a million lines of Go" in which they wrote half a million lines of code in Golang.
They stated in their article by saying:
When we started Goliath, no one on the team knew Go beyond the experiments we ran to validate that Go would be a better choice for us than our other options. Today, all of our backend and full-stack engineers write Go, and our incremental delivery of Goliath has vaulted us over a big milestone: More than 500,000 lines of Go now running in production. This seemed like a good point to reflect on Go itself.
Further down the line, they liked the performance and concurrency of Golang by stating:
Coming from Python (Python 2, no less), we have found Go’s performance to be excellent. We are doing as close to a 1:1 port as possible from Python to Go, while still ending up with something Go-like at the end, rather than code that looks like Python-in-Go. In the process, we’re explicitly not prioritizing performance work, unless there’s a real regression.
Dangoor's team is also demanding generics in Go. by saying that
Most of the time, writing Go code without generic types is fine. Most of the time, but there are plenty of times when we’ve been writing internal library code or even just working with slices when we felt their absence.
The problem is solved. The Go team in their 1.18 release enabled generic programming, which would allow developers to write functions and data structures.
This article is published for the Hashnode #blogswithcc
challenge.
Follow me on YouTube, Twitter, and LinkedIn.
Thank you!