Pages

Monday, May 18, 2009

Replication... small note

What is Replication



In Simple words, Replication is the simply process of copying data from one location to another.In MySQL database server, Master is main server from which data to be copied and Slave is the server on which data copied.Replication is asynchronous - means your replication slaves do not need to be connected permanently to receive updates from the master,depending on the configuration, you can replicate all databases, selected databases, or even selected tables within a database.
Some of the most common reasons for using replication are described as follows:
Performance :
This is where user can access shared data with different server, which means distributing load from main server, and also improves performance of the main system
Separating Data Entry and Reporting: Working in an environment in which the same database is used for data entry and reporting,you probably know that things aren't always rosy. sometimes you may see that tables are locked for transaction updates, or some of costly reporting queries slow down database performance byusing its resources, Replication provides great help for these issues in which translations are fired on main database (master)while reports are being separated to run on replicated database (slave), which internally improves performance at both endsfor transactions as well as reports.(this solution is best suited if you are not using reports which requires real time data of few sec/min ago or so)
Providing High Availability: Occasionally, you might consider using replication for high availability; that is, to replicate transactions from the main server to a standby server. If the main server fails, you can then point your data sources to the standby server.Replication does not provide any sort of automatic fail-over by itself.Be aware that using replication for high availability takes careful planning and testing.
Mass deployment: Replication can be used to distribute data over multiple regional locations. Then, applications can access various regional servers instead of accessing one central server. This configuration can reduce network load dramatically.
Reduce Data loss to backup: Replication doesn't mean backup of the data. but certainly it can be an alternative to backup data to minimize data lossReplication is the only technology that can satisfy the needs of the most demanding systems, as only replication can provide instant access to data and zero data loss (minimal Recovery Point Objective or RPO and minimal Recovery Time Objective or RTO). Backup is still the cornerstone of a solid disaster recovery strategy, but since backups are usually run only once a day there is a high risk of losing large amounts of data and also having systems being offlinefor long periods of time (the Recovery Point Objective and Recovery Time Objective for backup is usually days, whereas with replication it is usually minutes or seconds).

As we know, backup process always requires data locks on database server while in process (so that no data loss happens) and so it is difficult to take database backup from online transactional database during day (which cause data loss in failure)but with replication we can reduce this problem in a way that

1 main database is free, and need not to be locked during backup process (which gives high avaibility 24x7)

2 Replication gives exact snapshot of main database and so can be used by backup process to take backup instead of connecting to main server

3. Replication gives choice to use as alternate system in fail over or recover data from (slave/backup ) during system down.



imp links for further reading
http://msdn.microsoft.com/en-us/library/aa164940(office.10).aspx

Why Use Replication?

http://www.ameinfo.com/48329.html
for details of implementation and usage in MySQL

http://dev.mysql.com/doc/refman/6.0/en/replication.html

replication on Linux tutorial

http://librenix.com/?inode=8118

No comments:

Post a Comment