Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the scenarios for using mirroring, log shipping, replication and clustering in SQL Server

Tags:

As far as i know SQL Server provides 4 techniques for better availability.

I think these are the primary usage scenarios, in summary :-

1) Replication would be primarily suited for online-offline data synchronization scenarios (laptop , mobile devices, remote servers).

2) Log shipping could be used to have a failover server with manual switching, whereas

3) Database Mirroring is an automatic failover technique

4) Failover Clustering is an advanced type of database mirroring.

Am i right ?

Thanks.

like image 558
Chakra Avatar asked Feb 08 '09 12:02

Chakra


People also ask

Under what scenarios would you use log shipping?

Log shipping is useful if you are maintaining a "standby" server as a backup to your primary server, but do not require automatic failover. For information on manually failing over to a log-shipped standby server, see Failing over to a standby server.

What is the difference between log shipping and mirroring in SQL Server?

Log shipping supports an unlimited number of secondary's for each primary database. Database mirroring can operate synchronously or asynchronously. If configured to operate synchronously, the transaction on the principal will not be committed until it is hardened to disk on the mirror.

What is the difference between clustering and mirroring?

Failover clusters provide high-availability support for an entire Microsoft SQL Server instance, in contrast to database mirroring, which provides high-availability support for a single database. Database mirroring works between failover clusters and, also, between a failover cluster and a nonclustered host.

Can log shipping and mirroring configure together?

A given database can be mirrored or log shipped; it can also be simultaneously mirrored and log shipped.


2 Answers

Failover clustering is an availability technology that provides redundancy at the hardware level and is built on top of Windows Clustering technology, i.e. it is not specific to SQL Server.

For example, the processor blows up on Server A. Fortunately Server A is part of a SQL Server Cluster and so Server B takes over the job of providing the SQL Server Service, within a matter of seconds. All of this occurs automatically and is transparent to the database users and or application being served by the cluster.

The main difference between Database Mirroring and clustering is that SQL Clustering provides redundancy at the instance level whereas database mirroring provides redundancy at the database level.

The following link provides a comparison between these two technologies that you may find of use.

http://msdn.microsoft.com/en-us/library/ms191309(SQL.90).aspx

Log shipping is considered more of a redundancy technology.

For example, it can be used to provide a full copy of your primary environment, typically used as a warm standby that can be manually brought online. This can be used to provide additional redundancy to your backup strategy. Log shipping can also be used to offload reporting from a primary server by creating a read only copy of the production database at an alternative location/server.

Replication is quite a diverse technology and can be used to cater for a number of different scenarios, the choice of which will determine the specific type of replication that is implemented.

For example, merge replication can be used to support distributed processing by spreading the workload of an application across several servers, i.e. distributed processing architectures.

Merge replication often requires an application that is relatively aware of its environment. Techniques such as conflict resolution also have to be taken into consideration in order to ensure data consistency across the entire integrated environment.

Transactional Replication can be used in a similar fashion to log shipping however you can limit the specific objects that are replicated to the subscriber. This can be useful if only a subset of tables is required for reporting purposes.

I hope this clears things up for you a little. You can find a wealth of documentation regarding each of these technologies within SQL Server books online, or by searching for each technology in Google. That said if you have any specific queries I would be happy to help so feel free to drop me line.

Cheers, John

like image 183
John Sansom Avatar answered Oct 21 '22 09:10

John Sansom


In SQL 2008 Enterprise there is also something called Change Data Capture (CDC) which we are using successfully where I work.

We have an overly normalized database which makes it too hard to get information out. We needed to change the data structure at the same time as we replicate this data to another server for reports and such.

It works extremely well for us.

like image 31
mhenrixon Avatar answered Oct 21 '22 10:10

mhenrixon