What Is Time-Series Data? Definitions & Examples

What Is Time-Series Data? Definitions & Examples

What Is Time-Series Data?

Time-series data or temporal data is a sequence of data points collected over time intervals, allowing us to track changes over time. Time-series data can track changes over milliseconds, days, or even years.

Having access to detailed, feature-rich time-series data has become one of the most valuable commodities in our information-hungry world. Businesses, governments, schools, and communities, large and small, are finding invaluable ways to mine value from analyzing time-series data.

(You can read how real-world teams, like those tracking real-time flight data or building platforms for smarter cities, analyze their time-series metrics in our Developer Q&A series).

Software developer usage patterns already reflect the same trend. In fact, over the past two years, time-series databases (TSDBs, or time-series DBMS—database management systems) have steadily remained the fastest-growing category of databases:

Trend of the last 24 months: TSDBS remain fasted-growing database category
Source: DB-Engines, August 2022

As the developers of an open-source time-series database, my team and I are often asked about this trend and how it should factor into your decisions about which database to select. Specifically, does it really matter if you start with a database specialized for time-series data—or can you easily transition to one later?

Why Is Time-Series Data Valuable?

Once you start capturing temporal data, a brand new world of analytics and insight opens up to you. On the flip side, recording data points this way produces much more data overall. For example, think about the stock market. Technically, you could (and people do!) record the price changes of a single stock a hundred times every second.

For any given day, that is 24 hours x 60 minutes x 60 seconds x 100 = 24*60*60*100 = 8,640,000 data records each day. And this is just one single stock symbol. This calculation ignores the time window when the market is closed every day but still shows that time-series data can be high-volume, even if you just monitor a single stock symbol.

What Are Some Examples of Time-Series Data?

In the past, our view of time-series data was more static; the daily highs and lows in temperature, the opening and closing value of the stock market, or even the daily or cumulative hospitalizations due to COVID-19.

Unfortunately, these totals missed the nuances of how the underlying changes over time contributed to these static values.

Let’s consider a few examples.



Unveiling banking nuances with time-series databases

If I send you $10, a traditional bank database will debit my account and credit your account. Then, if you send me $10, the same process happens in reverse. At the end of this process, our bank balances would look the same, so the bank might think, “Oh, nothing changed this month.” But, with a time-series database, the bank would see, “Hey, these two people keep sending each other $10; there’s likely a deeper relationship here.” Tracking this nuance, our month-ending account balance takes on greater meaning.

Tracking environmental efficiency with time series

Next, think about an environmental value like mean daily temperature (MDT), the average of the high and low temperatures for consecutive days at a location. Over the last few decades, MDT has been used as a primary variable to calculate buildings’ energy efficiency.

In any given week, MDT might only vary slightly from day to day in a location, but the contributing environmental factors could be changing drastically over that same period. Instead, knowing how the temperature changed each hour throughout the day, coupled with precipitation, cloud cover, and wind speed, could dramatically improve your ability to model and optimize energy efficiency for your properties.

Time-series analysis of COVID-19 hospitalizations

Likewise, while knowing the total number of COVID-19 hospitalizations per day in your community is valuable, that number alone isn’t very descriptive. For instance, the hospital might disclose daily numbers that show 20 hospitalizations on Monday and increase slightly throughout the week to 23 hospitalizations on Friday.

At first glance, it looks like a 15 % increase in hospitalizations this week. But, if we add detail to each of those records (and increase the frequency at which we collect them), we might see that it was a net increase of three patients. In reality, there were 10 people discharged, and 13 admitted, an increase of 65 % for new admissions over the last five days.

Tracking each aspect of patient data over time (e.g., patient age, admitted or discharged, days to recovery, etc.) helps us understand how we arrive at the daily counts, allowing us to better analyze trends, accurately report totals, and take action. In the case of total COVID-19 hospitalizations, the details behind this analysis impact public policy in the cities and towns where we live.

Financial markets

The financial sector is a typical example of temporal data usage: be it stocks, cryptocurrencies, or other financial assets, time-series data allows you to see how prices changed over time and helps you spot trends. As an example, here’s a time-series chart showing you the intraday price changes of the Bitcoin cryptocurrency:

Plot graph showing intraday changes of Bitcoin price in USD

Time-series data allows you not just to know the current price of the asset but also how it changed in the past.

Internet of Things and sensor data

Whether you’re recording motor temperatures in factories, monitoring cannabis cultivation, or even using IoT data to control a nuclear fusion experiment, you are leveraging time-series data to make better decisions.

Time-series data sets visualized in Grafana

Once you have sensors that send data into your time-series database, you can create real-time dashboards and analyze historical data.

Application monitoring

Imagine you maintain a web application. Every time a user logs in, you may just update a last_login timestamp for that user in a single row in your users table. But what if you treated each login as a separate event and collected them over time? With that kind of time-series data, you could analyze historical login activity, see how usage increases or decreases over time, bucket users by how often they access the app, and more.

Observability

Another example that has become vital to every IT group around the world: operational metrics for servers, networks, applications, environments, and more. This kind of time-series metric data is crucial to keeping the services we rely on running without interruption. By tracking the changes in each metric, IT departments can quickly identify problems, plan for capacity increases during upcoming events, and diagnose if an application update resulted in changed user behavior, for better or worse. (See how NLP Cloud monitors their language AI API.)

Web3 and blockchain data

In the past year, we’ve seen a surge in companies that use TimescaleDB to build web3 and blockchain tools. Blockchains are made of timestamped blocks and transactions. There are several types of data to be recorded to drive smarter decisions in the industry. Think of NFT transaction monitoring, blockchain exploration, mining analytics, or even criminal investigations.

Time-series analysis on blockchain data

These examples illustrate how modern time-series data differs from what we’ve known in the past. Time-series data analysis goes far deeper than a pie chart or Excel workbook with columns of summarized totals.

This detailed data doesn’t just include time as a metric but as a primary component that helps to analyze our data and derive meaningful insights.

And, there are many other kinds of time-series data. Still, regardless of the scenario or use case, all time-series datasets have three things in common:

  1. The data that arrives is almost always recorded as a new entry.
  2. The data typically arrives in time order.
  3. Time is a primary axis (time intervals can be either regular or irregular).

In other words, time-series data workloads are generally “append-only.” While they may need to correct erroneous data after the fact or handle delayed or out-of-order data, these are exceptions, not the norm.

Simply put, time-series datasets track changes to the overall system as INSERTs, not UPDATEs, resulting in an append-only ingestion pattern.

This practice of recording each and every change to the system as a new, different row is what makes time-series data so powerful. It allows us to measure and analyze change: what has changed in the past, what is changing in the present, and what changes we forecast may look like in the future.

You may also notice that some of these examples describe a common type of time-series data known as event data.

Now, It’s Your Turn: Start Analyzing Your Time-Series Data

If you’re convinced you need a time-series database or want to try it out, spin up a fully managed TimescaleDB instancefree for 30 days.

From there, follow our getting started guide to configure your database and execute your first query, then choose one of our fun tutorials to delve deeper into TimescaleDB:

You can also read more primer content on time-series data and what you can do with it:

Have questions or want to learn more? Join our Slack Community and Forum, where Timescale engineers and community members are active in all channels.

Ingest and query in milliseconds, even at terabyte scale.
This post was a collaboration between
7 min read
General
Contributors

Related posts