Is it safe to use embedded database (RocksDB, BoltDB, BadgerDB) on DigitalOcean block storage?

681 Views Asked by At

DigitalOcean block storage uses ceph which means that volume attached to the droplet would be physically located on a different machine. So a database file written to this volume would be using network, not the local disk.

BoltDB specifically mentions that it's not safe to use over network file system, but I'm not sure if that also applies to DO block storage (it's not NFS, but it does use network).

Is it safe to use DO block storage for embedded databases? Yes, performance would be not as good, but that is not relevant if it's entirely not safe.

If the answer is "no, embdeeded databases should only use local disk", then what are the simple ways to replicate the database (e.g. just once a day or few hours)?

1

There are 1 best solutions below

0
On

Is it safe to use embedded database (RocksDB, BoltDB, BadgerDB) on DigitalOcean block storage?

Yes, it is safe to use

then what are the simple ways to replicate the database (e.g. just once a day or few hours)?

Put a timer thread in your app that creates a checkpoint/backup and uploads it to s3 and also snapshot the instance