liveBook · Manning

Uniform distribution

As explained in ScyllaDB in Action

A uniform distribution assigns equal probability across the values in a specified range.

A uniform distribution gives every value in a specified range an equal chance of appearing. In cassandra-stress, it constrains generated data to realistic bounds instead of allowing arbitrary values. section 11.2.1

Constraining generated review data

Set date_bucket to uniform(0..240) to generate twenty years of monthly buckets. Similar ranges can constrain scores to 1–100, author-name sizes to 5–20 characters, and titles to 20–50 characters. section 11.2.1

keyspace: stress
table: article_summaries_by_date
columnspec:
  - name: date_bucket
    population: uniform(0..240)
  - name: id
    cluster: uniform(10..25)
  - name: author_name
    size: uniform(5..20)
  - name: score
    population: uniform(1..100)
  - name: title
    size: uniform(20..50)
queries:
  read:
    cql: SELECT * FROM article_summaries_by_date WHERE date_bucket = ?
    fields: samerow

View a complete cassandra-stress column specification using uniform ranges for buckets, clustering counts, scores, and text sizes. section 11.2.1

How ScyllaDB in Action covers it

How deep it goes
Explains range syntax and configuration examples, while stopping short of formal probability mathematics.
Examples
Uses date buckets 0–240, scores 1–100, author-name sizes 5–20, and title sizes 20–50.
What you can do after
Apply it via cassandra-stress to generate bounded, more representative test data.
How it connects
Connects uniform distribution with cassandra-stress, population fields, cluster settings, and Gaussian distributions.

Also explained in

Compare how 9 books explain uniform distribution →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.