Divide and Conquer Timeline Data with Typescript

Typescript time series and Date objects

Scan texture
Scan texture

Published On

Thu Oct 10 2024

0
/
0

If your application is encountering performance issues with large data, checkout this date search typescript package. It works in node and browser runtimes.

Web apps are used in all sorts of applications. Frontend developers are constantly challenged to visualize more and more big data while still providing an excellent User Experience.

As data sets grow processing the information to glean insights and render a cool interface gets progressively challenging with the JavaScript standard library. One thing that makes this especially challenging for web developers is the range of clients trying to run their code. A customer could potentially try to process as massive data set spanning several years on a Chromebook or on a gaming PC with the latest top of the line hardware.

Encountering large datasets to visualize in the frontend is very common in commercial or industrial applications. Often these large datasets are stored by dates. Think of data like event logs, or financial transactions.

Even if we only have a piece of data per every 15 minute interval of data, that list would be over 525,600 data points for a year.

For cases when we need to know if a point exists, like “is there data on this date?” and “filter the transactions to this date” looping through the entire data set may not cut it.

// itterates through the entire data set
bigData.filter((data) => data.date === mydate);

// itterates though a portion of the data set
// or the whole data set if there is no match.
bigData.has((data) => data.date === mydate);

This is where a divide and conquer algorithm like binary search comes in handy.

Even if your comparison algorithm requires some compute, the worse case scenario for a 525K point data set is 19 iterations.

As you can see, this scales quite well.

  1. Financial applications: Time series data is commonly used in finance for predicting stock prices, analyzing market trends, and forecasting future values of financial instruments.
  2. Internet of Things (IoT) applications: IoT devices often generate time series data, such as temperature, humidity, and pressure readings, that need to be analyzed over time to identify patterns and anomalies.
  3. Health monitoring applications: Time series data is often used to monitor vital signs, such as heart rate, blood pressure, and oxygen levels, to identify trends and patterns that can help in disease diagnosis and treatment.
  4. Web analytics applications: Time series data is used to track website traffic, user engagement, and other metrics over time to identify trends and make data-driven decisions.

Blog Posts

I share insights from my journey in software development, user experience, and entrepreneurship, with a focus on building scalable systems, tackling complex challenges, and driving innovation.

The Ultimate Tool for Managing Types in Monorepos

gRPC Is the Secret Weapon Your Monorepo Desperately Needs

Divide and Conquer Timeline Data with Typescript

Typescript time series and Date objects

The Growing Importance of SMEs in AI Agent Design

AI agents are revolutionizing industries, but here's why they still need us more than ever

The Myth of the “Universal Language” for Internal Tool Development

We've all heard this story before. You finally get buy-in to build a tool that solves your pet peeve. You have a plan figured out, but then your manager says the dreaded phrase, “Use a different language so that others can contribute”… which seldom happens.

The Performant Interface Dilemma: Taming Object Equality in React

A comprehensive guide for developers on handling object equality issues in JavaScript, with a focus on practical solutions for React applications

Will My Startup's Problem Be Big Enough?

How to evaluate the potential of a startup idea by understanding your Serviceable Obtainable Market, the Venn diagram of opportunity

UX Meets Database Design, a Match Made in Heaven

Putting UX at the heart of user-centric SQL schema data modeling

I Stuffed TensorFlow.js Into a React App

Here's what I learned about Web Workers

Social Distanced UX Research Strategies For your Next iOS App

COIVD forced us to stop using in-person UX research. Here are some tried and true methods we're keeping after the lockdowns lift

How to Deploy Flutter for Web Apps with Netlify

Have you ever wanted to turn your iPad or iPhone app into a website?