526 Part V . Advanced (Managed web hosting) Performance Considerations for

526 Part V . Advanced Performance Considerations for replication A couple of common terms that will be used throughout this chapter are master and slave. The master server receives updates to the data from applications and through other means and is considered the primary MySQL server in the replication set. The slave server receives updates only from the master server. The master server knows nothing about any slave servers that read the updates and replication information. The slave server is responsible for contacting the master server and reading the replication updates. Replication does not require a constant or high-speed connection between the master and slave. If a slave loses its connection to the master, it will try to reconnect according to values set by the administrator. Further, if a slave server stops replicating, it will remember where it left off and catch up later. Replication does require that both the master and slave have the same data to begin with. Therefore, if you are beginning with a 6GB database, you need that data transferred to the slave. (There are a couple of methods for performing this task, which I discuss later.) Replication uses a log, called the binary log, for tracking updates to data. This file is kept on the master in a replication set or on slave servers that have log- slave-updates enabled. On some file systems, notably ext2 in Linux, the maximum default file size is 2GB. Therefore, you must monitor replication and perform a replication- and-restart operation before the binary log grows to 2GB. Replication can be configured in a number of forms. The simplest and most widely used form of replication is with one master and one or more slaves. Replication can also be configured with more than one master though only one is active at any time. Finally, replication can be configured in a two-way format where updates are logged back to the master. Two-way replication can create problems such as when there is an update for the same record received at the same time. MySQL enables the administrator to choose the data to replicate. The data can be selected with granularity down to the table level. Therefore, you can replicate all databases on the server, only certain databases, or simply a table. Additionally, you can select tables with wildcard-like matching and even select a table or tables not to include while including all others. The values for auto_increment columns are automatically updated as part of the replication process. No need to worry about the values becoming skewed between replication participants.
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Leave a Reply