<p>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.</p>

<p>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?<br>
What options do I have in terms of how often the slave db mirrors the data? (real time/every x minutes?).</p>

[{'answer_id': 12973, 'author': 'Jarod Elliott', 'author_id': 1061, 'author_profile': 'https://Stackoverflow.com/users/1061', 'pm_score': 0, 'selected': False, 'text': '<p>The answer to this will vary depending on the database server you are using to do this.</p>\n\n<p>Edit: Sorry, maybe i need to learn to look at the tags and not just the question - i can see you tagged this as sqlserver.</p>\n'}, {'answer_id': 12979, 'author': 'jeremcc', 'author_id': 1436, 'author_profile': 'https://Stackoverflow.com/users/1436', 'pm_score': 4, 'selected': True, 'text': '<p>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.</p>\n\n<p><a href="http://blogs.techrepublic.com/howdoi/?p=123" rel="nofollow noreferrer">Here is a pretty good walk through of how to set it up.</a></p>\n'}, {'answer_id': 13031, 'author': 'vzczc', 'author_id': 224, 'author_profile': 'https://Stackoverflow.com/users/224', 'pm_score': 2, 'selected': False, 'text': '<p>SQL Server 2008 has three different modes of replication.</p>\n\n<ul>\n<li><a href="http://msdn.microsoft.com/en-us/library/ms151706.aspx" rel="nofollow noreferrer">Transactional</a> for one way read only replication</li>\n<li>Merge for two way replication</li>\n<li>Snapshot</li>\n</ul>\n'}, {'answer_id': 13162, 'author': 'Ryan', 'author_id': 1545, 'author_profile': 'https://Stackoverflow.com/users/1545', 'pm_score': 2, 'selected': False, 'text': '<blockquote>\n  <p>From what I understand, the slave/readonly database is to use the master db\'s transaction log file to mirror the data correct?\n  What options do I have in terms of how often the slave db mirrors the data? (real time/every x minutes?).</p>\n</blockquote>\n\n<p>This sounds like you\'re talking about log shipping instead of replication. For what you\'re planning on doing though I\'d agree with <a href="https://stackoverflow.com/users/1436/jeremy-mccollum">Jeremy McCollum</a> and say do transactional replication. If you\'re going to do log shipping when the database is restored every x minutes the database won\'t be available.</p>\n\n<p>Here\'s a good walkthrough of the difference between the two. Sad to say you have to sign up for an account to read it though. =/ <a href="http://www.sqlservercentral.com/articles/Replication/logshippingvsreplication/1399/" rel="nofollow noreferrer">http://www.sqlservercentral.com/articles/Replication/logshippingvsreplication/1399/</a></p>\n'}, {'answer_id': 253769, 'author': 'Samiksha', 'author_id': 29515, 'author_profile': 'https://Stackoverflow.com/users/29515', 'pm_score': 0, 'selected': False, 'text': '<p>Transactional replication is real time.</p>\n\n<p>If you do not have any updates to be done on your database , what you need is just retrieving of data say once a day : then use snapshot replication instead of transactional replication. In snapshot replication, changes will replicate when and as defined by the user say once in 24 hrs.</p>\n'}]
['https://Stackoverflow.com/questions/12946', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1368/']