Go for DevOps, Go for Microservices, and what Go is Actually Good For

Why 'Go' is perfect for DevOps

Why 'Go' is perfect for DevOps

In this article, we will see why Go is becoming more famous and important in the world of software development, especially when it comes to DevOps.

In this article, we will see why Go is becoming more famous and important in the world of software development, especially when it comes to DevOps.

Go has been the go to language when it comes to cloud and DevOps. The article describes why 'Go' is perfect for DevOps.

Go, the open-source programming language, began in-house at Google approximately ten years ago. Today, it is gaining massive popularity as the language of the future. In this article, we will see why Go is becoming more famous and important in the world of software development, especially when it comes to DevOps.

Go was created by several skilled engineers - namely Ken Thompson, Rob Pike, and Robert Griesemer - who worked on some notable projects previously. The first version of Go language was open to the public in 2009, and version 1.0 was released in 2012.

Let us take a deep dive and see why everyone is gaga over Go.

Where is Go Going?

Let us head over to Google trends and see how Go is performing globally over the past five years in terms of search interest on Google (web searches). As we see, it is up and growing steadily.

HackerRank's 2019 developer skills report revealed that Go is the #1 language developers want to learn for the second year running. Also, the fraction of people who know Go grew to 8.8% (45% YoY).

According to the Hired 2019 State of Software Engineers Report, Go is the #1 in-demand programming language.

According to the 2019 Dice Salary Survey, Go stands in the #1 place in the top-paying tech skills of 2019.

The Go Developer Network spreads across 44 countries, 140 groups, 66962 members as of today. Yes it is growing day by day.

Go is also the fastest growing language on GitHub in Q1 of 2019. Go has grown almost 8% overall with a 0.7% change from the previous Quarter.

What Makes Go so Good for DevOps?

According to Google, Go was designed to make programming easy. Its creators focused on speed of compilation, orthogonality of concepts, and the need to support features such as concurrency and garbage collection. Don't be shocked - even your favorite tools like Kubernetes, Docker, and many others are written in Go.

Joe Beda, the creator of Kubernetes, writes about why Kubernetes is written in Go.

Go is excellent for working in environments where you can’t or don’t want to install dependencies since it compiles into a stand-alone binary. Without having to get the whole environment set up, you can get things done in a much faster way than with other programming languages.

It is a language that is meant to be fast on the web. Google and many other companies back it, it is always improving, and it is here to stay. And it bears repeating: Go is simple to understand, which makes it easier for testers and developers to read the code and collaborate better. Even if you get a new member on your team, they will quickly understand the code in a few days.

Derek Collison's bold prediction made many cloud enthusiasts take a special interest in Go.

Tobi Lütke, the CEO of Shopify, stated that Go is** **going to be the dominant language for server work.

TheNewStack Survey revealed that, it will mostly be DevOps people who like to use Go more in the future.

Features that Make DevOps People Like Go

  1. Simple, Reliable and Efficient
  2. Open Source
  3. Fast Compilation and Execution
  4. Import-Defined Dependencies
  5. stdlib - Wisely composed packages that are useful
  6. Error Handling Capacity
  7. One Binary to Rule them All
  8. Cross-Compilation
  9. Garbage Collection
  10. Readability
  11. Builtin Testing
  12. Profiling

Famous DevOps Tools Written in Go

Go is Excellent for Microservice-based Architectures

Say you have a monolithic architecture and thousands of lines of code. Finding the mistake that is causing the system to break is a huge task, and this is where the Microservices concept was introduced.

A microservices architecture breaks an application down into smaller applications. It then segments them by logical domains, making them independent elements so that we can easily track down which component is causing the error when something goes wrong.

**But again, why Go is good for Microservices? Why? **


Go especially is well-suited to modern computing, particularly when it comes to cloud and microservices architectures. Scalability is a major issue in modern software and cloud-native development. Having several microservices isn't such a big deal. But what will happen when your system consists of thousands of them? Concurrency becomes vital, and Go plays a significant role here.

Originally published by Pavan Belagatti at https://www.freecodecamp.org## Successful Early Go Use Cases

Go at CloudFlare

Railgun, a significant software at CloudFlare, makes extensive use of goroutines and channels. Goroutines handle both the multiplexed Internet connections, and the concurrency feature of Go was then realized and adopted by CloudFare very early around 2012.

Go at SoundCloud

SoundCloud made use of Go features like static typing and fast compilation to do near-realtime static analysis and unit testing during the development phase. This also implies that building, testing, and rolling out Go applications through their deployment system is as fast as it gets.

Go at BBC

A lead Dev confirmed in his Quora answer that BBC is using Go. He answered saying they had a great success running Go in production since 2013. Some of their older systems have been running for over one year without a problem and they run approximately 10+ Go applications over 50+ nodes in AWS (the answer captured on July 2015).

Go at Bitly

As per their official blog, Bitly uses Go in production. While most of their services were written in Python, they leveraged Go's channels and goroutines to write straightforward code that parallelizes HTTP requests to downstream systems or aggregates writes to disk.

Go at Dropbox

DropBox is a massive company, and today, most of DropBox's infrastructure is written in Go. Dropbox migrated from Python to Go for performance-critical backends to leverage better concurrency support and faster execution speed. Company-wide, Dropbox has 1.3 million lines of Go as per a blog shared by Tammy Butow, the then SRE manager at Dropbox.

Who Else is Using Go?

**UBER - **UBER has GeoFence lookups to show its users' vehicle availability in a particular location and prices accordingly, and this feature is written in Go.

BBC Worldwide - BBC Worldwide implemented Go for backend development and production of different games.

SoundCloud - SoundCloud used Go to develop their build and deployment system.

**Google - **Google uses Go for many internal projects. The service that runs dl.google.com — the source for Chrome, Earth, Android SDK, and other large Google downloads — has been rewritten in Go.

**Twitter - **5 billion Twitter app sessions go through Go daily & that is huge.

Medium - Their Neo4j database is managed by a service written in Go which they refer to as GoSocial.

GitHub - A lot of GitHub infrastructure is in Go now, including all the server-side parts of Actions.

Here is a list of companies currently using Go around the world.

Give it a try

Go is easy to learn, easy to read, and it is very powerful. Go already has the tooling figured out for you. This is why numerous firms migrate to Golang from other languages ​​and design effective and efficient software.

And now there is an ecosystem, and there are a lot of libraries available whether it’s for writing tests, or improve logging. There are also central Go module repositories such as GoCenter from which public Go modules can be downloaded.

Also, enterprises can use tools such as Artifactory that can be used to store private Go modules, public Go modules, and the compiled binaries.

Go is in such an inspiring stage currently. It has a very active open source community that is evolving every day. Also, code written in Go is easy to maintain. Go programmers are in high demand, and as we see that most of the DevOps tools are written in Go, it is easily predictable that Go goes well with the DevOps world and is here to stay.

Thanks for reading

If you liked this post, share it with all of your programming buddies!

Why Go Is Perfect For DevOps

This video will cover the built in features of Golang that make it possible to write your code on one platform and seamlessly deliver it to many different operating systems and architectures. As a devops engineer I have tools and services that need to support multiple operating systems running on different CPU architectures.

Go is an excellent open source multiplatform language for doing cross-platform development which is ideal for ops tools. If you target multi-platform, multi-architecture environments, come learn how Go enables you to write once and run anywhere. No more need for kludgy shell scripts!

You will learn the specific ways to generate *bsd-386 binaries on Windows-x64, android-arm binaries on Linux-ppc and all combinations in between. I’ll also be covering coding techniques to keep this manageable and libraries that support you in things like file system navigation.

Thanks for reading ❤

If you liked this post, share it with all of your programming buddies!

Follow me on Facebook | Twitter

Learn More

Learn How To Code: Google’s Go (golang) Programming Language

Go: The Complete Developer’s Guide (Golang)

Docker Mastery: The Complete Toolset From a Docker Captain

Moving from NodeJS to Go

Building Modern Desktop Apps in Go

Google’s Go Essentials For Node.js / JavaScript Developers

Build a chat app with Go

What DevOps Tools Do You Really Need In 2019?

The Complete Guide to Microservices and Microservice Architecture

The Complete Guide to Microservices and Microservice Architecture

In this article, you will learn about the following: Why Microservices, What Is Microservices, Features Of Microservice Architecture, Advantages Of Microservice Architecture, Best Practices To Design Microservices, Companies Using Microservices and more

This Microservices tutorial starts by helping you understand microservices architecture and best practices for designing them.

*Have you ever wondered, ****What is *Microservices and how the scaling industries integrate with them while building applications to keep up with their client expectations?

To get an idea of What is Microservices, you have to understand how a monolithic application is decomposed into small tiny micro applications which are packaged and deployed independently. This tutorial will clear your understanding of how developers use microservices to scale their applications according to their need.

In this tutorial, you will learn about the following:
Why Microservices?What Is Microservices?Features Of Microservice ArchitectureAdvantages Of Microservice ArchitectureBest Practices To Design MicroservicesCompanies Using Microservices## Why Microservices?

Now, before I tell you about microservices, let’s see the architecture that prevailed before microservices i.e. the Monolithic Architecture.

In layman terms, you can say that its similar to a big container wherein all the software components of an application are assembled together and tightly packaged.

Listed down are the challenges of Monolithic Architecture:

Figure 1: What Is Microservices – Challenges of Monolithic Architecture
Inflexible – Monolithic applications cannot be built using different technologies Unreliable – Even if one feature of the system does not work, then the entire system does not workUnscalable – Applications cannot be scaled easily since each time the application needs to be updated, the complete system has to be rebuiltBlocks Continous Development – Many features of the applications cannot be built and deployed at the same timeSlow Development – Development in monolithic applications take lot of time to be built since each and every feature has to be built one after the other**Not Fit For Complex Applications – **Features of complex applications have tightly coupled dependencies
The above challenges were the main reasons that led to the evolution of microservices.

What Is Microservices?

Microservices, aka Microservice Architecture, is an architectural style that structures an application as a collection of small autonomous services, modeled around a business domain.

** Figure 2**: What Is Microservices – Microservices Representation

In Microservice Architecture, each service is self-contained and implements a single business capability.

Differences Between Traditional Architecture and Microservices

Consider an E-commerce application as a use-case to understand the difference between both of them.

Figure 3: What Is Microservices – Differences Between Monolithic Architecture and Microservices

The main difference we observe in the above diagram is that all the features initially were under a single instance sharing a single database. But then, with microservices, each feature was allotted a different microservice, handling their own data, and performing different functionalities.

Now, let us understand more about microservices by looking at its architecture. Refer the diagram below:

**Microservice Architecture **

Figure 4: What Is Microservices – Microservice Architecture
Different clients from different devices try to use different services like search, build, configure and other management capabilitiesAll the services are separated based on their domains and functionalities and are further allotted to individual microservicesThese microservices have their own load balancer and execution environment to execute their functionalities & at the same time captures data in their own databasesAll the microservices communicate with each other through a stateless server which is either REST or Message BusMicroservices know their path of communication with the help of **Service Discovery **and perform operational capabilities such as automation, monitoringThen all the functionalities performed by microservices are communicated to clients via API GatewayAll the internal points are connected from the API Gateway. So, anybody who connects to the API Gateway automatically gets connected to the complete system
Now, let us learn more about microservices by looking at its features.

Microservices Features

Figure 5: What Is Microservices – Features Of Microservices
Decoupling – Services within a system are largely decoupled. So the application as a whole can be easily built, altered, and scaledComponentization – Microservices are treated as independent components that can be easily replaced and upgradedBusiness Capabilities – Microservices are very simple and focus on a single capability Autonomy – Developers and teams can work independently of each other, thus increasing speedContinous Delivery – Allows frequent releases of software, through systematic automation of software creation, testing, and approval Responsibility – Microservices do not focus on applications as projects. Instead, they treat applications as products for which they are responsible Decentralized Governance – The focus is on using the right tool for the right job. That means there is no standardized pattern or any technology pattern. Developers have the freedom to choose the best useful tools to solve their problems Agility – Microservices support agile development. Any new feature can be quickly developed and discarded again## Advantages Of Microservices

Figure 6: What Is Microservices – Advantages Of Microservices
Independent Development – All microservices can be easily developed based on their individual functionalityIndependent Deployment – Based on their services, they can be individually deployed in any application Fault Isolation – Even if one service of the application does not work, the system still continues to functionMixed Technology Stack – Different languages and technologies can be used to build different services of the same applicationGranular Scaling – Individual components can scale as per need, there is no need to scale all components together## Best Practices To Design Microservices

In today’s world, complexity has managed to creep into products. Microservice architecture promises to keep teams scaling and function better.

The following are the best practices to design microservices:

Figure 7: What Is Microservices – Best Practices To Design Microservices

Now, let us look at a use-case to get a better understanding of microservices.

Use-Case: Shopping Cart Application

Let’s take a classic use case of a shopping cart application.

When you open a shopping cart application, all you see is just a website. But, behind the scenes, the shopping cart application has a service for accepting payments, a service for customer services and so on.

Assume that developers of this application have created it in a monolithic framework.Refer to the diagram below:

Figure 8: What Is Microservices – Monolithic Framework Of Shopping Cart Application

So, all the features are put together in a single code base and are under a single underlying database.

Now, let’s suppose that there is a new brand coming up in the market and developers want to put all the details of the upcoming brand in this application.

Then, they not only have to rework on the service for new labels, but they also have to reframe the complete system and deploy it accordingly.

To avoid such challenges developers of this application decided to shift their application from a monolithic architecture to microservices.Refer to the diagram below to understand the microservices architecture of shopping cart application

Figure 9: What Is Microservices – Microservice Architecture Of Shopping Cart Application

This means that developers don’t create a web microservice, a logic microservice, or a database microservice. Instead, they create separate microservices for search, recommendations, customer services and so on.

This type of architecture for the application not only helps the developers to overcome all the challenges faced with the previous architecture but also helps the shopping cart application to be built, deployed, and scale up easily.

Companies using Microservices

There is a long list of companies using Microservices to build applications, these are just to name a few:

Figure 10: What Is Microservices – Companies Using Microservices