How does Leveldb compare with Redis or Riak or Tokyo Tyrant?

rafidude picture rafidude · May 23, 2011 · Viewed 26.9k times · Source

Leveldb seems to be a new interesting persistent key value store from Google. How does Leveldb differ from Redis or Riak or Tokyo Tyrant? In what specific use cases is one better than the other?

Answer

Riyad Kalla picture Riyad Kalla · Nov 7, 2011

I only add this because in both of the previous answers I don't see this (important) distinction made...

  • Redis: Is a database server. You communicate with it via a custom binary protocol (via client library typically).
  • LevelDB: Is a library that implements a key-value store. You communicate with it by calling the C++ API directly.

If you are familiar with SQLite and how popular it has become as an embedded DB for client applications (I believe both Android and iOS ship it) then you see where something like LevelDB fits in.

Imagine you were writing a complex PIM app, maybe some enterprise address book manager meant to be installed on individual computers in the office. You wouldn't want to store all that data in XML or JSON that you wrote/parsed yourself inside your app -- if you could, you'd much rather store it in a DB to have easier access patterns.

But you also don't want to have to ship and install a local copy of Redis, running on some random port just so you can connect to it... you want a DB that you can call directly and natively from your app and not worry about "over the wire" communication... you want the raw guts of a DB without any of the network-ey stuff that you don't need in a client only app.

This is where LevelDB sits.

It is a different tool for a different job.