5

I've been using the default (snappy) compression in mongodb with WiredTiger storage engine, and I'd like to switch to zlib. However, I've got some users already active on my application, with data in the database, and I'd like to make sure I make this change with a minimum of disruption. The default would seem to be to simply recreate the database, e.g. by dumping via mongodump and restoring into a new database with zlib compression options, and then to point at the new db. If I do the switch at a time when no users are active, chances are this will do the trick just fine, but I'm wondering whether there is a better way to make the change, e.g. a way to achieve backward-compatibility with the existing db?

In case it's useful context, the need for better compression really only pertains to parts of the data. It's fine if there's a way to switch to zlib compression only for certain documents in the database. Also, in case it matters, I am using perl MongoDB.pm.

P.S. This is my first query to stackoverflow. I've searched for answers and tried to follow the appropriate conventions for question-asking, but if I've gone about things the wrong way please educate me gently. :)

PSR
  • 51
  • 3

0 Answers0