4 ms·
Some mistakes in his benchmarks, among probably others: - I don't see any mongodb index creation, so mongodb is inserting with no index while rethinkdb is inse
by weddpros 11y ago
Some mistakes in his benchmarks, among probably others:
- I don't see any mongodb index creation, so mongodb is inserting with no index while rethinkdb is inserting with the index. That's probably why there's a gap between the two
- there's no mongodb index, and rethinkdb queries do not make use of the index (this is probably why rethinkdb is not 1000x slower: both aren't using indexes)
- the $in query should be last_update: random_timestamp(), there's no need for $in here
- his insertion code creates 100K memory clones of the object to insert in the mongodb version only, not in rethinkdb
I'm sad to add: what the author is benchmarking here is the likely performance of a system he could build with either db. It's not necessarily bad (save for bad press) that he's bad at benchmarking: the mistakes he's made in his benchmark are similar to the mistakes he'll make in his code.
But yes, the author may use some help!
- timmaxw 11y agoIn the benchmark script [1] that the author provided on his GitHub account, there's a call to ensure_index() for MongoDB. And he's reporting an average latency of 0.15ms for MongoDB read operations, so it's pretty clear that the MongoDB index is actually being used. [1] https://github.com/martinrusev/rethinkvsmongo-benchmark/blob/master/benchmark.py https://github.com/martinrusev/rethinkvsmongo-benchmark/blob...
- weddpros 11y agoYes, this kind of latency definitely says "indexed". When I wrote this, I'd read a rethinkDB employee say "it's not using the index on rethinkdb", and performance was similar (3x) between the two. I trusted the "no index" path, and couldn't find an ensureIndex command... So I assumed there was no index on mongodb. Truth is, this kind of performance can only come with indexes, on RethinkDB and mongodb.