Enabling Encyption on an Unencrypted Alpha

We could do a db.flatten to do the compaction (and hence encryption) of all the tables at higher levels. And then, run some compaction in the background for the lowest level.

The value log would need to be rewritten – but that’s doable too. We have the mechanisms to do all these, just have to plug them to the right switches.

It would be convenient to our users who have a lot of data. But, you could also argue that switching to encryption is a one time decision, and having to do a backup and restore isn’t too much to ask if they do decide to switch to encryption.

So, we should weigh the code complexity of forcing a rewrite of every table and value log in Badger, over the benefit of turning on encryption over an existing plain-text database.