看到「Amazon DocumentDB announces improvements to document compression」這則公告提到 Amazon DocumentDB 5.0 支援壓縮了:
These compression benefits are now supported in Amazon DocumentDB 5.0 instance-based clusters in all regions where Amazon DocumentDB is available.
官方宣稱可以壓七倍:
Compressed documents in Amazon DocumentDB can be up to 7 times smaller than uncompressed documents, leading to lower storage costs, I/O costs, and improved query performance.
在「Managing collection-level document compression」這份文件裡面則是提到演算法是 LZ4:
Amazon DocumentDB uses the LZ4 compression algorithm to compress documents.
因為大家都猜 DocumentDB 後面是 PostgreSQL,所以我就查了一下 PostgreSQL 這邊的資料,可以從 PostgreSQL 14.0 (2021/09/30) 的 Release Notes 看到支援 LZ4:
Add ability to use LZ4 compression on TOAST data (Dilip Kumar)
This can be set at the column level, or set as a default via server parameter default_toast_compression. The server must be compiled with --with-lz4 to support this feature. The default setting is still pglz.
而 DocumentDB 則是 2019 年一月的時候出的,大概是 DocumentDB 5.0 用到的 PostgreSQL 比較新所以可以支援了...