Square Apr 12, 2018

A Massively Multi-User Datastore Synced with Mobile Clients

Article Summary

Tad Book from Square reveals how they built a datastore that handles massive merchant catalogs while keeping mobile devices in sync, even when offline for days. The secret? An append-only architecture that makes the impossible possible.

Square's merchant catalog system needed to handle huge datasets across offline mobile devices, support both granular queries and bulk rewrites, and provide flexibility without constant schema migrations. Their solution combines entity-attribute-value modeling with append-only storage on sharded MySQL to achieve database-like transactions without actual database transactions.

Key Takeaways

Critical Insight

Square achieved per-user transactionality and offline sync at scale by treating all writes as immutable append operations, eliminating traditional database transaction overhead.

The article details how their constraint system syncs validation rules to mobile devices, catching bugs before they ever reach production.

Recent from Square

Related Articles