Scaling Web Applications Is Like Walking a Tight Rope in a Storm | Hacker Noon

Author profile picture

@arvindkgsArvind Kumar GS

Passionate software developer, Linux enthusiast, clean code crusader, DIY advocate, Tech Evangelist

Scaling web applications is a skill. It’s like walking a tight rope, in the midst of a storm. There are multiple factors acting on you,

  • Speed
  • Reliability
  • Availability
  • Scalability
  • Time to market
  • Resources

Each will pull you in the opposite direction, you have to balance between them. You will need to decide what is the equilibrium point for your application based on your use case and resources available to you.

Currently there are lot of options on cloud that provide tools to help in deploying, managing, and scaling web applications. The tools can be broadly classified as (Note: Below analogy is just for easy understanding) –

  • Saas (AWS Lambda, Google Cloud Functions, Google App Engines)

These tools builds your application, also sets up and configures and runs your application. All you need to do is provide the source. You do not need to worry about creating docker files, creating deployment yaml etc. This is used for quickly deploying your application. You forgo control in favor of lesser complexity.

  • Paas (Google Cloud Run, AWS Fargate, Heroku, Pivotal Cloud)

These tools are serverless container platform, where you are responsible for the built artefacts (docker images). But the deployment of your container is managed for you. It also provides auto scale abilities.

  • Iaas (AKS, EKS, GKE, Digital Ocean Kubernetes)

These tools provide Kubernetes as a platform, and you can run your containized workloads on them. You will need to create and configure deployment yaml the instruct Kubernetes where to deploy your workloads. This is good balance between control and complexity.

  • VM/Physical Servers (EC2, Google Compute Engine, Bare Metal Servers)

These only give you server/vms on which you need to install, configure and manage Kubernetes. Here you have complete control, but also you need dedicated devops teams to maintain your infrastructure.

You need to select your appropriate platform/stack based on below below metrics.

  1. Control
  2. Granularity
  3. Cost
  4. Complexity

You can use a variety of higher level tools to manage your deployments in a CI/CD pipeline. These tools can be used with Paas and Iaas categories as defined above.

  1. Containers: While Docker files are de facto for creating containers, you can use buildpacks to build reuseable, transparent docker images. Refer to Arvind Kumar GS’s answer to What is best way to build Micro services using docker?
  2. Managing deployments: Helm is the de facto for easy packaging and deploying workloads on Kubernetes. kustomize can also be used. It provides manifests that can be used to template your deployment and reuse a base deployment and provide overlays (deltas) for each landscape
  3. Managing clusters: To manage your cluster as a whole, you can look into Argo. This provides an automated way to update your cluster by monitoring your git versioned deployment files. Also while Kubernetes ensures that specified number of pods are running, if a deployment is decommissioned using kubectl, or any changes are made to the deployment, Kubernetes is not aware of these changes. So Argo monitors whether your running cluster matches the desired state.

As you see a lot goes into making sure your web service can scale up. So if you are starting out it makes sense to start with Saas category products. If this does not handle your load, you will need to progressively hop to the more granular categories.

Further Reading:

Image credits: https://www.ecmag.com/section/your-business/electricians-tightrope-walker-team-high-wire-act

Previously published at https://www.quora.com/What-is-the-best-way-for-scaling-large-scale-web-services/answer/Arvind-Kumar-GS

Author profile picture

Read my stories

Passionate software developer, Linux enthusiast, clean code crusader, DIY advocate, Tech Evangelist

Tags

The Noonification banner

Subscribe to get your daily round-up of top tech stories!

read original article here