Software Development Resources
Create account | Log in | Log in with OpenID | Help

Database replication

From DocForge

Database replication is the process of duplicating database servers in near real-time, usually across multiple physical servers. It's usually implemented to increase overall application performance by distributing queries or to have an always-ready backup.


[edit] Benefits

  • Overall software system performance can be improved by distributing queries among multiple database servers. Just as multiple processors allow one computer to perform two tasks simultaneously, multiple servers allow one software system to execute two queries simultaneously.
  • Replicating to special-purpose databases can further improve performance. For example, one server can be optimized for read-only reporting while another server is optimized for incoming user data. Replication keeps the data in sync.
  • Replicating data immediately to another server can provide backup and redundancy. If the primary database fails the system can be switched to the replicated backup with little or no data loss. Ideally an automatic fail-over, such as through a load balancer, will even make the switch seamless to end users.

[edit] Drawbacks

  • In some scenarios programming for database replication can be complicated. More development time might be required than for a single database system.
  • Latency and other issues might cause a delay and backlog in replication between servers. Therefore extra system monitoring and administration is important.
  • In high performance systems it might be more beneficial to improve the hardware of one database server than to replicate and offload queries to a second database server. Careful analysis and performance tests should be performed before choosing between hardware upgrades and replication.

[edit] Types of Database Replication

Master/Slave Replication
One or more servers are designated masters, sending queries or data to slaves on a periodic or continual basis. Masters may notify slaves of pending updates or slaves may poll the master for changes.

[edit] Database Servers Supporting Replication

Many database servers have built-in support for various forms of replication.

[edit] See Also