Alternative to BerkeleyDB? [closed]
Asked Answered
I

9

43

I'm looking for a dbm-like library that I can use in place of Berkeley DB, which I'm currently using. My main reason for switching is the licensing fees for BDB are pretty high (free for open source apps, but my employer does not want to open source this particular app for various reasons).

I've looked briefly at qdbm but it doesn't look like it will fill my needs -- lots of keys (several million) and large data items (> 1-5 megabytes). Before I continue my search I figured I'd ask because it seems there are tons of dbm-like libraries out there.

Ia answered 4/11, 2008 at 3:44 Comment(0)
B
31

C/C++

Java

Bakery answered 8/8, 2014 at 9:59 Comment(0)
M
18

You could look at Tokyo Cabinet. Its the successor to qdbm/gdbm, and if you decide to scale has a nice network front-end available.

Edit:

Another variant is Kyoto Cabinet; developed by the same person, but supposedly easier to use.

Midmost answered 14/11, 2008 at 15:16 Comment(0)
J
11

SQLite is public domain, meaning you can use it for any purpose whatsoever, and is widely used and supported.

Janot answered 4/11, 2008 at 3:46 Comment(8)
Good idea, but SQLite apparently isn't recommended for large databases. Ours will be about 50GB; sorry, that probably wasn't clear in the original post.Ia
The other issue is that BDB is not an SQL DBMS, it's a storage engine. So unless he has written an SQL implementation on top of BDB, it seems there will be a bit more work to port to SQL rather than another storage engine.Modestomodesty
@Ferruccio, he doesn't have to port to SQL, he can simply implement BDB-like API on top of SQL. easily.Nylons
sqlite.org/whentouse.html suggestst "a few dozen GB" is fine. You'd want the filesystem to be have at least enough space for a second complete copy of the database, for journals. I've used sqlite on the 2-5GB range without problems; it performs acceptably.Duodenum
Berkeley DB now supports SQL as well as the key/value API. In fact it uses the SQLite code on top of the Berkeley DB B-Tree so you can now run TB-sized SQLite databases not just in cases where "a few dozen GB" is fine. (Disclaimer: I am a product manager for Berkeley DB at Oracle.)Marden
Seems like SQLite is claimed to support TB sized databases - sqlite.org/features.htmlDensify
I've found that Berkeley DB locking is unreliable compared to SQLite.Assemblage
@Greg Hewgill Why there is no official tested thing to embed sqlite in java application. Can you throw some light on this issue. It would be of great help.Loxodrome
S
9

You can get much improved performance out of any dbm (even qdbm) and improved parallelism with a simple level of indirection: Simply take your keys and hash them, and use data_dir/H(key)/ as the database to store those keys. Limit the hash output to a small value (say) 255 for best results.

This approach has a number of benefits, easily summarized:

  • Conceptually simple
  • Easy to implement and test
  • Doesn't lock the entire database for updates
  • Can support much larger databases
  • Easy to replace the DBM component

The hash probably doesn't even need to be cryptographically secure; just mostly uniform. DJB's cdb hash works well in most cases.

Sylviesylvite answered 14/11, 2008 at 16:0 Comment(1)
Interesting suggestion, but it's a bit orthogonal to the question. The merits of using a hash table vs. a sorted btree-like structure are a different topic.Oolite
S
3

If you are on Windows then you can use the builtin esent database engine. http://blogs.msdn.com/windowssdk/archive/2008/10/23/esent-extensible-storage-engine-api-in-the-windows-sdk.aspx

Schroer answered 15/12, 2008 at 17:26 Comment(0)
B
3

You could try JDBM. It is a free (Apache 2) key-value store with disk persistence. Simple API and high performance

Brunhilda answered 26/2, 2012 at 15:28 Comment(0)
B
2

Postgres or HSQLDB and possible even H2 database

Brandibrandice answered 14/11, 2008 at 15:22 Comment(0)
B
0

db4o is pretty cheap and fast but it can only be used with java or .net

Bede answered 4/11, 2008 at 3:47 Comment(1)
db4o is absolutely inappropriate alternative to BerkeleyDB. additionally db4o doesn't offer royalty free licensing model. They're charging for each deployment.Nylons
B
0

Firebird is your best friend.

Bistort answered 4/11, 2008 at 4:5 Comment(2)
Firebird is a very nice SQL database. Not great as a storage DB, but probably better than most due to very good BLOB support.Crony
Can you elaborate a little more on 'not great as a storage DB'? Also, I would like to hear more on about what Firebird is NOT great (price? size? :) )Bistort

© 2022 - 2024 — McMap. All rights reserved.