CRDTs for Collaborative Apps.

CRDTs (Conflict-free Replicated Data Types) are data structures that automatically merge concurrent edits across devices—ensuring eventual consistency in collaborative apps without needing a central coordinator.

When to use/Use Cases

  • Real-time collaborative editors (Google Docs, Figma)
  • Shared notes and whiteboards
  • Chat apps with offline support
  • Geo-distributed data syncing

Example

If Alice types “Hi” offline and Bob adds “!”, a text CRDT ensures both edits merge into “Hi!” once they reconnect.

Preparing for interviews?

Learn core concepts with Grokking System Design Fundamentals, practice patterns in Grokking the Coding Interview, or book Mock Interviews with ex-FAANG engineers for hands-on feedback.

Why Is It Important

  • Enables low-latency local writes
  • Handles network partitions gracefully
  • Supports offline-first experiences
  • Scales horizontally with distributed replicas

Interview Tips

  • Know CRDT types: G-Counter, PN-Counter, OR-Set, LWW-Register, RGA (for text).
  • Contrast with Operational Transformation (OT).
  • Explain convergence, idempotency, and causality.
  • Use a clear example timeline to show how merges happen.

Trade-offs

Pros: offline-first UX, automatic conflict resolution, resilience. Cons: metadata overhead, storage growth (tombstones), eventual—not strict—consistency.

Pitfalls

  • Assuming CRDTs guarantee strong consistency
  • Overusing last-writer-wins (risk of data loss)
  • Ignoring garbage collection of metadata
  • Applying CRDTs to global invariants like unique usernames
TAGS
System Design Interview
System Design Fundamentals
CONTRIBUTOR
Design Gurus Team
-

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Image
One-Stop Portal For Tech Interviews.
Copyright © 2025 Design Gurus, LLC. All rights reserved.