Cloud Infrastructure
Author: Shine ChangCloud infrastructure refers to how the webservice is deployed and partitioned under the hood. This is a complex topic that is usually outside the scope of amateur developers like our club, however some basic understanding is necessary to understand how we can put or projects in the web.
Terms
Scalability
One of the biggest concerns of a backend developer is architecture scalability, or, how easy it is to expand the service’s capacity. There are two types of scaling, horizontal and vertical.
vertical: Increasing performance of a single server. Obviously, there is a limit to vertical scaling. horizontal: Increasing quantity of servers. Theoretically, this is a boundless.
Vertical scalability is easy to achieve, however ideally, we would want our applications to be horizontally scalable too. However, simply adding more servers does not do the trick, it would just mean we have multiple instances of the same program. We need another component to bind the multiple servers to make them work together.
Load Balancer
To utilize the resource of multiple server nodes, we need a scheduler node to tell the servers what request to address. The below diagram models the role of a load balancer. Though the idea is simple, the implementation is a beast in itself. This service is usually provided by third party software or generated by infrastructure tools.
Architecture Patterns
Monolith A self-contained server that provides a single service.
Virtual Machines (VM) Partition a single servers resource by creating sandboxed “virtual machines.”
Microservices
Bundle multiple services into one server, with isolated environments (called containers) instead of VMs, and thus avoiding the overhead.
Docker
is a service that builds containers.
Serverless In this architecture, each service is treated as a “function.” Traditional architectures revolve around hosting a service on live processes, and invoking it through message passing. Serverless does away with this by making a service function that can be invoked on-demand. This eliminates the messaging and process overhead.
- Article on Serverless Functions
- Amazon Lambda uses this architecture
In this design, the service developer does not need to worry about infrastructure, and as such, this is often the go-to solution for deploying amateur projects. More on this in the “Deployment” article.
What does this Mean for the Developer?
It should be clear that managing and maintaining cloud infrastructure is a challenge, and is a focus of production backend design. However, applications produced by hobbyist/amateur developers typically do not require the capacity enabled by complex infrastructure designs.
Now armed with this knowledge, let us look at how we can deploy or projects inexpensively in the “deployment” resource.