The snapshot or copy of the database blocks concurrent database operations from other threads and processes.
To test within the same process I exposed the Kyoto Cabinet methods by JMX and tried to set
or get
any value from the database while concurrently a snapshot or a copy were being in progress.
Methods set
and get
were waiting for the concurrent snapshot or copy to finish.
I found a part of the documentation that covers the issue. It mansions the cache hash database but it looks like the other database implementations behaves similarly:
Chiefly for the cache hash database and the cache tree database, the "pseudo-snapshot" mechanism is provided. The
BasicDB::dump_snapshot' dumps all records into a stream or a file. The
BasicDB::load_snapshot' method loads records from a stream or a file. Although the operations are performed atomically, they don't finish momentarily but take time in proportion of the database size with blocking the other threads. Because the format of pseudo-snapshot data is common among the all database classes, it is useful to migrate records for each other.db.dump_snapshot("backup.kcss"); db.load_snapshot("backup.kcss");