I am glad to announce the new feature just added to litereplica:
Point-in-time Recovery!
Database replication by itself does not guarantee data loss protection. If a table is dropped in the primary replica, it will be dropped in the secondary ones too, leaving no way to restore the data.
With Point-in-time Recovery you can restore the database to a previous point in time, without the need to make backups and with almost no overhead on transactions.
It can be used so in the primary replica as in the slave ones. It can even be used locally without replication at all.
To activate PITR just add pitr=on in the URI filename:
"file:/path/to/file.db?pitr=on"
The binary logs will be stored in a sub-folder named "binlogs". If you want to store them on a different location, use the pitr_path parameter:
"file:/path/to/file.db?pitr=on&pitr_path=logs"
The path is relative to the database path, and you can use an absolute path too.
If you want to limit the space used by the binary logs you can set the pitr_limit parameter.
To limit the total size to an absolute value use the M (for MegaBytes) or k (for KiloBytes) symbols:
"file:/path/to/file.db?pitr=on&pitr_limit=50M"
To limit the total size to a value relative to the database file size use the x symbol:
"file:/path/to/file.db?pitr=on&pitr_limit=20x"
And to limit the amount of log files use the p (points) symbol:
"file:/path/to/file.db?pitr=on&pitr_limit=100p"
It is possible to use many options separated by commas, so the engine will use the lowest limit:
"file:/path/to/file.db?pitr=on&pitr_path=/path/to/logs&pitr_limit=50M,20x,100p"
Feel free to ask questions in the general discussion forum, or via e-mail.