Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scalable Time Series With Cassandra

αλεx π
September 08, 2016

Scalable Time Series With Cassandra

Cassandra is awesome for many things. One of the things it's awesome for is Time Series. Combining the power of Cassandra with APIs of existing Time Series tools, such as Graphite can yield interesting results.

Cyanite is a Time Series aggregator and store built on top of Cassandra. It's fully compatible with Graphite, can serve as a plug-in replacement for Graphite and Graphite web.

Cyanite is using SASI indexes to make glob metric path queries, can query and aggregate, store, display and analyse metrics from hundreds and thousands of servers.

Which data modelling practices work best for Time Series, which new awesome Cassandra features you can use to make your Time Series analysis better.

αλεx π

September 08, 2016
Tweet

More Decks by αλεx π

Other Decks in Programming

Transcript

  1. Predefined list of reports to aggregate Reducing amount of data

    points Faster queries Precision loss due to aggregation
  2. Cyanite responsibilities Carbon-compatible listener Aggregate data in-memory Flush aggregates to

    Cassandra Path storage Retrieve paths for query Aggregate the query results
  3. Cassandra features Metric expiry, TTL User Defined Types SASI Indexes,

    LIKE queries Aggregate Functions Offline data loading Clustering range queries IN partition key locking
  4. CREATE TABLE segment ( parent text, segment text, pos int,

    length int, leaf boolean, PRIMARY KEY (parent, segment))
  5. SELECT * FROM segments WHERE parent = 'app' AND pos

    = 2 ALLOW FILTERING Prefix: app.*
  6. SELECT * FROM SEGMENTS WHERE pos = 3 AND segment

    LIKE 'abc.%' ALLOW FILTERING Suffix: abc.*.metric
  7. a.b.c1 a.b.c2 scale(a.b.*, 10.0) {"a.b.c1" [1 2 3] "a.b.c2" [5

    6 7]} {"a.b.c1" [10 20 30] "a.b.c2" [50 60 70]}
  8. CREATE TYPE IF NOT EXISTS metric_resolution ( precision int, period

    int ); CREATE TYPE IF NOT EXISTS metric_id ( path text, resolution frozen<metric_resolution> );
  9. Scaling cyanite Use DTSC Cyanite is stateless For high loads,

    split readers and writers Load-balance with HAProxy Colocate Cyanite & Cassandra