lesson, and she’s keen on learning how her surfing will improve over time. She’s decided to record this data in a time-series database and to access it via an API endpoint. But where does she start?
board you already have Use a time-series DB already in your tech stack 2 Use the old board, but add a new set of fins Use an extension for a DB you already use 3 Buy a new board Adopt a new DB technology 4 Shape your own board Design your own DB
you need to learn how to surf it! • Much like in surfing, there are tried-and-true techniques for best handling time-series data. • We’ll cover: 1. Data arranged by time 2. Hierarchically-delineated key 3. Querying by index 4. Aggregation and Compression
time, data is organized according to this composite key. • Crucial to understand how this data is going to be accessed—not every query will be efficient
the end of the composite index ◦ So you must query with the full key • Non-performant query ◦ Surfer, Timestamp • Performant query ◦ Surfer, Region, Break, Timestamp Liz, LA, Malibu, over the past month Liz, Humboldt, Moonstone, over the past month Two weeks … Two weeks
Base table (data per wave): ◦ Distance, Duration • Aggregate table (data per interval of time): ◦ Total distance, total duration, max speed, wave count
the following intervals: ◦ Base table—with a TTL of 1 month ◦ One day—with a TTL of 6 months ◦ One week—with a TTL of 1 year ◦ One month—with a TTL of 5 years
full period of time over which we want data. ◦ Our longest TTL is 5 years: that’s the max timespan • interval = the grain at which the data is aggregated ◦ Calculated based on the timespan • The interval options are: ◦ One day (TTL 6 months) ◦ One week (TTL 1 year) ◦ One month (TTL 5 years)