SQL Server 2025: Using ZSTD Compression for SQL Server Backups
SQL Server 2025 introduces a new compression algorithm called ZSTD (Zstandard), which can enhance database backup performance. Using ZSTD allows for greater control over backup performance, particularly concerning CPU usage and backup duration. I recently conducted some preliminary benchmarks comparing ZSTD
at its three compression levels with the existing MS_XPRESS
algorithm. The results are compelling and provide additional options for managing database backup performance effectively.
The Test Setup
I set up two types of tests on a 389.37GB database to highlight the performance characteristics of the backup compression algorithms:
- Performance Isolation Tests: First, I isolated the compression algorithm performance by writing backups to a
NUL
device, allowing precise measurement of read and compression performance without storage write variables. These tests compared:- No compression (NONE) - establishing a baseline
- The established
MS_XPRESS
algorithm available in previous versions - The newly introduced
ZSTD
algorithm at its defaultLOW
setting
- Real-World Performance Tests: Then, I ran complete backups to S3 storage on a Pure Storage FlashBlade to evaluate real-world performance characteristics. These tests compared:
- No compression (NONE) as a baseline reference
MS_XPRESS
(the standard option in previous versions of SQL Server)ZSTD LOW
(default setting)ZSTD MEDIUM
ZSTD HIGH
Compression Speed Results Writing to NUL
When measuring raw compression performance by writing to a NUL
device:
Algorithm | Time (seconds) | Speed (MB/sec) | Average CPU % |
---|---|---|---|
NONE |
94.9 | 4195.7 | 7.0 |
ZSTD |
213.3 | 1867.1 | 52.9 |
MS_XPRESS |
428.7 | 929.0 | 67.8 |
The results reveal some interesting findings:
-
NONE
(no compression) completes and performs 4x faster thanMS_XPRESS
with minimal CPU usage (7.0%). This represents the throughput ceiling for single-threaded reads on this SQL Server instance but provides none of the data reduction benefits of compression. -
ZSTD
The backup finishes in half the time compared toMS_XPRESS
, achieving nearly double the throughput while using less CPU (52.9% vs. 67.8%). This defaultLOW
compression level showsZSTD
s superior efficiency in terms of CPU consumption and backup runtime.
MS_XPRESS
has the slowest performance and the highest CPU utilization, demonstrating the value of SQL Server 2025’s new compression options.
The results above are throughput measured with one reader and four writer threads. We can’t measure backup file set size with this test since we’re writing to NUL
specifically to isolate the performance of the compression algorithms.
Real-World Backup Results Writing to S3
Testing with actual backups shows the trade-offs between compression levels:
Compression Method | Backup Set Size (GB) | Time (seconds) | Speed (MB/sec) | Average CPU % |
---|---|---|---|---|
NONE |
389.37 | 259.8 | 1532.7 | 34.6 |
MS_XPRESS |
218.95 | 441.4 | 902.4 | 84.6 |
ZSTD LOW (Default) |
266.97 | 245.7 | 1621.1 | 80.1 |
ZSTD MEDIUM |
210.76 | 603.1 | 660.4 | 83.2 |
ZSTD HIGH |
209.38 | 1112.5 | 358.0 | 85.4 |
The results reveal some trade-offs:
-
NONE (no compression) provides the second fastest runtime after ZSTD LOW with minimal CPU utilization (34.6%) but results in the largest backup set size (389.37 GB). This represents the baseline for comparing the compression benefits of other algorithms.
-
ZSTD LOW offers an interesting middle ground between
NONE
andMS_XPRESS
. Compared toNONE
, it achieves significant space savings (31% smaller backups) while maintaining similar performance (running 5% faster). When compared withMS_XPRESS
,ZSTD LOW
completes in nearly half the time (44% faster) with comparable CPU utilization (80.1% vs. 84.6%), though it produces larger backup files (266.97GB vs. 218.95GB). This makesZSTD LOW
an excellent choice when backup windows are tight, but you still need reasonable compression. The speed improvement is substantial enough that many organizations can justify the additional storage costs, especially in environments where compute resources are more constrained than storage resources. -
ZSTD MEDIUM produces smaller backups than
MS_XPRESS
(about 4% smaller) but takes 37% longer. This might suit environments where storage costs outweigh backup window concerns or archive backups. -
ZSTD HIGH offers minimal additional compression over
ZSTD MEDIUM
(less than 1%) but takes almost twice as long. This extreme setting is likely only valid in specific scenarios where every gigabyte matters.
This is me testing in my lab with one database. Your mileage will certainly vary for your database’s contents and infrastructure.
Practical Implications
For most environments, ZSTD LOW
offers the best balance of speed improvement without significantly impacting backup windows but at the expense of a slightly larger backup set size.
It’s particularly valuable for:
- Large databases with tight backup windows
- Systems where CPU resources are a concern, you can now more easily control CPU impact than in the past with Resource Governor.
- Environments where backup speed is more critical than storage efficiency
For backups where time is less critical, ZSTD MEDIUM
only has a nominal improvement over MS_XPRESS
and ZSTD HIGH
provided little storage efficiency and CPU utilization benefit.
Conclusion
SQL Server 2025 introduces the ZSTD
compression algorithm, a significant advancement in database backup technologies and performance tuning. The default LOW
setting offers impressive performance improvements that will be advantageous for most environments. It is recommended to test with your specific workloads to identify the optimal configuration for your needs.
For more details on ZSTD
compression in SQL Server 2025, check out Microsoft’s official blog post.