A readout to a client's leadership team
Case study

PingThings cut grid analytics compute cost 90% and queries to seconds

Cloud query costs on petabytes of grid sensor data were high enough to break the unit economics of the business.

PingThings

90%lower monthly compute cost after leaving EMR

The workflow before#

PingThings runs PredictiveGrid, a service that gives utilities access to synchrophasor (PMU) data from the electric grid. Each sensor reports 30 to 120 times a second, so the history grows to petabytes fast. On AWS EMR, a single analytic query cost $200 to $500 and took 30 to 40 minutes. That's tolerable once. It breaks down when a utility's engineers want to explore a disturbance, rerun a window or train a model across years of data. Customer contracts were losing money on compute, and PingThings' engineers spent their days on infrastructure workarounds instead of the service customers were paying for.

What we built#

We moved PingThings off general-purpose cloud compute and onto infrastructure built for one job: storing and querying high-rate sensor data. At the center is the Berkeley Tree Database (BTrDB), running on on-premise Hadoop and Spark clusters sized for this workload. Queries that took 30 to 40 minutes now return in seconds, and compute cost dropped 90%.

A store built for time series

BTrDB keeps time series in a tree structure designed for fast time-range queries, so pulling one sensor's readings across a week of disturbances takes seconds. It compresses the data 10x or more and versions corrections, so a cleaned reading never erases the raw one. We chose it after benchmarking it against InfluxDB and TimescaleDB on PingThings' own data.

Streaming in, not batch

Kafka takes in PMU streams as they arrive and Spark processes them on the way in, while PostgreSQL holds sensor and asset metadata. We chose streaming because grid events play out in seconds, and an engineer looking into a disturbance shouldn't wait for the next batch load.

Models that clean data and flag disturbances

TensorFlow models clean the raw sensor data and flag grid disturbances. Cleaning sits at the front of the pipeline because PMU feeds drop out and drift, and every analysis downstream inherits whatever errors get through.

APIs for customer applications

REST and WebSocket APIs give customer applications direct access to the data, and Jupyter supports engineers doing their own analysis. Utilities' tools read from the same store PingThings' team uses, so everyone works from one version of the grid's history.

How we delivered it

The program ran 36 weeks. We benchmarked candidate stores first, then built ingestion and storage, then moved customer workloads off EMR in stages so contracts kept running throughout. Applications run on Kubernetes with Prometheus and Grafana monitoring. By the end every customer workload had migrated, and the new infrastructure was on track to pay for itself in about six months.

Before and after#

MeasureBeforeAfter
Analytic query time30 to 40 minutesSeconds
Compute costBaseline on AWS EMR90% lower
Storage footprintUncompressed time series10x or more smaller
Infrastructure paybackn/aAbout 6 months

What's next#

With fast, cheap access to years of grid history, PingThings can run far more models over it. Next up are equipment failure prediction and disturbance classification, moving from analysis engineers run by hand into alerts that utilities act on as events happen.

ShareLinkedInEmail

Ingestion: Kafka receives high-rate PMU streams, and Spark jobs on Hadoop (HDFS, YARN) clean and enrich the data in flight. BTrDB stores the time series in a tree structure built for fast time-range queries, with delta-encoded compression and versioning for corrections. BTrDB was selected after benchmarking against InfluxDB and TimescaleDB.

Serving: PostgreSQL holds sensor and asset metadata. REST and WebSocket APIs expose data to customer applications, and Jupyter supports exploratory analysis.

ML and operations: TensorFlow models handle data cleaning and anomaly detection in production. Applications run on Kubernetes, monitored with Prometheus and Grafana, on custom on-premise Hadoop and Spark clusters that replaced AWS EMR.

Next step

Let's build the case study we tell next.