First Milestone: 500,000 Accounts
MySpace started small, with two Web servers talking to a single database server. Originally, they were 2-processor Dell servers loaded with 4 gigabytes of memory, according to Benedetto.
Web sites are better off with such a simple architectureif they can get away with it, Benedetto says. "If you can do this, I highly recommend it because it's very, very non-complex," he says. "It works great for small to medium-size Web sites."
The single database meant that everything was in one place, and the dual Web servers shared the workload of responding to user requests. But like several subsequent revisions to MySpace's underlying systems, that three-server arrangement eventually buckled under the weight of new users. For a while, MySpace absorbed user growth by throwing hardware at the problemsimply buying more Web servers to handle the expanding volume of user requests.
But at 500,000 accounts, which MySpace reached in early 2004, the workload became too much for a single database.
Adding databases isn't as simple as adding Web servers. When a single Web site is supported by multiple databases, its designers must decide how to subdivide the database workload while maintaining the same consistency as if all the data were stored in one place.
In the second-generation architecture, MySpace ran on three SQL Server databasesone designated as the master copy to which all new data would be posted and then replicated to the other two, which would concentrate on retrieving data to be displayed on blog and profile pages. This also worked wellfor a whilewith the addition of more database servers and bigger hard disks to keep up with the continued growth in member accounts and the volume of data being posted.