Why Dedupe is a Bad Idea for SQL Server Backups

Has your SAN admin or CIO been telling you not to compress your SQL Server backups because they’re doing it for you with a dedupe tool like EMC’s Data Domain?  I’ve been hearing from a lot of DBAs who’ve been getting this bad advice, and it’s time to set some records straight.

The Basics of Storage Deduplication

Dedupe appliances basically sit between a server and storage, and compress the storage.  Sometimes they do it by identifying duplicate files, and sometimes they do it by identifying duplicate blocks inside files.  It isn’t like traditional compression because the process is totally transparent to anything that stores files on a deduped file share – you can save an Excel file to one of these things without knowing anything about dedupe or installing any special drivers.  In theory, this makes dedupe great because it works with everything.

The key thing to know about dedupe, though, is that the magic doesn’t happen until the files are written to disk.  If you want to store a 100 megabyte file on a dedupe appliance, you have to store 100 megabytes – and then after you’re done, the dedupe tool will shrink it.  But by that point, you’ve already pushed 100 megabytes over the network, and that’s where the problem comes in for SQL Server.

Dedupe Slows Down SQL Server Backups

In almost every scenario I’ve ever seen, the SQL Server backup bottleneck is the network interface or the drives we’re writing to.  We DBAs purposely set up our SQL Servers so that they can read an awful lot of data very fast, but our backup drives have trouble keeping up.

That’s why Quest LiteSpeed (and SQL 2008′s upcoming backup compression) uses CPU cycles to compress the data before it leaves the server, and that’s why in the vast majority of scenarios, compressed backups are faster than uncompressed backups.  People who haven’t used LiteSpeed before think, “Oh, it must be slower because it has to compress the data first,” but that’s almost never the case.  Backups run faster because the CPUs were sitting around idle anyway, waiting for the backup drive to be ready to accept the next write.  (This will really ring true for folks who sat through Dr. DeWitt’s excellent keynote at PASS about CPU performance versus storage performance.)

With dedupe, you have to write the full-size, uncompressed backup over the network.  This takes longer – plain and simple.

Dedupe Slows Down Restores Too

The same problem happens again when we need to restore a database.  At the worst possible time, just when you’re under pressure to do a restore as fast as possible, you have to wait for that full-size file to be streamed across the network.  It’s not unusual for LiteSpeed customers to see 80-90% compression rates, meaning they can pull restores 5-10 faster across the network when they’re compressed – or in comparison, deduped restores will take 5-10 times longer to copy across the network.  Ouch.

It gets worse if you verify your backups after you finish.  You’re incurring the speed penalty both ways every time you do a backup!

And heaven help you if you’re doing log shipping.  That’s the worst dedupe candidate of all: log shipping does restores across one or more SQL servers, all of which are hammering the network to copy these full size backups back and forth.

So Why Do SAN Admins Keep Pushing Dedupe?

Dedupe makes great sense for applications that don’t compress their own data, like file servers.  Dedupe can save a ton of backup space by compressing those files, saving expensive SAN space.

SAN admins see these incoming SQL Server backups and get frustrated because they don’t compress.  Everybody else’s backups shrink by a lot, but not our databases.  As a result, they complain to us and say, “Whatever you’re doing with your backups, you’re doing it wrong, and you need to do it the other way so my dedupe works.”  When we turn off our backup compression, suddenly they see 80-90% compression rates on the dedupe reports, and they think everything’s great.

They’re wrong, and you can prove it.

They don’t notice the fact that we’re storing 5-10x more data than we stored before, and our backups are taking 5-10x longer.  Do an uncompressed backup to deduped storage, then do a compressed backup to regular storage, and record the time differences.  Show the results to your SAN administrator – and perhaps their manager – you’ll be able to explain why your SQL Server backups shouldn’t go to dedupe storage.

In a nutshell, DBAs should use SQL Server backup compression because it makes for 80-90% faster backups and restores.  When faced with backing up to a dedupe appliance, back up to a plain file share instead.  Save the deduped storage space for servers that really need it – especially since dedupe storage is so expensive.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

50 Responses to Why Dedupe is a Bad Idea for SQL Server Backups
  1. Ray
    March 9, 2011 | 6:27 PM

    This is a great thread. I’d be curious what your thoughts are around leaving LiteSpeed compression on but turning LiteSpeed encryption off and still using Data Domain as the backup target. This way the amount of data traversing the network is minimized, you’ll still get some additional compression/dedupe in Data Domain on top of the LiteSpeed compression and your backups will be hardware encrypted and replicated to a remote site.

    • Brent Ozar
      March 10, 2011 | 2:52 PM

      Ray – since space is at a very expensive premium when using Data Domain, it doesn’t usually make sense to land SQL Server backups on Data Domain to get a very small percentage of compression. It’s not a good ROI on storage expenses, and it’s easier/cheaper to use conventional SAN replication. Hope that helps!

  2. Hmm
    March 30, 2011 | 9:58 PM

    So much concern about network bandwidth limiting the backup speed… but in a 10Gb/s LAN or upcoming FCOE network the read capacity of the SQL server spindles becomes the bottleneck. Dedup do have real cost savings and you should have your network fixed first :-)

    • Brent Ozar
      March 30, 2011 | 10:01 PM

      Generally, people who are trying to save a small amount on backup space don’t spend a large amount on 10Gb Ethernet. 10Gb is still staggeringly expensive compared to gig. If you’ve already put in the massive investment for 10G, though, then dedupe makes sense – but that’s an awfully small percentage of companies, wouldn’t you agree?

  3. Confused
    June 24, 2011 | 9:00 AM

    Great post. Learnt a lot from DBA perspective. I am a backup guy so I guess I am auto-fitting into your mentioned Storage Admin role : )

    One point to consider is – while your view on the first or single backup is very valid (regarding the trade-off between bandwidth & CPU cycles), I am wondering is when we are doing multiple backup on the same database and need to retain them on online? Won’t the subsequent backup be benefits by already having majority of the database contents stored?

    Plus, the EMC Data Domain already is supporting a “Boost” protocol – in effects, all data leaving the DB server is already in deduplicated format (requirement – the DB server has to run as a Media Server). Would this neturalized the bandwidth concern as well?

    • Brent Ozar
      June 24, 2011 | 9:02 AM

      Patrick – about multiple backups of the same database, no, there’s no reduction of network traffic just because a bunch of duplicate data already exists on the Data Domain appliance.

      The Boost protocol is something else, though – by doing that, it may reduce the bandwidth concern as long as wherever you restore the database is also a Media Server. That’s rarely the case in QA/dev/DR environments because licensing ain’t free. Cha-ching…

  4. WAN accel
    September 12, 2011 | 4:46 PM

    I too would hate to lose our SQL backup compression, as we saw backup times drop to 40% of pre-2008 times. Our SAN admins are pushing hard toward dedupe, but more so to Riverbed WAN accelerator appliances.

    These accelerators work on the same dedupe ideas (and thus will not work well with compressed SQL backups). I assume this is similar to the aforementioned Boost protocol, but Media Server not required.

    So my question is… would the benefits of both a dedupe device and Riverbed accelerators trump the cons of uncompressed backups?

Leave a Reply

Wanting to leave an <em>phasis on your comment?

Notify me of followup comments via e-mail. You can also subscribe without commenting.