DEV Community

Cover image for Leveraging Redis 8.0's New Time Series Capabilities in a Real-Time Formula 1 Dashboard
datadr1ven
datadr1ven

Posted on • Edited on

Leveraging Redis 8.0's New Time Series Capabilities in a Real-Time Formula 1 Dashboard

Redis AI Challenge: Beyond the Cache

This is a submission for the Redis AI Challenge: Beyond the Cache.

Cover image free for use under the CC-2 license

What I Built

I am a Formula 1 fan, and a programmer, and in the past have posted here on dev.to about a Formula 1 fantasy tool I wrote that uses Linear Programming to compute optimal fantasy teams and Github actions to automatically update the tool with new race data. In this post, I describe a Formula 1 inspired usage of Redis 8.0's new time series "upgrade package" (a play on words, where an upgrade package in F1 refers to changes made to the car throughout the season).

There is a "cognitive ergonomics" legend in Formula 1, whereby in 2001, a Race Strategy Analyst for McLaren invented a screen called the McLaren Track Viewer (MTV). The MTV shows the time gaps between race cars on a circle, as opposed to overlaid on the race track, and gives teams actionable visual cues, such as where a car considering a pit stop, is forecast to reemerge time gap wise.

The technical sophistication of the original MTV was impressive, given the limited realtime data available circa 2001. Today (24 years later), there is copious telemetry available, and so prototyping an MTV should be straightforward! In this post, we cobble together an MTV minimum viable product (MVP), in other words, an MTV MVP 😂🤣.

Demo

And here it a short screen recording of what I accomplished!

Go check out the live (and open source) site at https://datadr1ven.github.io/mtvmvp. Lots of features to add, of course, including the ability to pick race/driver/lap. The page currently runs on data from Lewis Hamilton's lap 14 at the 2024 Miami Grand Prix.

How I Used Redis 8

The Redis 8 feature set I leaned on is the new affordance for time series data.

There are a few sources for F1 telemetry, for this MVP we use OpenF1, specifically their interval REST API. We insert interval data into Redis 8.0 as a time series, which you can see we query about here:

This shows that we have 10811 samples currently in the Redis 8.0 timeseries (from the 2023 Las Vegas Grand Prix). The efficiency and utility of Redis time-series routines made this MVP really straightforward to rapidly prototype via experimentation. To close, here is a query that shows a subset of timeseries data points restricted to a timestamp range.

Thanks for reading!

Top comments (1)

Collapse
 
maestrodev profile image
Maestro

Good App