Closed ronag closed 2 years ago
Do LevelDB and RocksDB have such APIs?
RocksDB does. Will need to check LevelDb.
LevelDb doesn’t but as far I can see just writing an empty batch with sync true should be sufficient to emulate it.
OK. In that case it can just be a rocks-level
feature. I don't see a point to emulating it for LevelDB (if the purpose is to have a more efficient mechanism than sync: true
) and it shouldn't be part of the abstract-level
interface anyway (even if LevelDB did support it).
I believe an API with a
flush()
andflushSync()
method would be more efficient than having async
parameter to each call and probably provide the same functionality.