Notion is a workspace where teams write docs, build wikis and manage projects, all made of blocks. Its product runs on React, TypeScript and Node.js over a sharded Postgres fleet on AWS, with a Kafka, Hudi and Spark data lake built to keep up with billions of blocks.
For about five years Notion ran on a single Postgres database. By 2021 the monolith was waking on-call engineers with CPU spikes, and stalled VACUUM raised the risk of transaction ID wraparound.
The team sharded at the application level instead of adopting Citus or Vitess, to keep control over how data was distributed. Data is partitioned by workspace ID into 480 logical shards, first spread over 32 physical databases and later over 96.
Notion first copied Postgres into Snowflake with Fivetran. That worked for append-heavy data but not for Notion's update-heavy blocks, so in 2022 the team built its own lake.
Debezium captures Postgres changes into Kafka, Apache Hudi writes them to Amazon S3, and Spark does the heavy processing. Snowflake and Fivetran stayed for the cases where they still fit, and the cleaned data feeds search and AI features.
In 2021 Notion added a SQLite cache to its Mac and Windows apps, which made first page loads and navigation about 50% faster.
Later it brought the same idea to the browser with the WebAssembly build of SQLite, stored in OPFS and coordinated across tabs by a SharedWorker. Page navigation got about 20% faster in modern browsers.
Notion's current job posts describe native mobile apps: Android is built with Kotlin and Jetpack Compose, and both iOS and Android share a Rust layer.
On the web and server side, the posts list the same core stack: React, TypeScript, Node.js, Postgres and Elasticsearch, with Go appearing in database infrastructure work.