[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Will lmdb suit my needs ?
Hello, Sankar.
> > Answering the subject first: probably not. Someone else with a
> > similar application, maybe, but that depends a lot on one's
> > ability to read and research.
> Wow, what a useful reply! Thanks. It made my choice easier.
Howard sometimes has that effect on people. I promise he's nicer
in-person.
> I choose to apply my reading and researching skills on better things
> than finding how to use a library, whose tutorials even google
> cannot find.
There aren't really any tutorials yet. There are reference guides in
the form of rigorously complete Doxygen documentation of the API and a
great wealth of material written describing similar interfaces (BDB,
etc).
There are also sample programs included in the source tree that show
equivalent operations in both BDB and LMDB, which can shed some light
on what is involved in the basic use of the library.
> >> I could not find any tutorial for lmdb by googling.
My friends at Google tell me they are working on having it write docs
for everything for us, but regrettably for now it remains just a search
engine.
> >> I would prefer to see some simple documentation that explains at
> >> least the basic set of APIs that we need to use (say the lmdb
> >> equivalents of sqlite3_open, sqlite3_exec, sqlite3_close)
SQLite is not the best comparison as this is a key-value store.
Take a peek at sample-mdb.txt in the source tree, e.g.:
https://gitorious.org/mdb/mdb/source/58e9c3add8c3fbe88f930531f237f070a652249b:libraries/liblmdb/sample-mdb.txt
Alternatively, the SQLightning (SQLite3 on LMDB) might be of some
interest if you need sql with better performance.
> >> Also, since I do not have much exposure to key-value dbs, will it be
> >> possible to provide a custom compartor function for values (so that I
> >> can store column2+column3 as a value and let the comparator function
> >> use column3 only as a value compartor function) ?
Please use the API docs: http://symas.com/mdb/doc/
In particular, see mdb_set_compare and mdb_set_dupsort:
http://symas.com/mdb/doc/group__mdb.html#ga68e47ffcf72eceec553c72b1784ee0fe
Depending on what you're trying to do, you might need additional
key/value lists for indexing purposes.
> >> Also one humble suggestion is that it may be better if the lmdb
> >> sources could be moved to a separate git repo instead of as a branch
> >> on the openldap git. That way it will be easier for potential
> >> consumers of this library to easily google it and access/build the
> >> sources.
As we obviously have that, how can we make it more clear and easy to
locate?
> >> Will lmdb be suitable for my needs ? And can someone point to any
> >> tutorial ? Thanks.
Can you give an example of a tutorial from another project that
explains things in a way you find helpful? Improving documentation
and new-developer accessibility is an ongoing problem.
Remember, it is an open-source project. If you want it perfect
immediately, do the homework to find the answers and write the
documentation you'd like to see. Patches are very welcome!
--
Emily Backes
Symas Corporation
ebackes@symas.com