Wide-column database

Also known as: wide-column store

On this page 7

A wide-column database (also called a wide-column store) is a NoSQL database model that organizes data into rows grouped by a partition key, where each row can contain a flexible and potentially very large set of named columns. Among database models it is designed for massive write throughput and horizontal scaling across many nodes, and its best-known implementations in databases today are Apache Cassandra, ScyllaDB, Apache HBase and Google Cloud Bigtable.

The model descends from Google’s Bigtable design, published in 2006, which described a sparse, distributed, persistent sorted map indexed by row key, column and timestamp. The name refers to the fact that one row may hold thousands or even millions of columns, unlike the fixed and narrow rows of a relational table.

How a wide-column database organizes data

Data in a wide-column database is addressed by a hierarchy of keys. The partition key decides which node stores a row, and within a partition the rows are kept sorted by clustering columns, so related records sit physically next to each other on disk. Reading one partition is therefore a fast, mostly sequential operation.

Columns are sparse: a row stores only the columns that actually have values, and different rows in the same table may hold different columns. In HBase and Bigtable, columns are further grouped into column families, which are stored separately and tuned independently.

ElementPurposeDesign consequence
Keyspace or namespaceTop-level container with replication settingsDefines copies per data center
Partition keyDistributes rows across nodesMust spread load evenly
Clustering columnsSort rows inside a partitionEnable range queries within a partition
Column familyGroups columns stored togetherSeparate storage and tuning
Cell timestampVersion of each valueResolves concurrent writes
Core elements of the wide-column data model

Storage engine and write path

Most wide-column databases use a log-structured merge tree (LSM tree). A write is appended to a commit log for durability and inserted into an in-memory table called a memtable. When the memtable fills, it is flushed to disk as an immutable sorted file, an SSTable in Cassandra terminology or an HFile in HBase.

Because writes never modify files in place, they are sequential and very fast, often completing in well under a millisecond on a local node. The cost appears later: background compaction merges SSTables, removes overwritten values and purges deletions marked by tombstones. Reads may have to check several SSTables, which Bloom filters and caches keep affordable.

Replication is configured per keyspace, commonly with a replication factor of 3. Cassandra and ScyllaDB use a leaderless design with tunable consistency: each request chooses how many replicas must answer, for example ONE, QUORUM or LOCAL_QUORUM. HBase and Bigtable instead assign each key range to a single serving node and rely on an underlying distributed file system for replicas.

Wide-column compared with other database models

A wide-column database is often confused with a columnar database, yet the two solve opposite problems. A columnar database stores each column separately to scan billions of values quickly for analytics; a wide-column database stores rows grouped by partition to serve high-volume operational reads and writes by key.

ModelData unitStrongest useTypical examples
Wide-column databasePartitioned rows with flexible columnsHigh write volume, key-based accessCassandra, HBase, Bigtable
Columnar databaseColumn segmentsAnalytical aggregationsClickHouse, Amazon Redshift
Key-value storeOpaque value per keySimple lookups and cachingRedis, DynamoDB in simple use
Document databaseJSON-like documentsFlexible application objectsMongoDB, Couchbase
Relational databaseNormalized rowsJoins and ACID transactionsPostgreSQL, MySQL
Wide-column databases and neighboring models

Compared with a time-series database, a wide-column store is more general but can model time series well by using a time bucket in the partition key and a timestamp as a clustering column. Many early monitoring platforms were built this way.

Query-first data modeling

Wide-column modeling starts from the queries, not from the entities. Because joins are not supported and filtering on non-key columns is expensive or restricted, each important query usually gets its own table, and data is deliberately duplicated across tables at write time.

DecisionGood practiceRisk if ignored
Partition key choiceHigh cardinality, even accessHot partitions on a few nodes
Partition sizeKeep well below about 100 MBSlow reads and repairs
Time bucketingAdd day or hour to the keyPartitions that grow forever
Clustering orderMatch the most common sortExtra sorting in the application
DenormalizationOne table per query patternInefficient scans or secondary indexes
Modeling decisions and their effect

The typical schema language is CQL in Cassandra and ScyllaDB, which looks similar to SQL but only allows queries that the key structure can answer efficiently. Teams arriving from relational systems often find this the steepest part of the learning curve.

Limitations and common mistakes

Wide-column databases trade query flexibility for scale, and the trade-off becomes painful when ignored.

  • No joins and limited ad hoc queries: analytics usually require exporting data to another system.
  • Limited transactions: lightweight transactions exist in Cassandra but are much slower than normal writes.
  • Tombstone buildup from frequent deletes can slow reads severely or cause query failures.
  • Eventual consistency at low consistency levels can return stale values.
  • Operational complexity: compaction tuning, repairs and capacity planning need experienced operators.

Understanding it simply

Imagine a huge filing room spread across many buildings. Each customer gets a folder, and the folder always lives in the same building. Inside the folder, new pages can be added endlessly, and every folder can hold different kinds of pages.

Finding one customer’s folder is very fast. Adding new pages is even faster. Comparing information across all folders, however, takes a long time, so this kind of database suits huge volumes of simple, predictable lookups.

Applied in practice

A company that operates smart electricity meters collects a reading from two million meters every 15 minutes, almost 200 million rows per day. A single relational server cannot absorb that write volume while keeping years of history.

The engineers deploy a six-node Cassandra cluster with a replication factor of 3. The table uses the meter ID and month as the partition key and the reading time as a clustering column, so each partition holds one meter’s month of data in time order. Writes are spread evenly across the nodes, and the customer portal reads a full month for one meter in a few milliseconds. When volume grows, the team adds nodes without downtime.