Why Use Go for Microservices

TL;DR. Microservices are small. Containers should be small. Go binary is small. Small is beautiful.

Microservices comprise the business logic if you are used to the Three-Tier Architecture.

From the development perspective, Go is fast and relatively easy to learn. The standard library is small. The syntax is easy for anyone who is used to C language and the like.

From the ops perspective, Go program in the form of a single binary is easy to deploy. There are no humongous runtime like the JVM, Python or Node.js.

From the container perspective, Go program is easy to be wrapped as a container. There are no hefty OS image to build upon. A small busybox image is enough. Heck, you can use the ultimate in form factor: the SCRATCH image.

From the N-tier perspective (which is based on Three-Tier Architecture), the number n represents the number of replica of your business logic component (or Go program).

From the Kubernetes perspective, it is the number of replica you specify with the replication controller.

From a seasoned Go developer perspective,

You want to leverage event-driven programming without the usual baggage: callback hell, deferreds, futures, promises, empty promises…or whatever the cool kids are calling them these days.

Using Go to write microservices (or business logic) represent the ultimate in size (the smaller, the better), speed in deployment (the smaller, the better) and speed in functionality (it is compiled, remember?).

What’s not to love?

At ITMarketplace, we use Go for microservices all the way down.

It is not that Python or Ruby or Node.js are irrelevant or worthless. They are relevant but only if they are used for its intended purposes. That is, dynamic programming languages are better suited for data analytics like MapReduce, functional programming and things where Apache Spark excels.

Heck, you can replace Spark with JavaScript if you get the right abstraction (RDD is killing it).

But we are not here to talk about dynamic programming languages.

We are here to promote Go for microservices and that is all what matters here.

If you are thinking how to approach microservices, look no further.

I have outlined a microservice architecture and you should read it now.

Advertisements

Subjectivity aside, leave a reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s