Introducing Go Micro, a package for building microservices

Netflix's Eureka and Spring Boot from the Java community are famous for building microservices. The Go Micro package provides the same set of features. It is a toolkit for building microservices in Go. It is lightweight, which means start small and go big.

It has a Go style of adding services, which makes developers feel good. In the upcoming sections, we will see how to create a microservice with the steps defined by Go Micro. Go Micro provides requirements to implement RPC and event-driven architectures (EDAs). It also has a pluggable interface where we can plug any external functionality.

The main features supported by Go Micro are as follows:

Request/response is a plain HTTP/RPC call. Service discovery is useful for finding microservice instances at runtime. Load balancing is for routing requests to multiple same-type applications. Message encoding is essential for services to understand each other. Async messaging involves the generation and consumption of events. Go Micro's pluggable interfaces provide functionality such as codecs for translation, and brokers for storage systems.

Install Go Micro using the dep tool in any project in this way:

> dep init
> dep ensure -add "github.com/micro/go-micro"

In the next section, we lay down the plan for our first microservice. We see how to encrypt and decrypt messages in Go. We will then build an encrypting/decrypting service using Go Micro.