Designing for Scale Print

  • backenddevelopment, backend, database, caching, performance, troubleshooting, guide, howto
  • 0

Handling more load.

WHAT TO ESTABLISH FIRST

What the actual load is, and where the limit is.

WHY

Most scaling work addresses problems that do not exist.

WHAT TO MEASURE

Requests per second Response time distribution Resource utilisation Where time is spent

WHAT SCALING VERTICALLY MEANS

A larger machine.

WHAT IT PROVIDES

Simplicity, and it is frequently sufficient.

WHAT SCALING HORIZONTALLY MEANS

More machines behind a load balancer.

WHAT IT REQUIRES

Statelessness: no request depending on which instance handles it.

WHAT THAT FORBIDS

Session state in process memory Files written to local disk and read later

WHAT TO DO INSTEAD

Shared session storage, and shared file storage.

WHAT USUALLY BECOMES THE BOTTLENECK

The database.

WHAT TO DO ABOUT IT

Index properly Cache what is read repeatedly Use read replicas for read-heavy work Move heavy work to background processing

WHAT TO AVOID

Scaling before optimising Assuming the bottleneck rather than measuring it


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot