Skip to content

Instantly share code, notes, and snippets.

@guy9
Created June 27, 2023 13:53
Show Gist options
  • Save guy9/cfa98fbf00f1718171dc7f71432b1a36 to your computer and use it in GitHub Desktop.
Save guy9/cfa98fbf00f1718171dc7f71432b1a36 to your computer and use it in GitHub Desktop.
keyspace: iot
keyspace_definition: |
  CREATE KEYSPACE IF NOT EXISTS iot WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
table: devices
table_definition: |
  CREATE TABLE devices (
device_id uuid,
ts timestamp,
temperature float,
pressure float,
humidity float,
is_active boolean,
  PRIMARY KEY(device_id, ts))
columnspec:
  - name: device_id
population: seq(1..1B)
  - name: ts
population: uniform(1..100)
insert:
  partitions: fixed(1)
  batchtype: UNLOGGED
  select: fixed(10)/10
queries:
  read-latest:
cql: SELECT * FROM devices WHERE device_id = ? AND ts = ? LIMIT 1
fields: samerow
  scan-partition:
cql: SELECT * FROM devices WHERE device_id = ? AND ts = ?
fields: samerow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment