af83

Compare the performance of the NoSQL stores with YCSB

Cotton Ball Clouds / Nuvole a Batuffolo

There is a lot of NoSQL, key-value and "cloud" stores and it's not always easy to know what will be the performance of these stores for your usage. MongoDB can have incredible performance, but maybe Cassandra will be better for your write-heavy workload. How to know? By testing them with YCSB!

Yahoo! Cloud Serving Benchmark (YCSB in short) is a java tool which simplify the comparison of different stores on thoughput and latency. The code is on github, under the Apache license.

So, let's see the main parts of YCSB and how to use it to run our own bench.

The Client

The client is an extensible workload generator. It handles many low-level things like the creation of the threads pool and globally is the glue between the workload, the database layer and the measurements.

The Workloads

The workload defines how to make the request to the store: how many reads? writes? insertions or deletions? small or big documents? reads often the same keys or random access?

All these parameters are described in the workload. If you want a solid default workload, you can use the CoreWorkload class and adjust its settings like the readproportion in the core properties. But you can also go further by creating your own Workload class.

The workload can also implements the doInsert method and then, you can use YCSB to create initial datas before running the benchmark.

The Database Layer

The workload doesn't use directly the database, but delegates this stuff to the database layer. So, it's easy to just switch from one database to another, replay the same workload and compare the results.

YCSB has connectors for HBase, Cassandra and MongoDB, but it's easy to add a new connector for another database.

The Measurements

YCSB collects measurements about thoughput (how many reads per second for example) and (min/max/average/distribution) latency for each set of operations. You can go also add measurements but you have to modify your workload to plug them. Don't worry: the default measurements are really good and should be enough for most cases.

So, all you have to do now is download YCSB and play with it.

blog comments powered by Disqus