🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz

How does benchmarking compare columnar and row-based storage?

Benchmarking columnar and row-based storage involves comparing their performance in different scenarios to determine which is better suited for specific workloads. Columnar storage organizes data by columns, making it efficient for analytical queries that read specific fields across many rows. Row-based storage stores entire rows together, optimizing transactional operations that require accessing or updating full records. The choice depends on the workload type: analytical systems benefit from columnar’s speed in scanning columns, while transactional systems rely on row-based’s efficiency in handling individual records.

Key factors in benchmarking include query speed, storage compression, and write performance. For analytical queries (e.g., aggregating sales data across millions of rows), columnar storage excels because it reads only the relevant columns, reducing I/O and leveraging compression (e.g., repeated values in a column can be compressed to save space). In contrast, row-based storage performs poorly here, as it must read entire rows, including irrelevant columns. However, for transactional queries (e.g., retrieving a user’s complete profile), row-based storage is faster because all related data is stored contiguously. Write operations also differ: row-based allows faster inserts (appending a single row), while columnar requires writing to multiple column files, slowing bulk inserts.

Practical examples highlight these trade-offs. A benchmark of a "SUM(sales_amount)" query on a 10-million-row dataset might show columnar storage completing in seconds due to column-wise scanning and compression, while row-based takes minutes. Conversely, a query like “SELECT * WHERE user_id = 1001” would finish faster in a row-based system, as it retrieves the entire row in one read. Compression ratios also vary: a column of timestamps in columnar storage might compress to 20% of its original size, whereas row-based struggles to achieve similar savings due to mixed data types. These results guide developers—use columnar for analytics (e.g., Redshift) and row-based for transactional workloads (e.g., PostgreSQL).

Like the article? Spread the word