Skip to content

Latest commit

 

History

History
106 lines (80 loc) · 2.33 KB

kairosdb.md

File metadata and controls

106 lines (80 loc) · 2.33 KB

KairosDB

Protocol

  • Thrift
  • CQL

Schema

Metrics Schema

Keyspace

  • NOTE: the replication_factor is 1, and it is a fixed number in CREATE_KEYSPACE in CassandraDatastore.java
CREATE KEYSPACE IF NOT EXISTS {{keyspace}}
  WITH REPLICATION = {
    'class' : 'SimpleStrategy',
    'replication_factor' : 1
  };

Metrics

  • NOTE: it seems KairosDB has omitted keyspace when creating tables
  • NOTE: column1 is not a typo, it might be the legacy problem of using Thrift protocol
CREATE TABLE IF NOT EXISTS data_points (
    key blob,
    column1 blob,
    value blob,
    PRIMARY KEY ((key), column1)
  ) WITH COMPACT STORAGE;

Row key index

  • TODO: what is it used for, tags?
CREATE TABLE IF NOT EXISTS row_key_index (
    key blob,
    column1 blob,
    value blob,
    PRIMARY KEY ((key), column1)
  ) WITH COMPACT STORAGE;

Row key time index

  • TODO: what is it used for
  • NOTE: it does not use compact storage
    • TODO: why ...
CREATE TABLE IF NOT EXISTS row_key_time_index (
    metric text,
    row_time timestamp,
    value text,
    PRIMARY KEY ((metric), row_time)
  )

Row keys

CREATE TABLE IF NOT EXISTS row_keys (
    metric text,
    row_time timestamp,
    data_type text,
    tags frozen<map<text, text>>,
    value text,
    PRIMARY KEY ((metric, row_time), data_type, tags)
  )

String index

  • TODO: what is it used for
  • TODO: why they are similar, string_index, row_key_index, data_points
CREATE TABLE IF NOT EXISTS string_index (
    key blob,
    column1 blob,
    value blob,
    PRIMARY KEY ((key), column1)
  ) WITH COMPACT STORAGE

Meta Schema

Extra Schema