yinqiwen / ardb

A redis protocol compatible nosql, it support multiple storage engines as backend like Google's LevelDB, Facebook's RocksDB, OpenLDAP's LMDB, PerconaFT, WiredTiger, ForestDB.
BSD 3-Clause "New" or "Revised" License
1.83k stars 278 forks source link

command complexity / Big-O #394

Open mrkamel opened 6 years ago

mrkamel commented 6 years ago

Hi and thanks for ardb!

It would be super-helpful to have some doc listing the complexity of the commands, optimally using Big-O notation, like redis does in its docs.

yinqiwen commented 6 years ago

the storage engine store data in disk, and there is cache for some operations, it's hard to estimate the complexity.
and since rocksdb/leveldb use tree like structure to store data, the basic search complexity would be log2(N).

shailesh33 commented 6 years ago

+1 on the request. Essentially what I am looking for is, if I am doing a HSET, how many reads and writes does it translate to. Similarly for sorted set operations etc.

On Wed, Dec 13, 2017 at 7:05 PM, yinqiwen notifications@github.com wrote:

the storage engine store data in disk, and there is cache for some operations, it's hard to estimate the complexity. and since rocksdb/leveldb use tree like structure to store data, the basic search complexity would be log2(N).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yinqiwen/ardb/issues/394#issuecomment-351595121, or mute the thread https://github.com/notifications/unsubscribe-auth/ALle5-jAxoCFb-O9uywR_N8MvW9tygJLks5tAJBygaJpZM4Q7R8U .

mrkamel commented 6 years ago

yes, let's forget about the storage layer complexity. I was as well only talking about the complexity that is ardb specific, because even from looking into the ardb code it's not always easy to estimate it, even though it is well written - and btw, who wants to always look into the code to estimate the complexity of ZADD, HSET or SREM.

shailesh33 commented 6 years ago

@yinqiwen Appreciate your response here. thanks.