06 / 25 · Traffic and capacity

Vertical scaling

Vertical scaling gives one machine more CPU, memory, storage or throughput. It can be the simplest improvement, but it has a size ceiling and does not create a second copy for failover.

What you will practise

  • Match resources to the bottleneck
  • separate resizing from redundancy
  • plan rollback

Before you start: CPU, memory and disk waits.

About 4 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.

Download MP4Captions

Listen without the videoDownload audio

The same pre-recorded voice as the video. Starting audio pauses the video, and starting the video pauses audio.

Chapters and full transcript

Let us understand vertical scaling. A student replaces a tiny desk with a larger desk. More books fit, but there is still one desk. A bigger desk does not solve every problem: a lost key to the room still blocks access. Likewise, extra memory helps a memory bottleneck but may not help a slow external payment call. Vertical scaling gives one machine more CPU, memory, storage or throughput. It can be the simplest improvement, but it has a size ceiling and does not create a second copy for failover.

Follow the normal path. The application is slow. Inspect whether requests wait on CPU, memory, storage, locks or another service before selecting a bigger machine. Give the same database more appropriate resources. This is vertical scaling because the number of independent database copies has not increased. A SeatSpot database may benefit from more memory for its working set before the team considers sharding. First measure the constraint rather than buying a larger machine because the site feels slow.

Now change one condition. More memory can hold more of the hot working set. If disk reads were the bottleneck, the experiment may show lower latency. A common misunderstanding is this: A larger instance is a second failover copy. It remains one instance unless a separate redundancy design exists. Think about this. A payment provider takes five seconds. Will doubling your app RAM necessarily fix it? Pause the video and make your prediction. No. Extra RAM does not shorten an external provider delay. Measure the critical path first.

Let us reason with a concrete example. The database reads a 12 GB hot dataset but has only 4 GB available for useful caching. A larger memory budget may improve hit rate; the actual benefit depends on access patterns, other memory users and query plans. Doubling RAM is not a promise of double throughput. Profile the working set and expensive queries, test a larger instance in a safe environment and measure tail latency and restart behavior. These figures are teaching examples, not production guarantees.

Turn the idea into a design decision. A size change may restart or fail over the database. Use the actual platform procedure and verify what users see during the transition. Repeat the same controlled workload. Compare throughput, tail latency, waits and cost; do not use machine size as the success metric. When you try the practice task, look for this result. A resize is justified by observed improvement and operational constraints, not instance size alone.

Check your understanding. The larger machine still needs redundancy and backups. If the machine fails or reaches its size ceiling, a different design decision is needed. Here is a challenge. CPU is idle but one SQL query waits on a lock. Will twice as many cores fix it? Pause before the answer. Probably not. Inspect the blocking transaction, query and locking strategy. Extra cores do not release the lock. Re-test after addressing the measured contention. For an interview, choose a resource using profiling and compare cost. Say what you would measure, not only which tool you would buy.

Start with an everyday picture

A student replaces a tiny desk with a larger desk. More books fit, but there is still one desk. A bigger desk does not solve every problem: a lost key to the room still blocks access. Likewise, extra memory helps a memory bottleneck but may not help a slow external payment call.

Why SeatSpot needs this

A SeatSpot database may benefit from more memory for its working set before the team considers sharding. First measure the constraint rather than buying a larger machine because the site feels slow.

Trace one step at a time

Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.

TrafficOne databaseCPU and RAMStorageMeasurements

Step 1 of 6 · Find the constrained resource

Measure the wait

The application is slow. Inspect whether requests wait on CPU, memory, storage, locks or another service before selecting a bigger machine.

Read all six mechanism steps
  1. Measure the wait

    The application is slow. Inspect whether requests wait on CPU, memory, storage, locks or another service before selecting a bigger machine.

  2. Increase resources

    Give the same database more appropriate resources. This is vertical scaling because the number of independent database copies has not increased.

  3. Watch useful memory

    More memory can hold more of the hot working set. If disk reads were the bottleneck, the experiment may show lower latency.

  4. Plan interruption

    A size change may restart or fail over the database. Use the actual platform procedure and verify what users see during the transition.

  5. Retest the result

    Repeat the same controlled workload. Compare throughput, tail latency, waits and cost; do not use machine size as the success metric.

  6. Keep a recovery plan

    The larger machine still needs redundancy and backups. If the machine fails or reaches its size ceiling, a different design decision is needed.

Pause and make a prediction

A payment provider takes five seconds. Will doubling your app RAM necessarily fix it?

Answer aloud or write your reasoning in the lesson notes before revealing the explanation.

Correct a common misunderstanding

Claim to question: A larger instance is a second failover copy.

Better explanation: It remains one instance unless a separate redundancy design exists.

Write a resize experiment

A paper or whiteboard task. No cloud account or paid infrastructure is required.

  1. Record latency, memory pressure, CPU and I/O waits.
  2. Choose one resource change in a test environment.
  3. Repeat the same workload and measure restart/recovery behavior.

Check what you can explain

This is your self-check, not an automated grade. Try again without the diagram tomorrow.

0 of 3 goals checked. Choose one remaining idea to practise next.

These checkboxes reset when you leave. Use your saved lesson notes and completion marker to record lasting progress.

Teach it back

Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.

Try it before viewing the solution

CPU is idle but one SQL query waits on a lock. Will twice as many cores fix it?

Check one key idea

A larger database server mainly guarantees:

Your explanation and interview notes

Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.

Loading your local notes…

Official references and next reading

The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.