Enabling Encyption on an Unencrypted Alpha

I am not in favour of rewriting the value log just to enable encryption. When a value log (.vlog) file is rewritten, we insert more keys in the systems. If the existing database had X keys, after the value log rewrite, we will have 2X keys in the system. Each key foo will have a corresponding !badger!move!foo key (That’s how badger vlog GC works currently). The move keys are unnecessary overhead for badger. The system will have more compactions, the lookup will be slower. Also, the move keys don’t get removed from the system easily (this is a known issue).

You could try to avoid !badger!move! keys by reading and reinserting the same data in badger but then this would be similar to what backup/restore would do

In short, enabling encryption via value log rewrite will be expensive in terms of CPU, might insert more data in the database and it will be slow.

Backup-restore is much faster compared to table/vlog rewrite and we don’t have to write any new code (except adding a new flag). The existing badger backup-restore already does this.

1 Like