views:

191

answers:

4

The Perl DBI module lets me connect to many different types of SQL database transparently. Is there an equivalent Perl module for non-relational key-value pair databases?

For example, an interface that might let me start developing with a BerkeleyDB (or even just a Perl hash?) but switch to something like memcachedb or CouchDB or even a cloud database like those offered by Amazon SinmpleDB or Google AppEngine Datastore.

(Is this what Tie::Hash does? In which case, where can I find a summary of implementations?)

+3  A: 

tie is a generic mechanism "to hide an object class in a simple variable." Tie::Hash is a convenient utility class to implement hash ties.

Thus tying objects into a hash is a proper abstraction to access key-value pair databases. To the best of my knowledge there is no common infrastructure to create such ties, so you should create a Factory yourself to isolate your project from the various ways to create the different ties.

David Schmitt
+2  A: 

Generally for every type of key-value pairs storage you will need separate module.

For example:

I'm not sure if there is module for Google AppEngine Datastore - generally, search on http://search.cpan.org/ for something that suits you.

depesz
+10  A: 

not sure if this is what you want: http://search.cpan.org/~nuffin/KiokuDB-0.27/lib/KiokuDB.pm

and it has CouchDB, BDB(BerkeleyDB) and DBI backend.

Thanks.

Fayland Lam
+2  A: 

CHI looks promising, from the maker of Cache::Cache.

Schwern