{"id":650,"date":"2010-11-03T10:28:00","date_gmt":"2010-11-03T10:28:00","guid":{"rendered":"\/blogs\/paul\/post\/In-defense-of-transactional-replication-as-an-HA-technology.aspx"},"modified":"2017-04-13T09:51:26","modified_gmt":"2017-04-13T16:51:26","slug":"in-defense-of-transactional-replication-as-an-ha-technology","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/","title":{"rendered":"In defense of transactional replication as an HA technology"},"content":{"rendered":"<p>\n<font face=\"verdana,geneva\" size=\"2\">Yesterday on Twitter a few people expressed disgust at a conference slide listing transactional replication as a high-availability (HA) technology. I took exception to that and argued. I think the discussion merits a blog post so here it is. This point of view is&nbsp;controversial and I&#39;m expecting some dissenting&nbsp;comments &#8211; bring them on! <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">I teach high-availability inside Microsoft and at the MCM level and I absolutely always teach that transactional replication, and it&#39;s more advanced brother &#8211;&nbsp;peer-to-peer replication,&nbsp;have&nbsp;their place as a high-availability technology. The two whitepapers on high availability I&#39;ve written for Microsoft over the last two years also discuss transactional replication as a high-availability technology (links later). <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">To start with, let&#39;s define a&nbsp;high-availability technology as one which makes data more highly available in the event of a disaster. That definition does not imply any limits on the amount of data loss or downtime experienced &#8211; and to do so would be incorrect. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">As some background, many people approach HA planning the wrong way &#8211; either by trying to shoe-horn a new strategy onto an incumbent and unsuitable technology or just picking the technology they&#39;ve heard of &#8211; which is most commonly failover clustering. Planning an HA strategy means carefully laying out the business requirements, considering technical and non-technical limitations, reaching a compromise between the technologists and the business managers, and THEN starting to evaluate technologies. Once you start evaluating technologies you&#39;ll find that no single HA technology that SQL Server provides is a one-size-fits-all solution &#8211; they all have pros and cons. The resulting strategy will likely utilize multiple technologies to meet the strategy&#39;s needs. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">You can read in more depth about my HA planning methodology in the whitepaper I wrote for Microsoft last year: <\/font><a href=\"https:\/\/msdn.microsoft.com\/Areas\/Epx\/Content\/500.htm?aspxerrorpath=\/en-us\/library\/ee523927.aspx\"><font face=\"verdana,geneva\" size=\"2\">High Availability with SQL Server 2008<\/font><\/a><font face=\"verdana,geneva\" size=\"2\">. This also has a good overview of transactional and peer-to-peer replication. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">There are&nbsp;seven main arguments I hear against transactional replication as an HA technology &#8211; I&#39;ll take them on one at a time. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Argument 1: It&#39;s a scale-out technology, not an HA technology<\/strong> <\/font><\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">So where&#39;s the actual argument here? Sure, transactional replication and it&#39;s more advanced brother, peer-to-peer replication, are primarily query scale-out technologies. But both provide extra copies of some data, so both can be used to provide higher availability of that data&nbsp;in the event of a disaster. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Argument 2: There&#39;s too much latency involved &#8211; how can that be HA?<\/strong> <\/font><\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">High availability does not mean zero data loss and zero downtime. High availability means the data is more available in the event of a disaster than if you had no redundant copy. Sure, there is some latency involved with transaction replication but there&#39;s also latency involved with log shipping, and with asynchronous database mirroring.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">The key is making sure that the availability provided by the technology&nbsp;fits within your desired downtime and data loss SLAs (service level agreements) &#8211; commonly known as RTO (recovery time objective) and RPO (recovery point objective), respectively. If you&#39;re fine with potentially losing 1\/2 hour of data, and the transactional replication latency between the Publisher and Subscriber is only 10 minutes, then transactional replication can meet your data loss requirements. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Argument 3: It&#39;s really hard to know what you&#39;re missing if the Publisher crashes<\/strong> <\/font><\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Correct. But it&#39;s just the same as the other asynchronous technologies &#8211; log shipping and asynchronous database mirroring &#8211; so this is not a valid argument against transactional replication. <\/font>\n<\/p>\n<p>\n<strong><font face=\"verdana,geneva\" size=\"2\">Argument 4: Replication is too complicated to set up <\/font><\/strong>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">This argument is asinine IMHO. A technology may be complicated to use or troubleshoot, but that does not make it unsuitable &#8211; it just means you have to have someone who knows what they&#39;re doing. I&#39;ve seen people mess up configuring log shipping &#8211; does that mean it&#39;s not an HA technology? No. Failover clustering can be fiendishly difficult to set up at the Windows level &#8211; does that mean it&#39;s not an HA technology? No. This argument is also invalid. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Argument 5: It only replicates some of the data<\/strong> <\/font><\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Correct. This means it&#39;s unsuitable if you&#39;d like to protect an entire database or several databases &#8211; but if its restrictions work for you, no problem. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Argument 6: You can&#39;t make certain schema changes on a published table<\/strong> <\/font><\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Correct. But that doesn&#39;t mean it&#39;s not suitable for providing HA &#8211; as long as you can live with its restrictions. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Argument 7: There&#39;s no automatic failure detection or automatic failover<\/strong> <\/font><\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Correct. But neither does log shipping. This just means you have to provide the mechanisms for this. Transactional replication still means your data is available if the Publisher crashes. <\/font>\n<\/p>\n<p>\n<strong><font size=\"2\">[Edit: Argument 8: There&#39;s no easy way to fail back again<\/font><\/strong>\n<\/p>\n<p>\n<font size=\"2\">Correct &#8211; for transactional replication &#8211; that can be a PITA. With peer-to-peer replication that problem disappears because the changes that happened while one peer node was down are automatically pushed to it when it comes back online.]<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Arguments FOR using transactional replication<\/strong> <\/font><\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">So these arguments are really saying that transactional replication has some restrictions. Sure it does. As I said above, no single HA technology is a one-size-fits-all. Now, what about all the good things about transactional replication? <\/font>\n<\/p>\n<ul>\n<li><font face=\"verdana,geneva\" size=\"2\">It only replicates the data you&#39;re interested in. Unlike log shipping or database mirroring, transactional replication only ships changes to the data you&#39;re interested in, rather than the entire database. Yes, there are applications where this is good. And it can be especially useful if you have to perform regular index maintenance on large indexes and you don&#39;t have the network bandwidth to ship transaction log for these.<\/font><\/li>\n<li><font face=\"verdana,geneva\" size=\"2\">It works in the SIMPLE recovery model, unlike log shipping or database mirroring, where you MUST be in the FULL recovery model (BULK_LOGGED is also permissible with log shipping). You don&#39;t have to perfom log management with log backups just because you&#39;re using an HA technology. Yes, there are strategies who don&#39;t want to be able to restore the entire database to a point in time.<\/font><\/li>\n<li><font face=\"verdana,geneva\" size=\"2\">You can have as many Subscribers as you want. Well, to a point. You need to be careful of network bandwidth from the Distributor, the Distribution Agent location&nbsp;(especially if they&#39;re all push subscriptions), and some other things. Log shipping also allows as many secondaries as you want but database mirroring can only have one mirror.<\/font><\/li>\n<li><font face=\"verdana,geneva\" size=\"2\">You can make use of republishing (having a Subscriber that is also a Publisher to down-stream Subscribers), which allows some interesting topologies and balancing of network traffic. No other SQL Server HA technology allows this.<\/font><\/li>\n<li><font face=\"verdana,geneva\" size=\"2\">The replicated data is available for reading and updating on both sides (and changes can then be published again using updateable subscriptions, or more easily with peer-to-peer replication). No other SQL Server HA technology allows this and this is one of the primary reasons why transactional replication is sometimes the necessary choice.<\/font><\/li>\n<li><font face=\"verdana,geneva\"><font size=\"2\">There&#39;s no wait time when a failover is necessary &#8211; the data is just there. With log shipping, recovery has to complete &#8211; which could take a while for any uncommitted transactions to roll back. With database mirroring, the REDO queue on the mirror must be recovered before the mirror database can come online as the principal.<strong>&nbsp;<\/strong><\/font><\/font><\/li>\n<\/ul>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Summary<\/strong> <\/font><\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">It all comes down to making rational choices of technologies based on the HA strategy requirements and limitations. Transactional replication will work for some of you, and not for others &#8211; it has its limitations just like the other SQL Server HA technologies. But it should never be dismissed out-of-hand as not being a high availability technology.<\/font>\n<\/p>\n<p>\n<font size=\"2\">Take a look at the whitepaper I wrote for Microsoft this year &#8211; <a href=\"http:\/\/download.microsoft.com\/download\/5\/B\/D\/5BD13FFA-5E34-4AE1-9AA0-C6E6951B8FC8\/SQL%20Server%202008%20R2%20High%20Availability%20Architecture%20White%20Paper.docx\">Proven SQL Server Architectures for High Availability and Disaster Recovery<\/a> &#8211; where one of the five real-world customer examples (with customer names, case studies, etc) is about using transactional and peer-to-peer replication. That example links to a very comprehensive document the SQL CAT team wrote about the decision process that led to using transactional replication and all the setup and tuning that was done.<\/font>\n<\/p>\n<p>\n<font size=\"2\">[Edit: one more whitepaper I wrote in 2008 that you might be interested in: <a href=\"http:\/\/download.microsoft.com\/download\/d\/9\/4\/d948f981-926e-40fa-a026-5bfcf076d9b9\/ReplicationAndDBM.docx\">SQL Server Replication: Providing High Availability using Database Mirroring<\/a>.]<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Thanks for reading! <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">PS If you post a comment and it doesn&#39;t appear it&#39;s because I&#39;m moderating comments against spam &#8211; not to filter out dissention. Be patient and it will appear! <\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday on Twitter a few people expressed disgust at a conference slide listing transactional replication as a high-availability (HA) technology. I took exception to that and argued. I think the discussion merits a blog post so here it is. This point of view is&nbsp;controversial and I&#39;m expecting some dissenting&nbsp;comments &#8211; bring them on! I teach [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,75],"tags":[],"class_list":["post-650","post","type-post","status-publish","format-standard","hentry","category-high-availability","category-replication"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>In defense of transactional replication as an HA technology - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"In defense of transactional replication as an HA technology - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"Yesterday on Twitter a few people expressed disgust at a conference slide listing transactional replication as a high-availability (HA) technology. I took exception to that and argued. I think the discussion merits a blog post so here it is. This point of view is&nbsp;controversial and I&#039;m expecting some dissenting&nbsp;comments &#8211; bring them on! I teach [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2010-11-03T10:28:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:51:26+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/\",\"name\":\"In defense of transactional replication as an HA technology - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2010-11-03T10:28:00+00:00\",\"dateModified\":\"2017-04-13T16:51:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"In defense of transactional replication as an HA technology\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"In defense of transactional replication as an HA technology - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/","og_locale":"en_US","og_type":"article","og_title":"In defense of transactional replication as an HA technology - Paul S. Randal","og_description":"Yesterday on Twitter a few people expressed disgust at a conference slide listing transactional replication as a high-availability (HA) technology. I took exception to that and argued. I think the discussion merits a blog post so here it is. This point of view is&nbsp;controversial and I&#39;m expecting some dissenting&nbsp;comments &#8211; bring them on! I teach [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/","og_site_name":"Paul S. Randal","article_published_time":"2010-11-03T10:28:00+00:00","article_modified_time":"2017-04-13T16:51:26+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/","name":"In defense of transactional replication as an HA technology - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2010-11-03T10:28:00+00:00","dateModified":"2017-04-13T16:51:26+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/in-defense-of-transactional-replication-as-an-ha-technology\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"In defense of transactional replication as an HA technology"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=650"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/650\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}