20
Website and Rebranding Project OvertheWire Over the Wire David Hughes Timeseries data at scale for the masses

AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Website and Rebranding Project

OvertheWire

OvertheWire

David Hughes

Timeseries data at scale for the masses

Page 2: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Timeseries DataGrowth over the ages

Over the Wire | overthewire.com.au 6

1990

2000

2010

Now

University Network15 HostsPerformance metrics=> 10k records per day

ISP NetworkDialup user baseRadius sessions=> 100k records per day

Hosting InfrastructureInfrastructure metricsVM metrics=> 2.5m records per day

Telco NetworkPacket loss & Latency=> 25m records per day per pod

Page 3: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Data GrowthLog scale

Over the Wire | overthewire.com.au 7

10,000.00

100,000.00

1,000,000.00

10,000,000.00

100,000,000.00

1990 2000 2010 2020

Page 4: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Data Growth

Over the Wire | overthewire.com.au 8

0.00

5,000,000.00

10,000,000.00

15,000,000.00

20,000,000.00

25,000,000.00

30,000,000.00

1990 2000 2010 2020

Linear scale

Page 5: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Data Growth

Over the Wire | overthewire.com.au 9

Train wreck scale

Page 6: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Dealing with DataThe decade of NoSQL

Over the Wire | overthewire.com.au 10

• “Web Scale”

• Non Tabularü More Flexibleü Higher Performance

• Designed to scale-out or cluster

• So many forms to choose from

• Just blame Google !

Page 7: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

A NoSQL For Any Occasion

Key Value StoreE.g. MemcacheSimple and high performance.Perfect for local caches

Structured StoreE.g. RedisA Key Value Store with typed data.Also great for local caches

Over the Wire | overthewire.com.au 11

Document DatabaseE.g. MongoDBKey Value where the value is a document, and each document may have a different structure.

Graph DatabaseE.g. Neo4JIf your world looks like a graph then this is the business !!

Page 8: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Tabular data by any other nameis still tabular

People : [{

first: ”Kanye”, last: “West”, age: 42

},{

first: ”Ed”, last: “Sheeran”, age: 28

},{

first: ”Bono”, age: 59

}]

Over the Wire | overthewire.com.au 12

First Last AgeKanye West 42

Ed Sheeran 28Bono 59

Page 9: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

1. Tabular data2. SQL Interface3. APIs for every language I can think of4. Grow in data depth without performance hit5. Grow in data width without performance hit

Deliver the x10 scale promise without sacrificing performance, flexibility,

or ease of use

13

My Data Wish List

Over the Wire | overthewire.com.au

Page 10: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

TimescaleDBA PostgreSQL extension

Over the Wire | overthewire.com.au 14

• Specifically written for time series data at scale

• Plugs seamlessly into the Postgres query planner

• Hides the complexity from the developer. Standard SQL

• Works with any tool that works with PostgreSQL

• No retraining if your teams already use PostgreSQL

• Opensource or Commercial

Page 11: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Data partitioning or “Chunking”

Over the Wire | overthewire.com.au 15

Data

Page 12: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Data partitioning or “Chunking”

Over the Wire | overthewire.com.au 16

Jan Data Feb Data Mar Data

Page 13: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Data partitioning or “Chunking”

Over the Wire | overthewire.com.au 17

January February March

Timescale Hypertable

Page 14: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Data partitioning or “Chunking”

Over the Wire | overthewire.com.au 18

Jan – Even Cust

Timescale Hypertable

Jan – Odd Cust Feb – Even Cust Feb – Odd Cust

Page 15: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

• “Depth” of data should not impact performance. If you keep 10 years of data it will just consume storage until someone queries it.

• Lookup performance requires indices to be loaded. Current indices will be in RAM as you will be writing to the time series in the current period.

• Lookups are commonly grouped. E.g. most customers look at their monitoring for the current month. Locality of lookups keeps indices cached.

• Concurrent writes and reads are handled efficiently.

19

Hypertables in action

Over the Wire | overthewire.com.au

Page 16: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Example Benchmark

Voip CDR records (very wide data records)3 Million records per day6 months data (i.e. approx. 550 million records)

Test 1

No concurrent data insertsQuery 1 : Get 1st 50 of 1000 records for a client in a given month

=> Data returned in under 2 secondsQuery 2 : Get 2nd 50 records same client and same month

=> Data returned in 15 msec

20

Hypertables in action

Over the Wire | overthewire.com.au

Page 17: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Test 2

Base insert rate of 5,000 records per minuteQuery 1 : Get 1st 50 of 1000 records for a client in a given month

=> Data returned in under 2 secondsQuery 2 : Get 2nd 50 records same client and same month

=> Data returned in 15 msecTest 3

Base insert rate of 50,000 records per minuteQuery 1 : Get 1st 50 of 1000 records for a client in a given month

=> Data returned in under 3 secondsQuery 2 : Get 2nd 50 records same client and same month

=> Data returned in 25 msec

22

Hypertables in action

Over the Wire | overthewire.com.au

Page 18: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Scale out "Unlimited” data width

Over the Wire | overthewire.com.au 23

Scale-out Option 1Using TimescaleDB Features• Clustering in beta• Uses combination of data nodes

and access nodes• Access nodes route queries to

data node

Scale-out Option 2Simple solution using “home grown sharding”

Page 19: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Scale out via “API Sharding”

Over the Wire | overthewire.com.au 24

DB#1 DB#2 DB#3

API

SQL

JSON

Page 20: AusNOG 2019 - timeseries data · Scale out "Unlimited” data width Over theWire |overthewire.com.au 23 Scale-out Option 1 Using TimescaleDBFeatures •Clustering in beta •Uses

Thanks !

Over the Wire | overthewire.com.au 25

Any questions ?

(remember there’s coffee outside J )