tags:

views:

37

answers:

1

With all the key value data stores out there I have started to create an abstraction layer so that a developer does not have to be tied in to a particular store. I propose to make libraries for:

Erlang
Ruby
Java
.NET

Does anyone have any tips on how I should go about designing this API?

Thanks

+1  A: 

First off, and as a general rule for anytime you build "pluggable" abstraction layer, build it to support at least two real implementations to start. Don't build it for just one datastore and try to make it abstracted, because you'd overlook a details that won't plug into another implementation very well. By forcing it to use two seperate implementations, you'll get closer to something that is actually flexible, but you'll have to make further changes to support a third and fourth data store.

Second, don't bother, these things already exist. Microsoft has provided a ton of these for their technologies (ODBC, ADO, ADO.NET, etc), and I'm sure Ruby/Java/etc has several as well. I understand the desire to encapsulate the already existing technology, but the more data stores you need to support, the more complexity you need to build in, and the closer you'll get to ADO.NET (or similar technologies). Companies like MS have spent a ton of money and research on solving this exact problem, and that is what they came up with.

Mike Mooney
Great answer thanks! Can you let me know which Microsoft, Java and Ruby APIs there are for keyvalue stores. This means I will only have to build the Erlang one.
Zubair
Can you give an example of one of the key/value stores you need to use? ADO.NET is pretty flexible, it has a list of providers for various data stores, and worst case you could probably build your own provider for a some custom data store if it didn't already exist.
Mike Mooney
Riak, Cassandra, MongoDB, CouchDB, Voldemorte, Redis
Zubair