Square
10 min read

A Massively Multi-user Datastore, Synced with Mobile Clients

Read Full Article

Summary

The article discusses the architectural design of a massively multi-user datastore developed at Square, which is tailored to manage extensive merchant catalogs synced with mobile clients. It emphasizes the challenges of maintaining data consistency and availability across various client states, particularly when offline. The solution employs an entity-attribute-value model to provide both structure and flexibility, allowing for rapid feature development and custom data integration. Key features include synchronizable constraints, an append-only data model for transactional integrity, and a rollback mechanism for maintaining historical data states. The design aims to ensure that clients can operate with predictable data formats while allowing for extensibility and efficient data management.

Key Learnings

  • 1The use of an entity-attribute-value model allows for a flexible yet structured approach to data management, accommodating diverse client needs.
  • 2Implementing synchronizable constraints as catalog objects enhances data integrity and client-side validation without requiring schema changes.
  • 3An append-only data model facilitates transactional properties while enabling efficient rollback and history tracking capabilities.
  • 4The architecture supports both location-aware and merchant-aware clients, optimizing data delivery based on client context.
  • 5By allowing clients to create new object types and attribute definitions via API, the system promotes rapid iteration and customization.

Who Should Read This

Senior Software Architects designing scalable, multi-tenant data solutions for mobile applications.

Test Your Knowledge

?

What are the trade-offs of using an entity-attribute-value model compared to traditional relational databases in this context?

?

How does the append-only data model impact the performance of read and write operations during high concurrency?

?

What failure scenarios could arise from the use of synchronizable constraints, and how can they be mitigated?

?

In what ways does the architecture support scalability as the number of merchants and data volume increases?

?

Why is it important to allow clients to create new object types and attribute definitions, and what implications does this have for data governance?

Topics

Read Full Article at Square