Skip to content
About
Main content

Workload realism and scale ladders

Which features must a synthetic workload get right, and how do you measure across scale?

Workload realism

The workload is half the system. Every mechanism inside a database depends on the data, so the generated data silently selects which mechanisms get exercised.

  • Uniform keys defeat every skew-handling path. You measure a system whose worst case is structurally unreachable. (Real seat sales are skewed: the front rows of the famous band are clicked thousands of times, the back rows rarely.)
  • Random, high-entropy values defeat compression entirely, because nothing compresses. Naively repeated values compress absurdly well. Both are wrong, in opposite directions.

The features that actually change which mechanism runs are: key skew, cardinality relative to the memory grant, value compressibility, null density, row width, update-to-insert ratio, and inter-query locality (how often queries touch the same data).

Cardinality (the number of distinct values) deserves special attention because its effect is a cliff, not a slope. When a hash table (a structure for grouping or joining) stops fitting in memory, the engine switches to spilling (writing parts to disk), which is a different algorithm with a different cost curve. A generator parameter set carelessly can move your experiment across that boundary and invert the conclusion.

The deepest failure is correlation. Generators emit independent columns. Real data has functional dependencies (city determines country) and correlated predicates. A cost-based query optimizer estimates how many rows a filter will match, and it usually assumes the columns are independent. So flatters exactly the component whose real-world weakness is that assumption. Here the false-independence problem produces a bias with a known direction, not just noise.

Perfect realism is unobtainable and is not the goal. The achievable standard is: the distributional features that the mechanism under test is sensitive to must match reality. This means you must know what the mechanism keys on before you generate the data. Realism is a claim about the mechanism, not about the data.

Generating it

The mechanics are harder than the requirement suggests.

Generating each column independently is easy and wrong, because independence is false in real data. Correlated generation is what you need, and it is truly difficult. Preserving all of these at the same time has no general solution, and each approximation breaks something:

  • joint distributions (how columns relate to each other);
  • functional dependencies (city determines country);
  • referential integrity (every order points to an existing customer) across tables;
  • realistic key skew (a few keys are very popular).

There are three families of generators, each with a different failure:

FamilyWhat it doesHow it fails
Parameterized generatorsProduce known, tunable distributionsUnrealistic joint structure
real dataPreserves everything, including correlationsPrivacy problems, and a scale ceiling: you cannot sample your way to 10× your current volume
Model-fitted generationPreserves single-column distributions and pairwise structureSmooths away the rare combinations, and rare combinations are often what breaks things

Scaling a dataset is usually done wrong, so it deserves its own name. Worked example. Suppose you have 10 million seat-hold rows over 100,000 distinct seats, so there are 10,000,000 / 100,000 = 100 rows per seat. To make a dataset 10× bigger you have two choices:

  • Multiply the rows by 10 and keep 100,000 seats: now there are 1,000 rows per seat. That is a different workload (hotter keys), not the same workload at scale.
  • Keep 100 rows per seat and have 1,000,000 seats: now every hash structure and index has 10× more keys, and its memory behaviour changes.

There is no neutral way to scale a dataset. The scale factor is a design decision that selects which mechanism your ladder is actually exercising.


Scale ladders

The mathematics is almost trivial once stated: one point determines no function, two points determine a line, and real systems are not lines. Amdahl's Law bends the curve (the serial fraction of work limits speed-up). The Universal Scalability Law () adds a coherency term (the cost of coordination between workers) that can turn the curve downward. And every buffer, and rate limit puts a cliff in it.

So measure geometrically: 1×, 3×, 10×, 30×. Interesting behaviour changes at orders of magnitude, not at fixed increments. The output you want is the shape: linear, sublinear with a , or rising and then falling. Each shape implies a different mechanism and a different remedy. A single point cannot distinguish "fast" from "not yet saturated."

Scale has more than one dimension, and each answers a different question:

What you growWhat you hold fixedNameWhat it tests
Data sizeClusterStrong scalingAmdahl's serial fraction
Data and cluster together—Weak scalingGustafson's view: bigger problems keep large clusters busy
ConcurrencyData—Contention
Key cardinalityData—Memory cliffs

These are four different curves, and a result on one says nothing about the others.


What this article forbids

  • A causal claim from a single configuration.
  • A tuning recommendation applied off the OVAT path where it was measured.
  • Any result whose configuration is unknown, including to its own author.
  • A comparison of runs taken in fixed order on hardware that has memory.
  • Extrapolating a curve from one point, or across a scale dimension you did not vary.
  • An average over a warm-up trajectory.
  • A conclusion from synthetic data without knowing which distributional feature the mechanism keys on.

Escapes and their prices. Every escape moves a cost and does not remove it.

EscapeWhat it buysWhat it costs
Fractional factorialFewer runsAliasing: main effects confounded with interactions
Randomized run orderNo bias from driftMore , so more runs
Shared infrastructure plus an interleaved control workloadAccess to cheap machinesA that bounds the smallest effect you can detect
Modelling instead of measuringSpeedThe model's assumptions (fine if you then check the model against two points, not one)

One principle