In the previous article I discussed using Read Replication
Clustering to scale out reads for a website. What I will now do
is describe a refined approach to the problem of scaling by
creating "Application Clusters with Replication".
A common approach to website design is that a web designer
creates a website and decides that search is a feature that they
want to implement. If they use the MyISAM engine this means that
they can add fulltext indexes to their tables and then make use
of them in queries. I will ignore the case where the developer
decides that an unanchored LIKE clause is an appropriate
solution, since this developer will quickly hit a wall on
performance and will need to learn what a fulltext index
is.
So the developer adds a fulltext and is good to go? Sounds like
an easy solution?
If the site the developer has written begins to see significant
traffic then one of three things will occur. …
If there is a common method of scaling with MySQL databases it is
the
Read Replication Cluster solution.
Most websites start out with a single database and grow from
there.
If the site's content is being generated from their database
then
they will eventually hit a wall with reads from the database.
Tuning
and hardware will buy you some growth but in the end disks spin
only
so quickly. Luckily most websites are predominantly read
intensive
and for this reason replication will solve scaling problems for
many
people. Replication is a means by which MySQL sends updates of
one
database to one or more databases which will act as a slave.
These
changes are atomic, which means the changes are applied in full.
No
row will ever be partially updated, and no transaction will be
seen
on the slave that did not commit on the master
Make a change in the …
I've never been all that interested in solving small problems.
Small problems with scaling are resolved with single indexes,
upgrades to hardware, or simply creating a bigger pipe.
When the measure of the Internet was a T-1, you could flood the
network with the average 486. At the time I watched people buy
hardware in the hundred's of thousands, and sometimes more, which
never went used. Today's hardware is overkill for a lot of
applications, so the first step in scaling is often tuning the
hardware that you have already purchased. Make use of what you
already have.
The "Slashdot Effect" is a perfect example of what is normally a
small problem. What is the Slashdot Effect? Point tens of
thousands of eyeballs at a website and watch it crash. The root
cause of this? Most of the time it is because the site operator
had their Apache max connections set to some ridiculous number.
Users would bring the site down because there …