---
title: "Build a real-time market data app with ClickHouse and Massive"
description: "A real-time tick data app can stream stock trades and quotes from Massive (formerly Polygon.io) over WebSockets straight into ClickHouse, with a Node.js backend and a React frontend for live visualization."
url: "https://swe.quest/articles/build-a-real-time-market-data-app-with-clickhouse-and-massive-0320c9b65a8a9694"
canonical: "https://clickhouse.com/blog/build-a-real-time-market-data-app-with-clickhouse-and-polygonio"
source: "ClickHouse"
published: "2026-09-04"
difficulty: "medium"
kind: "How-to"
reading_minutes: 15
tags: ["analytics","realtime","javascript","sql","react"]
---

# Build a real-time market data app with ClickHouse and Massive

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-09-04, 15 min read, How-to. Original: [https://clickhouse.com/blog/build-a-real-time-market-data-app-with-clickhouse-and-polygonio](https://clickhouse.com/blog/build-a-real-time-market-data-app-with-clickhouse-and-polygonio)

## Summary

A real-time tick data app can stream stock trades and quotes from Massive (formerly Polygon.io) over WebSockets straight into ClickHouse, with a Node.js backend and a React frontend for live visualization. Trades and quotes go into separate MergeTree tables ordered by symbol and a one-minute time bucket. A single client batches synchronous inserts (flush at 1,000 rows or every 2 seconds, with bounded buffers) rather than using async inserts or Kafka. SQL queries using argMax/argMin over (timestamp, sequence) tuples power a live quote table and candlestick charts, with stated caveats about data loss, decimal types and trade-condition handling.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [SQL](https://swe.quest/tags/sql.md) (Languages)
- [React](https://swe.quest/tags/react.md) (Web & mobile)

## Prerequisites

- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- Node.js ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- WebSockets ([easy posts on Real-time systems](https://swe.quest/tags/realtime.md?difficulty=easy))

## Keywords

ClickHouse, Massive, Polygon.io, MergeTree, Node.js, React, WebSockets

## Related posts

- [Building StockHouse: Real-time market analytics with ClickHouse](https://swe.quest/articles/building-stockhouse-real-time-market-analytics-with-clickhouse-84e9bb5a68744806.md): ClickHouse · 2025-11-13 · Medium · 6 min read · Analytics & OLAP, Stream processing, SQL, Go
  StockHouse is a reference streaming analytics app that ingests live stock and crypto ticks from Massive's WebSocket APIs through a Go ingester into ClickHouse and renders them in a Vue dashboard built on Perspective.
- [How Bullet uses ClickHouse Cloud to give DeFi's fastest exchange real-time analytics](https://swe.quest/articles/how-bullet-uses-clickhouse-cloud-to-give-defi-s-fastest-exchange-real-time-2e306d9fa945673c.md): ClickHouse · 2026-07-15 · Medium · 9 min read · Analytics & OLAP, Data pipelines, Databases, Payments & fintech
  Bullet, a Rust-based DeFi perpetuals exchange running as an app-specific rollup on Solana with ~500μs p50 order processing, indexes 150M+ rows per hour of sequencer events into ClickHouse Cloud for trade history, real-time analytics and monitoring.
- [Streaming Real-Time Visualizations with ClickHouse, Apache Arrow and Perspective](https://swe.quest/articles/streaming-real-time-visualizations-with-clickhouse-apache-arrow-and-perspective-7d2ccb1a3cd92435.md): ClickHouse · 2024-10-02 · Medium · 13 min read · Analytics & OLAP, Frontend, Real-time systems, SQL, WebAssembly
  A ~100-line browser demo streams forex tick data from ClickHouse into the Perspective visualization library (Rust/C++ compiled to WebAssembly) using Apache Arrow over HTTP.
- [Why Flock Safety turned to ClickHouse for real-time vehicle traffic analytics](https://swe.quest/articles/why-flock-safety-turned-to-clickhouse-for-real-time-vehicle-traffic-analytics-f35b2dcb28006f8a.md): ClickHouse · 2025-04-29 · Medium · 5 min read · Analytics & OLAP, Data pipelines, Cloud platforms
  Flock Safety replaced a once-daily Redshift, DBT, Prefect and QuickSight SPICE pipeline with ClickHouse Cloud.
- [Trade secrets: How Coinhall uses ClickHouse to power its blockchain data platform](https://swe.quest/articles/trade-secrets-how-coinhall-uses-clickhouse-to-power-its-blockchain-data-platform-a19f7fb99396fe78.md): ClickHouse · 2024-08-14 · Easy · 5 min read · Analytics & OLAP, Databases, Performance engineering, Cost optimization
  Coinhall, an omnichain trading terminal aggregating swap data from 23 blockchains, moved from BigQuery (about 2-second queries, thousands of dollars per month) to QuestDB and then to self-hosted ClickHouse.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
