Understanding Golang and Goroutines

Let’s start with the basics

Mayank Gupta
Published in
7 min readOct 14, 2019


This article is focussed on understanding the basics of Golang. We will talk about the performance aspect of Golang and we will try to scale up the application by creating simple Goroutines.

We will also focus on underlying execution logic and what makes Golang different from other languages.

Concurrency in Golang

Before we proceed with the article, we need to understand the concept of parallelism and concurrency. Golang is capable of bringing both concurrency and parallelism to the application.

Let's understand the basic difference.

Understanding Concurrency

Concurrency means that the application has more than one thing to do at the same time. It's about creating multiple processes executing independently.

Applications might be dealing with lots of processes together to accomplish the intended behavior. Let's assume a simple ecommerce website and evaluate the list of concurrent tasks that it needs to execute:

  1. Running a banner on the top with the latest deals and products.
  2. Display the count of currently online users of the website.
  3. Update the user cart details when products are selected.
  4. Keeping the time counter for the next “Big Billion Sale” and so on.

The ecommerce website needs to have all these tasks running at the same time to keep the customer engaged with the application and make the website attractive to the user and draw more business.

So, a simple application/website could be a set of multiple tasks running in the background to satisfy the business requirement.

In both illustrations above, we have multiple tasks getting executed at the same time, but there is still a difference between the executions. Let’s look into this further to understand it in more detail.

Understanding Concurrent vs. Parallel Execution



Mayank Gupta

9 Years of Experience with Front-end Technologies and MEAN Stack. Working on all Major UI Frameworks like React, Angular and Vue https://medium.com/technofunnel