ConfigsApr 16, 2026·3 min read

Materialize — Streaming SQL Database for Real-Time Analytics

A streaming database that maintains always-up-to-date materialized views using standard SQL, powered by Timely Dataflow and Differential Dataflow engines.

TL;DR
Materialize is a streaming SQL database that keeps materialized views incrementally updated as source data changes in real time.
§01

What it is

Materialize is a streaming database that maintains materialized views using standard SQL. Unlike traditional databases where materialized views are refreshed on a schedule, Materialize keeps views incrementally updated as source data arrives. It is powered by Timely Dataflow and Differential Dataflow, two Rust-based dataflow engines designed for incremental computation.

Materialize targets data engineers and backend developers who need real-time analytics without managing stream processing infrastructure. You write standard SQL to define views, and Materialize handles the incremental maintenance as new events flow in from Kafka, PostgreSQL CDC, or other sources.

§02

How it saves time or tokens

Materialize eliminates the gap between batch and streaming analytics. Instead of building separate ETL pipelines for real-time dashboards, you write a SQL view once and Materialize keeps it current. The PostgreSQL wire protocol means existing SQL tools, BI platforms, and ORMs connect without modification. Incremental computation means only changed data is reprocessed, not the entire dataset.

§03

How to use

  1. Start Materialize with Docker: docker run -d --name materialize -p 6875:6875 materialize/materialized.
  2. Connect using any PostgreSQL client: psql -U materialize -h localhost -p 6875 materialize.
  3. Create sources from Kafka topics or PostgreSQL CDC, define materialized views with SQL, and query them.
§04

Example

-- Connect to Materialize via psql
-- Create a source from Kafka
CREATE SOURCE kafka_events
  FROM KAFKA BROKER 'localhost:9092'
  TOPIC 'user_events'
  FORMAT JSON;

-- Create a materialized view (always up-to-date)
CREATE MATERIALIZED VIEW active_users AS
  SELECT region, COUNT(DISTINCT user_id) AS users
  FROM kafka_events
  WHERE event_type = 'pageview'
    AND mz_timestamp > NOW() - INTERVAL '5 minutes'
  GROUP BY region;

-- Query it like a regular table
SELECT * FROM active_users;
§05

Related on TokRepo

§06

Common pitfalls

  • Materialize is not a general-purpose OLTP database. It is optimized for maintaining materialized views over streaming data. Use PostgreSQL or MySQL for transactional workloads.
  • Memory usage scales with the size of maintained state. Complex joins over large datasets can consume significant RAM. Monitor memory and plan capacity accordingly.
  • Not all SQL features are supported. Window functions and some subquery patterns have limitations. Check the Materialize SQL reference for compatibility.

Frequently Asked Questions

How does Materialize differ from a regular database with materialized views?+

In a regular database, materialized views are refreshed on a schedule (e.g., every hour). In Materialize, views are incrementally updated as source data changes. You always query fresh results without manual refresh commands or stale data.

What data sources does Materialize support?+

Materialize supports Kafka topics, PostgreSQL CDC (change data capture), webhooks, and S3. Kafka is the primary source for streaming data. PostgreSQL CDC lets you mirror tables from an existing database into Materialize.

Can I use existing SQL tools with Materialize?+

Yes. Materialize speaks the PostgreSQL wire protocol. Any tool that connects to PostgreSQL works with Materialize, including psql, DBeaver, Metabase, Grafana, and application ORMs.

What is Timely Dataflow?+

Timely Dataflow is a Rust-based distributed dataflow engine that powers Materialize. It processes data incrementally, meaning only changes are computed rather than reprocessing the entire dataset. Differential Dataflow adds support for maintaining complex aggregations efficiently.

Is Materialize open source?+

Materialize source code is available on GitHub under the Business Source License (BSL). After four years, each version converts to the Apache 2.0 license. Materialize also offers a fully managed cloud service.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets