Developing and Deploying Microservices with Go

bruc3mackenzi3

Bruce MacKenzie

Posted on January 8, 2023

Developing and Deploying Microservices with Go

Introduction

Entire books have been written on the subject of microservices. This post will scratch the surface by exploring the key ingredients that go into development and deployment of microservices. A demo microservice app will be used as a case study, presenting popular technologies to bring the concept into motion.

Go is a popular language of choice for modern, service-based architectures. The term cloud native is often used to describe Go, but what does it mean?

Go is a compiled language, meaning a Go program can be run on a target machine without the installation of dependencies. A higher level language by comparison, like Java or Python, requires its runtime environment and all 3rd party dependencies be installed. This has a number of drawbacks:

  • Added complexity to the build process
  • Built images have larger file size
  • CICD pipelines, image builds, cloud deployments, etc all take longer to run
  • All dependencies must be installed on target machines

A modern, compiled language like Go on the other hand has such advantages:

  • Dependencies are only required on the build machine
  • A single, executable file is deployed to target machines which need only provide a compatible operating system
  • The build machine can compile the program to run on different operating systems and CPU architectures, simply by specifying these as arguments to the compiler
  • Compiled programs run faster, improving application performance and reducing infrastructure costs

Microservices in Action

To get started building a Go microservice, head over to my Go Microservice Repository to explore the technologies I've integrated. You can pick and choose certain technologies to apply to your own project, or fork the repository to start a new project using it as a template.

Technologies Used

For a rundown of tools and frameworks used to bring a Go microservice to life, see the repo readme.

💖 💪 🙅 🚩
bruc3mackenzi3
Bruce MacKenzie

Posted on January 8, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related