Course contentsShow
← System Design
Lesson 419 of 1,91912. NoSQL: Wide-Column StoresFree lesson

Wide-Column vs Document Stores

Comparing wide-column stores to document databases and when to choose each for your use case.

Wide-Column vs Document Stores

What you'll learn: How to decide between wide-column stores and document databases for your system design.

Both wide-column and document stores fall under the NoSQL umbrella and offer schema flexibility, but they're optimized for fundamentally different access patterns.

Core Differences

Document stores (like MongoDB) organize data as self-contained JSON-like documents. Each document is retrieved and stored as a complete unit. They excel when you need to fetch entire entities at once—a user profile, a product catalog item, or a blog post with all its metadata.

Wide-column stores (like Cassandra, HBase) organize data by row keys with sparse, flexible columns. They're optimized for retrieving subsets of attributes across many rows, especially time-ordered data. You write and read specific columns rather than complete records.

When to Choose Each

Choose document stores when:

  • You retrieve complete entities together (user profiles, product details)
  • Your queries filter and search across multiple fields
  • You need rich indexing on document fields
  • Data naturally groups into discrete, bounded objects
  • You perform aggregations across documents

Choose wide-column stores when:

  • You have time-series or append-heavy workloads (sensor data, logs)
  • You read specific columns, not full records
  • Write throughput is critical (LSM tree architecture shines here)
  • Data is sparse—many empty fields per row
  • You query by row key and column ranges (time windows)

The Mental Model

Think of document stores as filing cabinets where you grab entire folders. Wide-column stores are more like spreadsheets where you scan down specific columns for many rows—perfect when you need "all temperatures from sensor X between 2pm-4pm" but don't care about other sensor attributes.

Key Takeaway: Use document stores for entity-centric queries requiring full objects; use wide-column stores for column-subset queries over time-ordered or sparse data with high write volume.