Notion's engineering team faced significant challenges in scaling their monolithic PostgreSQL database due to rapid user base growth. They decided to implement database sharding, with the Block table and related tables being sharded using Workspace ID as the key. The migration involved a double-write phase and verification to ensure data integrity. Despite some lessons learned, such as the importance of starting early and aiming for zero downtime, the outcome was a more scalable and faster system for Notion's users.

7m read timeFrom newsletter.francofernando.com
Post cover image
Table of contents
Notion's Database Scaling ChallengeSharding Strategy and Design DecisionsImplementation and Migration ProcessLessons LearnedReferencesInteresting Reading
1 Comment

Sort: