Go for Cloud & Network Services
Go helps enterprises build and scale cloud computing systems
As applications and processing move to the cloud, concurrency becomes a very big issue. Cloud computing systems, by their very nature, share and scale resources. Coordinating access to shared resources is an issue that impacts every application processing in the cloud, and requires programming languages “explicitly geared to develop highly reliable concurrent applications.”
Go was created to address exactly these concurrency needs for scaled applications, microservices, and cloud development. In fact, over 75 percent of projects in the Cloud Native Computing Foundation (CNCF) are written in Go.
Go makes it very easy to scale as a company. This is very important because, as our engineering team grows, each service can be managed by a different unit.
Service developers often make a tradeoff between development cycle time and server performance. Go helps reduce the need to make this tradeoff, with its fast build times that enable iterative development, lower memory and CPU utilization. Servers built with Go experience instant start up times and are cheaper to run in pay-as-you-go and serverless deployments.
Go addresses many challenges developers face with the modern cloud, delivering standard idiomatic APIs, and built in concurrency to take advantage of multicore processors. Go’s low-latency and “no knob” tuning make Go a great balance between performance and productivity - granting engineering teams the power to choose and the power to move.
Featured Go users & projects
Google Cloud is built on Go. Many critical cloud projects used across the industry like Kubernetes, Istio and gVisor were created in Go at Google Cloud. Go is fully supported on Google Cloud across all APIs and runtimes including serverless App Engine, Knative, Cloud Run, and Google Cloud Functions.
Capital One uses Go to power the Credit Offers API, a critical service. The engineering team is also building their serverless architecture with Go, citing Go’s speed and simplicity, and mentioning that “[they] didn’t want to go serverless without Go.”
Dropbox was built on Python, but in 2013 decided to migrate their performance-critical backends to Go. Today, most of the company’s infrastructure is written in Go. Dropbox libraries can be found at Dropbox’s Go github.
MercadoLibre uses Go to scale its eCommerce platform. Go produces efficient code that readily scales as MercadoLibre’s online commerce grows. Go improves their productivity while streamlining and expanding MercadoLibre services.
Twitch uses Go to power many of its busiest systems that serve live video and chat to millions of users.
The New York Times adopted Go “to build better back-end services”. As the usage of Go expanded with in the company they felt the need to create a toolkit to “to help developers quickly configure and build microservice APIs and pubsub daemons”, which they have open sourced.
Uber uses Go to power several of its critical services that impact the experience of millions of drivers and passengers around the world. From their real-time analytics engine, AresDB, to their microservice for Geo-querying, Geofence, and their resource scheduler.
How to use Go for Cloud Computing
Go’s strengths shine when it comes to building services. Its speed and built-in support for concurrency results in fast and efficient services, while static typing, robust tooling, and emphasis on simplicity and readability help build reliable and maintainable code.
Go has a strong ecosystem supporting service development. The standard library includes packages for common needs like HTTP servers and clients, JSON/XML parsing, SQL databases, and a range of security/encryption functionality, while the Go runtime includes tools for race detection, benchmarking/profiling, code generation, and static code analysis.
The major Cloud providers (GCP, AWS, Azure) have Go APIs for their services, and popular open source libraries provide support for API tooling (Swagger), transport (protocol buffers, gRPC), monitoring (OpenCensus), Object-Relational Mapping (gORM), and authentication (JWT). The open source community has also provided several service frameworks, including Go Kit, Go Micro, and Gizmo, which can be a great way to get started quickly.
Two popular Go tools for cloud computing include Docker and Kubernetes:
Docker is a platform-as-a-service that delivers software in containers. Containers bundle software, libraries, and config files, are hosted by a Docker Engine, and are run by a single operating-system kernel (utilizing less system resources than virtual machines).
Cloud developers use Docker to manage their Go code and support multiple platforms, as Docker supports the development workflow and deployment process. “Docker can help us to compile Go code in a clean, isolated environment,” writes Jérôme Petazzoni, founder of Tiny Shell Script. “To use different versions of the Go toolchain; and to cross-compile between different operating systems and platforms.”
Kubernetes is an open-source container-orchestration system, written in Go, for automating web app deployment. Web apps are often built using containers (as noted above) packaged with their dependencies and configurations. Kubernetes helps deploying and managing those containers at scale. Cloud programmers use Kubernetes to build, deliver, and scale containerized apps quickly—managing the growing complexity via APIs that controls how the containers will run.
Go books for cloud computing
Building Microservices with Go
Hands-On Software Architecture with Golang
Building RESTful Web services with Go
Mastering Go Web Services
- go-kit, a programming toolkit for building microservices (or elegant monoliths) in Go
- go-micro, a framework for microservice development
- nytimes/gizmo, a microservice framework from The New York Times
- go.uber.org/yarpc, a microservice framework from Uber
Cloud client Libraries
- cloud.google.com/go, Google Cloud Client Libraries for Go
- aws/client, AWS SDK for Go
- alibaba-cloud-sdk-go/sdk, Alibaba Cloud SDK for Go
- Azure/azure-sdk-for-go, Azure SDK for Go
- IBM-Cloud/bluemix-go, IBM Cloud SDK for Go
- heroku-go/v5, Heroku client library
- go-swagger, a simple and powerful representation of RESTful APIs
- emicklei/go-restful, create REST-style services without magic
- golang/protobuf, Go support for Google’s protocol buffer
- grpc-go, a high performance, open source, general RPC framework
- master/opencensus.go, a set of libraries for collecting application metrics and distributed traces
- jinzhu/gorm, an ORM library for Go
- dgrijalva/jwt-go, a Go implementation of json web tokens
- lileio/lile, quickly create RPC base services