Go Programming Language

Developed with
Calculated Systems

Contents

keyboard_tab
Course Intro
1
Introduction
PREVIEW3m 9s
Kubernetes
5
Integrating with GitHub and Google Cloud
Conclusion

The course is part of this learning path

Start course
Overview
Difficulty
Beginner
Duration
56m
Students
106
Ratings
5/5
starstarstarstarstar
Description

This course explores how to build microservices in Go and deploy them on Kubernetes to create reusable components that can be fully managed in the cloud. We'll talk about what a microservice is and its overall architecture. We'll then take a look at the Go programming language, its benefits, and why it works well for building microservices.

You'll also get an intro to Kubernetes including what it is, what it is used for, and the key components that are needed to get a microservice from code to be exposed on the internet.

We'll then combine these three services to do an example use case where we'll build a microservice in Go and deploy it on Kubernetes. Finally, we'll look at CI/CD integration with GitHub and Google Cloud and how you can automate your deployments.

Learning Objectives

  • Learn about microservices and their overall architecture
  • Learn about the Go programming language and why it's good for building microservices
  • Understand how Kubernetes can be used to deploy microservices
  • Learn about CI/CD with GitHub and Google Cloud

Intended Audience

This course is intended for engineers throughout the tech stack or anyone who wants to get their feet wet in DevOps and learn how programs can be managed in the cloud.

Prerequisites

There are no essential prerequisites for this course. However, we recommend that you have:

  • Experience with at least one high-level programming language, whether that be Java, Python, or Ruby
  • A conceptual understanding of Linux containers and/or Docker
Transcript

All right, let's move on to the Go programming language and start with a little bit of an overview. Go was designed internally at Google in 2007. It was designed by Robert Griesemer, Ken Thompson, and Rob Pike, pioneers within the computer science and open world communities. If you're unfamiliar with who these people are, I highly recommend you take a moment to go see some of the work that they've done.

Robert Griesemer has been a key component to Google's V8 JavaScript engine. Rob Pike used to work at Bell Labs, worked on Plan 9, and is one of the co-creators of UTF-8. He co-created it with Ken Thompson, and Ken Thompson is considered the grandfather of Unix since he was a lead at Bell Labs on the Unix project. But enough about them, let's get back to Go.

The Go programming language is a statically typed and compiled language. We'll talk about why that's important in a moment. Go was built with concurrency in mind. Developers using Go are referred to as gophers, which is aptly named based on the language's mascot.

Why would you want to choose Go? One of the key reasons I find people tend to use Go is that it can be compiled down into single binary allowing you to distribute your applications without the need for runtime dependencies. That's not always the case, but it is quite common.

The next reason goes hand in hand with the previous, and that is that it comes with a small footprint. As you work with containers and microservice a small footprint is great. We don't have to rely on external libraries and packages to be loaded into our container.

We can actually reduce our deployment size by 10 or 20 fold. I've had applications written in Python that when distributed in a container run about a gigabyte to a gigabyte and a half in size. After being rewritten in Go, the container size was reduced to around 50 to 100 megabytes. This greatly reduced storage cost, not to mention the performance increase with using Go.

Another reason why you might want to choose Go is its powerful standard library. The Go standard library comes packed with lots of the tools you'll need right out of the box. Whether you need to spin up a web server, handle JSON, XML, CSV, encoding or decoding, or even security.

There are some that argue that you don't actually need third-party libraries. I find that to be a little extreme, but chances are, if you're searching for a solution to a problem on, say, stack overflow, you'll most likely get examples that use the standard library rather than being told to just use lib X or lib Y.

The last reason why you might want to use Go is concurrency. Now we won't cover concurrency in this course but as your microservices mature or you need to do long-running processes I found that concurrency patterns in Go to be very straightforward and easily implemented. And that's because of the language's concepts of Go routines and channels. These are first class citizens in the language and greatly reduce the complexity of, say, trying to use threads in Java or Python.

The Go mantra is, do not communicate by sharing memory, instead share memory by communicating. If you are new to Go and want to learn more about its concurrency patterns, I highly recommend watching Rob Pike's lecture entitled Concurrency is not Parallelism. It's a great introduction to what the capabilities of Go's concurrency patterns are and how it can be utilized in your applications.

Before moving on, if you're new to Go and want to start looking around on the internet for guides and tutorials, you might quickly find that searching for the word 'go' on Google isn't going to help you too much. Remember to use 'golang' when researching. Golang is the URL for the language's official webpage and that tag has been associated with it.

If you want to test out some code without actually installing anything on your machine, please head to play.golang.org. It gives you an interactive text editor. You can mess around and try some code out. You don't have to worry about compiling anything. Everything is handled for you in the web browser.

If you're looking for a good place to start learning, the official website offers a tour of Go, and this covers everything from simple print statements all the way up to concurrency and web programming.

About the Author
Avatar
Calculated Systems
Training Provider
Students
5485
Labs
31
Courses
13
Learning Paths
17

Calculated Systems was founded by experts in Hadoop, Google Cloud and AWS. Calculated Systems enables code-free capture, mapping and transformation of data in the cloud based on Apache NiFi, an open source project originally developed within the NSA. Calculated Systems accelerates time to market for new innovations while maintaining data integrity.  With cloud automation tools, deep industry expertise, and experience productionalizing workloads development cycles are cut down to a fraction of their normal time. The ability to quickly develop large scale data ingestion and processing  decreases the risk companies face in long development cycles. Calculated Systems is one of the industry leaders in Big Data transformation and education of these complex technologies.