A High Level View of Cloud Computing (and System Design)

Jaidev Singh Bhui
7 min readJun 25, 2020

--

Photo by Pero Kalimero on Unsplash

No, not the literal cloud, but the trending tech word, which means the on-demand availability of computer system resources, especially data storage and computing power, without direct active management by the user.

Look, if you’re a budding developer (like me), who’s curious about the web, how web hosting works, what to do after buying a domain name, looking forward to getting into System Design, or even what happens after typing www.google.com in your browser, this article might push you in the right direction.

Crio.Do: The Game Changer

www.crio.do

Crio.Do is really a game changer, when it comes to online learning platforms. Their Micro Experiences provide hands-on learning to developers, in a well structured, well documented way, with loads of reference materials. I would highly recommend you all to take part in at least one of their micro experiences.

A look at the Micro Experience Dashboard

They distribute the learning experience into modules, making it easier to grasp concepts in a well structured manner. And there is a debrief after each module, where you’re asked some questions, based on the learning done.

I took part in Crio.Do’s #IBelieveinDoing challenge over the last weekend, and completed the amazing System Design Micro Experience, which is the main purpose of me even being here, typing this article.

QReview is another ME (Micro Experience) which was a part of this challenge, which focuses more on REST API calls, and working on the backend of a food review mobile app, which I had completed when I was part of the Crio Launch program.

But this article focuses more on the System Design ME, so we’ll go ahead with that.

Let’s Start

Let’s get on with the main subject of the article, which is to get a high level understanding of System Design.

I’ll follow the same modular plan created by Crio, consisting of 4 modules.

A look at the overall architecture we’ll be working on.

Module 1: Host a webserver in cloud

You might’ve heard of AWS, Google Cloud Platform, Azure and other cloud platforms. So, what these platforms do is, they provide you with computer system resources, especially data storage and computing power on demand.

I used EC2 from AWS, which is Elastic Cloud Computing, and provides us with Virtual Machine instances on demand.

Virtual Machine(VM) is nothing but a virtual environment that functions as a virtual computer system with its own CPU, memory, network interface, and storage, created on a physical hardware system (located off- or on-premises).

So, instead of buying a physical machine, you can use these VMs to do anything you want in cloud. The primary advantage is that they are pay-per-use. So, if you want a big VM today and a smaller VM tomorrow, that is totally possible!

Now, to use that Virtual Machine as a server, we would require an HTTP server, so we need to install Nginx on the VM, which is a web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. An alternative can be Apache server.

If you now go to the browser and type in the public IP address, you can see that now anyone in the world can access your server. (Provided the firewall allows these connections).

Your VM is accessible now to anyone who has the IP address
Your server is accessible now to anyone who has the IP address

Module 2: Host your site in a domain

So, now you can access your server, job’s complete, right? Not quite.

What if you wanted your friend to see your website, you would have to send him/her these seemingly random numbers(IP address), which can be forgotten easily. You don’t remember Google’s IP address when you want to access it, right?

So, you need a domain name, a placeholder which points to the IP address of your server, so you don’t need to remember these random numbers, but just the name that’s pointing to it, which can be as simple as www.google.com.

You can buy any domain name, and then add your server’s IP address to the A field.

You can have your domain name point more than one IP address (Look next section)

Now, when we enter www.google.com in our browser, what happens is, it is getting resolved to the IP address of one of google’s many servers. The system used for resolving this name is DNS.

The Domain Name System (DNS) is the phonebook of the Internet. Humans access information online through domain names, like nytimes.com or espn.com. Web browsers interact through Internet Protocol (IP) addresses. DNS translates domain names to IP addresses so browsers can load Internet resources.

A look at the network tab in developer tools shows what requests are sent to the server.

After you enter the domain name, there are name servers (NS) which resolve this to the IP address, and your browser sends an API GET request to the server, which further responds with HTML data(which you see being rendered in the browser), or JSON/XML data, etc.

Module 3: Fun with Load Balancers

Now that your website server has a name, you’re done, right?

Still no.

What if your website gets famous and everyone in the world tries to access it? Would your servers be able to handle the “load”? What if your server goes down?

So, we need to scale our system to cater the increasing demands of the users.

Scalability is the property of a system to handle a growing amount of work by adding resources to the system. We can either scale horizontally (add more machines, more servers), or scale vertically (add more computing power, memory, resources to the existing machine/server).

Big companies like Facebook, Google, Twitter, all use horizontal scaling, as they have multiple servers around the world.

Here is a fun representation from Bunmi Sowande’s blog on blog.turbonomic.com.

By Bunmi Sowande (https://blog.turbonomic.com/blog/on-technology/the-essentials-of-database-scalability-vertical-horizontal)

Okay, now we have our servers ready (horizontal scaling), but how would the users be directed to all these new servers?

We use something called Load Balancers to solve this problem.

A load balancer is a device that acts as a reverse proxy and distributes network or application traffic across a number of servers. Load balancers are used to increase capacity (concurrent users) and reliability of applications.

Load Balancers can be Software based or Hardware based, they can also be classified on the basis of what layer in the OSI Model they work on.

From AWS:

Application Load Balancers are used to route HTTP/HTTPS (or Layer 7) traffic. Network Load Balancers and Classic Load Balancers are used to route TCP (or Layer 4) traffic.

Load Balancers act as a traffic cop, which sit in front of our servers and route client requests responsibly. This is carried out in a manner in which, every user has a smooth surfing experience, and such that a single server doesn’t get overworked.

Now even if one of our servers goes down, Load Balancer can handle it.

Module 4: Scale your server performance with CDN

You might’ve used Facebook, Twitter or Instagram. There are hundreds of millions, or even billions of users. Now if such a huge user-base is requesting data, there would be a lot latency, and a lot delay in the server delivering the data to your browser or device, depending on your location.

But there doesn’t seem to be a huge delay (not considering your network speed).

This is caused by caching.

Cache is a hardware or software component that stores data so that future requests for that data can be served faster.

There is something similar happening here, with the help of a CDN (Content Delivery Network).

Source: www.ileafsolutions.com

To minimize the distance between the visitors and your website’s server, a CDN stores a cached version of its content in multiple geographical locations (a.k.a., points of presence, or PoPs). Each PoP contains a number of caching servers responsible for content delivery to visitors within its proximity.

There is another interesting thing, if we update the main servers, the cached resources, won’t be updated immediately, like in case of Facebook comments, where such an immediate consistency of data is not important, we can wait and update the cached instances some time later.

But what if it was a banking system? It would definitely cause problems, as one server would show different information from another server. So, here Immediate Consistency of data is required.

So, I hope some of the questions you had earlier, are solved now, or that now you have a better understanding of how the web architecture works at a high level.

All of this was part of the System Design ME by Crio, in which I had to #learnbydoing.

I definitely learned a lot after completing this Micro Experience, and think that Crio is doing a great job in this period of stress and the situation created by the covid pandemic, by creating such an interactive online learning experience.

--

--

Jaidev Singh Bhui

Professional Procrastinator and an aspiring Full Stack Web Developer.