Skip to content

Instantly share code, notes, and snippets.

@at15
Last active September 15, 2017 07:13
Show Gist options
  • Save at15/31345ea7d7182161faa7ae84e45e7cfb to your computer and use it in GitHub Desktop.
Save at15/31345ea7d7182161faa7ae84e45e7cfb to your computer and use it in GitHub Desktop.
Cassandra schema for time series data (naive version)
CREATE TABLE IF NOT EXISTS naive.metrics (
metric_name text, metric_timestamp timestamp, value int,
PRIMARY KEY (metric_name, metric_timestamp))
INSERT INTO naive.metrics (metric_name, metric_timestamp, value) VALUES (cpu, 2017/03/17:13:24:00:20, 10.2)
INSERT INTO naive.metrics (metric_name, metric_timestamp, value) VALUES (mem, 2017/03/17:13:24:00:20, 80.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment