Databases Reference
In-Depth Information
CHAPTER 11
Scaling MySQL
This chapter shows you how to build MySQL-based applications that can grow very
large while remaining fast, efficient, and economical.
Which scalability advice is relevant to applications that can fit on a single server or a
handful of servers? Most people will never maintain systems at an extremely large scale,
and the tactics used at very large and popular companies shouldn't always be emulated.
We'll try to cover a range of strategies in this chapter. We've built or helped build many
applications, ranging from those that use a single server or a handful of servers to those
that use thousands. Choosing the appropriate strategy for your application is often the
key to saving money and time that can be invested elsewhere.
MySQL has been criticized for being hard to scale, and sometimes that's true, but
usually you can make MySQL scale well if you choose the right architecture and im-
plement it well. Scalability is not always a well-understood topic, however, so we'll
begin by clearing up the confusion.
What Is Scalability?
People often use terms such as “scalability,” “high availability,” and “performance” as
synonyms in casual conversation, but they're completely different. As we explained in
Chapter 3 , we define performance as response time. Scalability can be defined precisely
too; we'll explore that more fully in a moment, but in a nutshell it's the system's ability
to deliver equal bang for the buck as you add resources to perform more work. Poorly
scalable systems reach a point of diminishing returns and can't grow further.
Capacity is a related concept. The system's capacity is the amount of work it can per-
form in a given amount of time. 1 However, capacity must be qualified. The system's
maximum throughput is not the same as its capacity. Most benchmarks measure a
1. In the physical sciences, work per unit of time is called power, but in computing “power” is such an
overloaded term that it's ambiguous and we avoid it. However, a precise definition of capacity is the
system's maximum power output.
 
Search WWH ::




Custom Search