4 ms·
I'd like to hear comparisons between Leveldb and Berkeley DB. I'm using LDB in my most-recent project. I wrote a trivial HTTP wrapper around it using Mongoose
by luser001 15y ago
I'd like to hear comparisons between Leveldb and Berkeley DB.
I'm using LDB in my most-recent project. I wrote a trivial HTTP wrapper around it using Mongoose to make it a "server". :)
I like the snapshotting feature, the support for transactions, the built-in support for accessing the db from multiple threads, and that it maintains keys in sorted order (this great for timestamped keys like I have).
I looked at BDB a while back, and IIRC it doesn't have snapshotting and sorted keys. Unsure about threads.
I use the snapshotting feature dump a backup copy of the database.
The BDB API seemed significantly more complex than Leveldb's. IIRC, the native API is C.
I like C++ and like that Leveldb's native API is C++. It uses the standard library string (which allows embedding null characters).
- teraflop 15y ago> I looked at BDB a while back, and IIRC it doesn't have ... sorted keys. I'm not familiar enough with Berkeley DB to comment on the rest, but it definitely supports B-tree indexes which store keys in sorted order.
- btbuilder 15y agoBerkeley DB has many features and many modes. This, IMHO is part of the reason it has a steep learning curve (and why others have had a bad experience with it). It is easy to programmatically configure it incorrectly. E.g. not use transactions when you should, fail to deal with deadlocks or not clean up locks of failed threads or processes. Some of the mature features it has are: Page-level locking for concurrency via threading and multi-process. Snapshot isolation for MVCC - you can get a high isolation level without read locks. Nested transactions. B-tree indexes. Two-phase commit. You can also throw all this out the window and use an in-memory database or non-durable The newer versions even have replication. BDB is a hard beast to tame properly, but is definitely fully featured, and mature. The Oracle paper on the BDB backed SQLite makes an interesting read.