views:

2241

answers:

8

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.

+4  A: 

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

Greg Hewgill
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.
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.
Ferruccio
@Ferruccio, he doesn't have to port to SQL, he can simply implement BDB-like API on top of SQL. easily.
lubos hasko
http://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.
Dickon Reed
A: 

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

pdeva
db4o looks nice but unfortunately this is a C++ app...
db4o is absolutely inappropriate alternative to BerkeleyDB. additionally db4o doesn't offer royalty free licensing model. They're charging for each deployment.
lubos hasko
A: 

Firebird is your best friend.

F.D.Castel
Firebird is a very nice **SQL** database. Not great as a storage DB, but probably better than most due to very good BLOB support.
Simon Buchan
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? :) )
F.D.Castel
+4  A: 

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.

digitala
A: 

Postgres or HSQLDB and possible even H2 database

FoxyBOA
+2  A: 

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.

geocar
+1  A: 

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

hfcs101
A: 

You can try my product Serial Killler as it sounds like a very good match to what you are doing. My company, Think Bottom Up, is currently turning this mature in-house database into a commercial product, so there is not a lot of info on the web site at present.

Our commercial licensing terms are flexible. If you are interested, please contact me through via the contact details on my web site.

Daniel Paull
It doesn't matter how good your technology is, there's no way I'm going to use a product with a name like, talk about it or refer to it in any way. This is a very inappropriate bit of dark "geek humor".
Andy Dent