Yesterday was Groundhog Day, and while for Bill Murray it meant living in a personal nightmare of awfulness, it doesn’t have to mean the same for your business. Sometimes repeating something can be a good thing – for example, repeatedly being hugged by a pug. Matt, one of our extremely knowledgeable tech team, explains how server replication can help protect your data for Windows.
Windows comes with a Role Service called DFS (Distributed File System) Replication. In basic terms, it means that you select folders on servers that you want to replicate content between. So for example, if you had two or more web servers and all your websites were stored in D:\xxxx\websites, you could replicate content between the web servers so that you only need to upload content once. So, if you upload content to any of the servers that are part of the replication group, it will also replicate to the others (deleting files works in the same way – delete from one and it will delete from them all). This requires the servers involved to be part of an Active Directory domain. DFS replication works really well to ensure that web content is consistent across all servers.
With DFS, you can also add a ‘namespace’ (basically a virtual directory). It decides which server to send your request to – usually the closest. You could map a namespace (i.e.\\DomainName\websites) to D:\xxxx\websites and this would go to one of the web servers. This is better than referencing an individual server for content (i.e. WEB-01) as if that server goes down, then WEB-02 would carry on serving content. A name space can also be used within IIS to used ‘shared configuration’ – this means that any websites that you configure in IIS only need to be configured on one server, which is then replicated to the other web servers using the same shared configuration.
There’s no license for this – it can just be added to Windows 2008 and up.
Mirroring replicates database content from the principle server to the mirror server in real time (synchronous or asynchronous). SQL Mirroring includes a principle server (primary), mirror server (secondary) and an optional witness server (used to check if things are online for automatic failover). Mirroring is done at the database level and so the principle and mirror server roles can swap between the two. If the principle server goes down, then the mirror server will start its replicated database up and continue to serve content to applications/users etc.
This requires at least the standard edition of SQL on the primary and mirror.
This is a new feature to SQL 2012 and kind of combines SQL Mirroring and Clustering (or mirroring on steroids!). This includes an SQL server known as the ‘primary replica’ and up to four ‘secondary replicas’. The primary replica instance is read/write (the database can be read from and updated). The secondary replicas can be configured as read only (they can’t be written to, but can be read from – good for spreading the load for reporting and other read operations). Availability Groups are a group of databases which failover together; so having two Availability Groups configured can allow one of the Availability Groups to be active on one node, and the other to be active on a second node. Backups can also be configured to run on the secondary replica to remove the performance degradation from the ‘live’ database. Data is replicated from the primary replica to the secondary replicas in real time (synchronous or asynchronous) and can include automatic failover.
The advantage of this over mirroring, is that in mirroring you can only have two nodes (one active, one passive) and the mirror databases cannot be accessed at all (whereas with AlwaysOn, you can read from the secondary ones and also back up from them). AlwaysOn Availability Groups are part of a Windows Failover Cluster and requires the Enterprise edition of SQL.
So, a back to basics summary is – multiple copies of your data being available could mean no downtime in the event of a server failure. It also improves high availability, online presence and business continuity!