Anyone manage to compile this on OS X?
LevelDB: a fast and lightweight key/value database library
61–70 of 82 posts
Re: LevelDB: a fast and lightweight key/value database library
#62What I would like to know is, is there support accessing values by nth-largest key? I had to roll my own b-tree library specifically to get this feature since nothing out-there had it.
Why not index size(key)? Then lookup the n-th largest key and then pull the values? eg. SELECT value from key_value_pairs order by size(key) LIMIT N
Re: LevelDB: a fast and lightweight key/value database library
#63Was really psyched until I saw --std=c++0x in the Makefile. What 0x features does leveldb depend on, and can those dependencies be realistically removed?
I suspect that you may find suitable code in the chromium source code. See leveldb's port_chromium.h.
Re: LevelDB: a fast and lightweight key/value database library
#64@sghemawat: Are you planning on implementing atomic CAS operations?
bool CAS(db, key, oldvalue, newvalue) {
lock some mutex;
read key's value from db;
bool result = (value == oldvalue);
if (result) write key=>newvalue to db;
unlock;
return result;
}
This should be not much slower than any hard-wired CAS we could provide from inside leveldb.Re: LevelDB: a fast and lightweight key/value database library
#65This could be great news for iOS. AFAIK, this is the first K/V DB that could be built for iOS (c++) and has a free license that is compatible with the AppStore (Tokyo Cabinet uses LGPL and the author has shown no interest to me in adding a static linking clause, Berkeley DB requires an expensive commercial license, etc).
Re: LevelDB: a fast and lightweight key/value database library
#66#include
class AtomicPointer { private: boost::atomic> rep_; public: AtomicPointer() { } explicit AtomicPointer(void v) { } inline void* Acquire_Load() const { return rep_.load(boost::memory_order_acquire); } inline void Release_Store(void* v) { rep_.store(v, boost::memory_order_release); } inline void* NoBarrier_Load() const { return rep_.load(boost::memory_order_relaxed); } inline void NoBarrier_Store(void* v) { rep_.store(v, boost::memory_order_relaxed); } };
Re: LevelDB: a fast and lightweight key/value database library
#67Re: LevelDB: a fast and lightweight key/value database library
#68This could be great news for iOS. AFAIK, this is the first K/V DB that could be built for iOS (c++) and has a free license that is compatible with the AppStore (Tokyo Cabinet uses LGPL and the author has shown no interest to me in adding a static linking clause, Berkeley DB requires an expensive commercial license, etc).
What advantages does this have over the built-in SQLite?
Re: LevelDB: a fast and lightweight key/value database library
#69Earlier quoted context omitted.
What advantages does this have over the built-in SQLite?
It stores key/value pairs instead of relational data. I've been looking for something like this for a while as a replacement to NSUserDefaults.
CREATE TABLE kv (key text PRIMARY KEY, value text);Re: LevelDB: a fast and lightweight key/value database library
#70Earlier quoted context omitted.
That's correct. We're using leveldb as the back-end for IndexedDB in Chrome.
Please enlighten me, in the LevelDB page it said: > Only a single process (possibly multi-threaded) can access a particular database at a time. But I presume Chrome is multiprocess by nature?