ArticleslgStudy

science

Data orientation

Data orientation is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Data orientation rather than just read about it. In short: Data orientation is the representation of tabular data in a linear memory model such as in-disk or in-memory. The two most common representations are column-oriented (columnar format) and row-oriented (row format).

Key takeaways

  • Data orientation belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Data orientation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Data orientation from memory before moving on to harder problems.

Reference excerpt

Data orientation is the representation of tabular data in a linear memory model such as in-disk or in-memory. The two most common representations are column-oriented (columnar format) and row-oriented (row format). The choice of data orientation is a trade-off and an architectural decision in databases, query engines, and numerical simulations. As a result of these tradeoffs, row-oriented formats are more commonly used in online transaction processing (OLTP) and column-oriented formats are more commonly used in online analytical processing (OLAP). Examples of column-oriented formats include Apache ORC, Apache Parquet, Apache Arrow, formats used by BigQuery, Amazon Redshift and Snowflake. Predominant examples of row-oriented formats include CSV, formats used in most relational databases (Oracle, MySQL etc.), the in-memory format of Apache Spark, and Apache Avro.

Description Tabular data is two dimensional — data is modeled as rows and columns. However, computer systems represent data in a linear memory model, both in-disk and in-memory. Therefore, a table in a linear memory model requires mapping its two-dimensional scheme into a one-dimensional space. Data orientation is to the decision taken in this mapping. There are two prominent mappings: row-oriented and column-oriented.

Row-oriented In a row-oriented database, also known as a rowstore, the elements of the table

are stored linearly as

I.e. each row of the table is located one after the other. In this orientation, values in the same row are close in space (e.g. similar address in an addressable space).

Examples CSV Postgres in-disk and in-memory formats Apache Spark in-memory format Apache Avro MySQL SAS data sets

Column-oriented In a column-oriented database, also known as a columnstore, the elements of the table

are stored linearly as

I.e. each column of the table is located one after the other. In this orientation, values on the same column are close in space (e.g. similar address in an addressable space).

Examples BigQuery's in-memory and storage formats Apache Parquet Apache ORC Apache Arrow DuckDB in-memory format Pandas in-memory format R dataframes See list of column-oriented DBMSes for more examples.

Tradeoff Data orientation is an important architectural decision of systems handling data because it results in important tradeoffs in performance and storage. Below are selected dimensions of this tradeoff.

Random access Row-oriented benefits from fast random access of rows. Column-oriented benefits from fast random access of columns. In both cases, this is the result of fewer page or cache misses when accessing the data.

Insert Row-oriented benefits from fast insertion of a new row. Column-oriented benefits from fast insertion of a new column. This dimension is an important reason why row-oriented formats are more commonly used in online transaction processing (OLTP), as it results in faster transactions in comparison to column-oriented.

Conditional access Row-oriented benefits from fast access under a filter. Column-oriented benefits from fast access under a projection.

Compute performance Column-oriented benefits from fast analytics operations. This is the result of being able to leverage SIMD instructions.

Uncompressed size Column-oriented benefits from smaller uncompressed size. This is the result of the possibility that this orientation offers to represent certain data types with dedicated encodings. For example, a table of 128 rows with a Boolean column requires 128 bytes in a row-oriented format (one byte per Boolean) but 128 bits (16 bytes) in a column-oriented format (via a bitmap). Another example is the use of run-length encoding to encode a column.

Compressed size Column-oriented benefits from smaller compressed size. This is the result of a higher homogeneity within a column than within multiple rows.

Conversion and interchange Because both orientations represent the same data, it is possible to convert a row-oriented dataset to a column-oriented dataset and vice versa at the expense of compute. In particular, advanced query engines often leverage each orientation's advantages, and convert from one orientation to the other as part of their execution. As an example, an Apache Spark query may

Read data from Apache Parquet (column-oriented) Load it into the Spark internal in-memory format (row-oriented) Convert it to Apache Arrow for a specific computation (column-oriented) Write it to Apache Avro for streaming (row-oriented)

References

Worked examples

Example 1 — a first encounter with Data orientation

Start with the simplest possible case. Write down what Data orientation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Data orientation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Data orientation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Data orientation

In research
Data orientation appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Data orientation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Data orientation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Data orientation, Database models, so understanding it makes those chapters shorter.
In everyday life
Look for Data orientation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Data orientation” →

How to study Data orientation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Data orientation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Data orientation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Data orientation in simple terms?

Data orientation is the representation of tabular data in a linear memory model such as in-disk or in-memory. The two most common representations are column-oriented (columnar format) and row-oriented (row format).

Why does Data orientation matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Data orientation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Data orientation.

Tags

  • Data orientation
  • Database models

Keep exploring