How to scale a service?

How to scale a service?

Francisco

-
Follow me on
linkedin icongithub icon
Published on Dec 5, 2025

Having many users (data) or a high usage of your services is likely a key goal for any company, as it can demonstrate that your product solves a real pain for people. But with great responsibility comes a great challenge: how do you handle that growth without everything breaking?

Over the past few months, I’ve had the opportunity to study these topics, mainly by learning technologies like Kubernetes, and I wanted to write about this. In my professional life, I’ve led teams and developed APIs for GenAI products and ML models, but I had never really explored deeper software infrastructure topics.

In this article, I will share a bit about this technology and what lies behind it.

Hypothetical Case: “Where I Am”

Imagine we have an app (or web app) that works as an indoor navigation system for a shopping mall, helping customers find where the stores and restrooms are by using real-time tracking of their location.

We have our backend, which is a set of APIs (Application Programming Interfaces) for our application. If we have 100 users a day using our services, it’s probably not a problem, because hosting our product on a standard virtual machine would be enough to handle the traffic with a good level of service.

But as time goes by, more and more users start using the app, our product becomes more popular, and the good news starts rolling in: we’re getting more daily requests. Week after week, we receive thousands and thousands of additional requests, and our machine can no longer handle so many calls; latency becomes very high, and the service starts crashing because it can’t cope with the load.

What do we need to do? Scale. But how?

We could pay for a more powerful machine (more RAM, CPU, etc.) in a cloud environment. We could also buy a supercomputer and host it at home (hard and expensive). Or, instead, we can scale the solution horizontally.

How to scale?

Let’s go back to our application example. We built a product that the market is asking for; its demand keeps growing, and we need to understand how to scale it —that is, how to maintain the same performance regardless of the number of users. In software terminology, we have two options:

Gemini_Generated_Image_ggxjlfggxjlfggxj (1).png

What do these terms mean?

Vertical scaling:
If we want to handle increased traffic, we need a more powerful machine. The computer must have a faster CPU, more RAM, or greater disk capacity. This approach has pros and cons: the pros are mainly that everything is centralized, maintenance is simpler, and the initial cost is lower. The cons are that it’s sensitive to failures, becomes expensive to scale, and eventually hits a physical limit.

Horizontal scaling:
One for all and all for one. If we can’t rely on one giant machine, we can use many smaller machines that do the same job. Horizontal scaling is based on this idea: having multiple smaller computers connected and working together to support the demand.

Which one should you choose? (

The choice is not binary. As with most technology problems, it depends heavily on the context. If you’re a company with millions of users and you create a new product, it’s very likely that you’ll need it to scale horizontally because you already have a large user base. On the other hand, if you’re just starting out, it doesn’t make sense to spend money on a horizontal infrastructure, as it is expensive at the beginning and you still don’t have a large enough user base.

Gemini_Generated_Image_k0wm7ck0wm7ck0wm (1).png

The graph shows that, initially, setting up all our services on a horizontal infrastructure is very expensive, because many services would not be used at their full potential, along with other inefficiencies. However, as demand increases, the cost of horizontal scaling eventually becomes lower than vertical scaling, reaching a point where it becomes more convenient to move the entire infrastructure to a horizontal approach.

Horizontal costs rise mainly because, if you need to support a very high number of requests, you would need to pay for a very high-end (premium) cloud VM, which ends up being much more expensive than several smaller machines working together.

The key is identifying this tipping point and making the right decision. In most cases, it’s a bet—and many times, teams decide based on their knowledge and estimates, guided by the actual cost data of their platform.

How is everything coordinated?

Let’s go back to our example. Imagine we want to scale horizontally, where each computer acts like a small ant working together to perform a task. We know we have multiple machines, but now we need a way to coordinate them. Someone has to ensure the machines are healthy, connected, and able to receive and distribute traffic.

This role is handled by the Load Balancer, which is essentially the piece of software that receives incoming requests and decides which server should handle them. Its main functions include preventing any server from becoming overloaded, distributing traffic evenly across machines (the “ants”), and more.

In practical terms, it is the Project Manager (PM) of the computers.

The problem?

The Load Balancer is a small but important piece—but it’s not enough on its own. Think about situations where you need to create more servers because it’s Christmas and many people are visiting the mall, increasing the usage of the application, or when you need to deploy a new version of your code. The Load Balancer doesn’t handle any of this. It only distributes traffic based on the current state of the servers.

Solution: Kubernetes

Kubernetes is a technology created by Google in 2014 (by Joe Beda, Brendan Burns, and Craig McLuckie) that, in simple terms, is a container orchestrator.

Containers are currently the most reliable and scalable way to build software components because they are operating-system agnostic. They run on a layer above the OS and allow applications to be packaged within their own environment, including all dependencies and libraries.

So…

Kubernetes is the solution for scaling applications. This technology, created by Google’s team, automates application scalability by providing all the necessary infrastructure within the platform, allowing teams to focus less on configuration, as much of the work is handled internally by Kubernetes.

In practical terms, Kubernetes can be represented as follows:

gemini (1) (2).png

Where:

  • VM: The virtual machine where Kubernetes actually runs. It can be on GCP, AWS, Azure, or even on your own server.
  • Docker (or container runtime): The system responsible for running containers. Kubernetes uses Docker (or other runtimes) to start the images of your application.
  • kubelet: The agent that runs on every node. It acts as a “pod caretaker” and is responsible for: running the pods assigned by the control plane, checking their health, and restarting them if they fail.
  • k-proxy (kube-proxy): Manages networking within the node. It routes traffic to the correct pod using networking rules. It also allows pods to communicate with each other inside the cluster.
  • Kubenet: A simple network plugin that creates the basic rules needed for pods to communicate across nodes.
  • Pod: The smallest unit in Kubernetes. It can contain one or several containers that work together and share networking, an IP address, and a temporary filesystem.

The magic of Kubernetes is that it keeps the same underlying infrastructure—virtual machines, containers, and load balancers—but manages everything on its own.

If a node goes down, Kubernetes takes care of it.
If more nodes need to be created, Kubernetes takes care of it.
If we deploy a new version of our product, Kubernetes makes sure every node updates to that version.

It all sounds great, but the downside is that Kubernetes can be expensive, and to justify its use, you need a high volume of requests; otherwise, it doesn’t make much sense to implement it.

Kubernetes is a very interesting technology and can be set up on Google Cloud in just a few steps, but it’s not worth using unless you have the request volume needed to take full advantage of it.

Conclusion:
I believe these topics are important to discuss, as they are not covered much in master’s programs or AI/Data Science bootcamps, yet they help us understand technology at a deeper level. Kubernetes is just one technology among many, but the core concepts behind it have remained relevant over time.

This technology didn’t exist before simply because there wasn’t enough data. As time has passed and more users rely on digital services, a single computer can no longer handle all the demand, and we’ve had to move toward architectures with multiple machines, among other solutions.

Note: Some of the images were taken from a course at Birkbeck University (Advanced Cloud Computing).


Ir arriba
How to scale a service?