November 12, 2024 4 min read A to Z Series: Y Home

YCSB: A Useful Benchmark for Data Stores

YCSB is a benchmarking framework used to compare data stores with repeatable read and write workloads.

I use YCSB as a starting point, not a verdict. It is helpful when the workload resembles the decision in front of me, but I still recommend measuring the real application path before choosing a store.

A benchmark needs a workload story

When I talk about "A benchmark needs a workload story", I connect the shape to the operation I want to make cheap.

A read heavy catalog, a write heavy event store, and a mixed user profile service stress different parts of a database. YCSB lets teams run named workloads so they can compare latency and throughput under the same conditions.

Store comparison example

I use "Store comparison example" to keep YCSB grounded in a real system, because abstract patterns are too easy to agree with and too hard to operate.

A team compares two key value stores before moving session data. They run a read heavy workload, then a balanced read write workload, and compare p95 latency under the same record count.

Workload config example

I use "Workload config example" to keep YCSB grounded in a real system, because abstract patterns are too easy to agree with and too hard to operate.

Run the same workload against each store before comparing latency:

./bin/ycsb load jdbc -P workloads/workloadb -p recordcount=100000
./bin/ycsb run jdbc -P workloads/workloadb -p operationcount=50000

The first command loads data and the second runs workload B against the same database. Separating load from run keeps the benchmark result easier to compare.

Sequence diagram: compare data stores with one workload

compare data stores with one workload The benchmark is useful because both stores receive the same workload and the team knows what pattern it represents. sd compare data stores with one workload YCSB Runner YCSB Runner Store A Store A Store B Store B Store A andStore B Store A andStore B Metrics Metrics EngineeringTeam EngineeringTeam Decision Decision Run workload B with thechosen record count. Run the same workload B. Report throughput andlatency. Compare results with theproduction accesspattern.

The benchmark is useful because both stores receive the same workload and the team knows what pattern it represents.

The measurement choice

Related data store reads

Written by Arunkumar Ganesan.

What I learnt from benchmarks is that they are good at shaping questions, but the final answer has to come from the workload my system actually runs.

#DistributedSystems #YCSB #Performance #Databases