Leveraging Go as a tool.

Cheikh seck
4 min readNov 30, 2021

--

The term "cloud native" is ever-present in today’s tech offerings. It is no coincidence, since the cloud is powering most of the web. We can categorise this shift as the "as a service" product era. Being cloud native requires employing a different set of "tools, services and techniques to build a modern web application." This ranges from hosting solutions, development tools and programming languages. You may be wondering which language(s) can be classified as cloud native? Let’s look at the languages running the cloud today, to determine a proven cloud native language.

2 Big players

Amazon Web Services (AWS) is easily one of the biggest providers in this space, with 32% of market share in Q3 2021. AWS’s backend services were developed with C++, Java and Python. In this case, each language is being leveraged to meet business objectives. With C++ handling certain backend aspects and Python controlling other aspects of their platform. Google Cloud Platform (GCP) has an 8% market share as of Q3 2021. Compared to Amazon, it is difficult to say who is powering more of the web. Market share comes down to revenue, and GCP’s smallest VM will cost you $5/per month. Whereas AWS is the "premium" option. GCP was primarily built with Go. Go has proven itself as a cloud native language with the success of GCP.

Go is a language developed by Google. It was built to "increase the speed of software development." The language has proven itself as the language to build cloud infrastructure on with the development of Docker and Kubernetes. Cloud providers also offer a great deal of support for applications built with Go.

My usage of Go

I've written commands and web services in Go. I ask myself 3 questions to decide which language to go with :

  • What is the deployment target? This is where the program will be ran ultimately. For example, deploying to Android or IOS does not require Go. Deploying to Linux with Go would be ideal, because I can register my binary as a service. Using a service will ensure the binary is launched at boot and restarted if it crashes.
  • Is the program data centric? If so, I’d use Python or R. I’d pick those 2 because both languages have built-in support for managing and analysing large data sets.
  • Will it integrate with the current stack? I usually check for compatibility. Some libraries have better support for databases than others. And yes, you may bridge two applications over a network protocol, but that just opens a new set of security vulnerabilities to mitigate.

Go is my cloud native language. I write in Go due to the small memory footprint, which translates into cheaper hosting costs for me. It’s also simple to cross compile a binary, which is simpler than uploading thousands of files with source code. Compiling one binary will ensure all the required dependencies are included in one executable. This is advantageous because the life cycle of an application differs on the cloud. An application may need to replicate itself at a moment’s notice, and in my opinion, some programming languages do not fit the build to scale quickly. A friend once told me "your application uses a different vm each day on AWS." This is alluding to the fact that cloud providers do not offer VPSs unless requested. As for the absolute cloud native language, it is tough to decide, since most languages can provide similar functionality. I’ve seen PHP Soap server plugins, I can’t even imagine the necessity to build this. I’m not writing this to discredit anyone’s work, but people usually manage to rewrite software for other programming languages. Go has proven itself to me as a useful alternative for building web applications. I deploy one binary with all of my application’s JavaScript, CSS, Images and HTML. This is possible with an "in-memory filesystem," which also has its set of disadvantages. One disadvantage is the size of your RAM will need to be greater than your "in-memory filesystem." It is ideal for me because I don’t need to worry about the environment the web server will run in. I don’t need to decide between using absolute or relative paths to link my web resources. This may not be the issue for other users, and it’ll be tough to point out each individual’s use cases.

Go keeps its promise by offering a simple yet powerful programming language. Powerful because it has concurrency, abstracted memory management, static typing and many more features. Choosing a language should align with a program's objectives. Some stacks just work (ie LAMP), while other combinations of layers feel emulated.

Resources :

If you haven’t read it yet, please have a look at Everyday Golang : gumroad.com/a/529241203/yxQFu

talks.golang.org/2012/splash.article

www.statista.com/statistics/967365/worldwide-cloud-infrastructure-services-market-share-vendor/

--

--

Cheikh seck
Cheikh seck

Written by Cheikh seck

[Beta] Checkout my AI agents: https://zeroaigency.web.app/ Available for hire as a technical writer or software developer: cheeikhseck@gmail.com

No responses yet