> For the complete documentation index, see [llms.txt](https://til.notdu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.notdu.com/database/intro-to-database-systems/database-storage/tuple-layout.md).

# Tuple layout

A tuple is essentially a sequence of byte

It's the job of DBMS to interpret those bytes into attribute type and values

![](/files/ZLrMm1qVSV7MbE99csVf)

## Tuple header

Each tuple is prefixed of a header that contains metadata about it

* Visible info (concurrency control)
* Bit map for `NULL` values

We do not need to store metadata about the schema.

## Tuple data

Attributes are typically stored in the order that you specify them when you create the table

This is done for software engineering reasons

We re-order attributes automatically in CMU's new DBMS...
