Is there any nosql flat file database just as sqlite?

Question:

Short Question:
Is there any nosql flat-file database available as sqlite?

Explanation:
Flat file database can be opened in different processes to read, and keep one process to write. I think its perfect for read cache if there’s no strict consistent needed. Say 1-2 secs write to the file or even memory block and the readers get updated data after that.

So I almost choose to use sqlite, as my python server read cache. But there’s still one problem. I don’t like to rewrite sqls again in another place and construct another copy of my data tables in sqlite just as the same as I did in PostgreSql which used as back-end database.

so is there any other choice?thanks!

Asked By: davyzhang

||

Answers:

Maybe shelve? It’s basically a key-value store where you can store python objects. http://docs.python.org/library/shelve.html

Or maybe you could just use the filesystem?

Answered By: knutin

BerkeleyDB is a widely-used embedded database that’s been around forever (it originally derived from the database library included in BSD, hence the name) and has excellent performance characteristics for many use cases (and caching is a frequently-used one), but it does have some significant limitations.

If you want to use it with Python, you’ll probably want the externally-maintained pybsddb/bsddb3 library, not the deprecated bsddb library included in Python 2.x (and no longer in 3.x).

It’s currently owned by Oracle, but available under an open-source license. Do take careful note of licensing terms — current versions are GPLish (and GPL-compatible), so make sure that’s compatible with what you plan to do.

More information:

Answered By: Nicholas Knight

Something trivial but workable, if you are looking storage backed up key value data structure use pickled dictionary. Use cPickle for better performance if needed.

Answered By: Edmon