Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database replication. 2 servers, Master database and the 2nd is read-only

Say you have 2 database servers, one database is the 'master' database where all write operations are performed, it is treated as the 'real/original' database. The other server's database is to be a mirror copy of the master database (slave?), which will be used for read only operations for a certain part of the application.

How do you go about setting up a slave database that mirrors the data on the master database? From what I understand, the slave/readonly database is to use the master db's transaction log file to mirror the data correct?
What options do I have in terms of how often the slave db mirrors the data? (real time/every x minutes?).

like image 419
public static Avatar asked Aug 16 '08 01:08

public static


2 Answers

What you want is called Transactional Replication in SQL Server 2005. It will replicate changes in near real time as the publisher (i.e. "master") database is updated.

Here is a pretty good walk through of how to set it up.

like image 97
jeremcc Avatar answered Oct 30 '22 17:10

jeremcc


SQL Server 2008 has three different modes of replication.

  • Transactional for one way read only replication
  • Merge for two way replication
  • Snapshot
like image 39
vzczc Avatar answered Oct 30 '22 16:10

vzczc