Remix.run Logo
Rendello 2 hours ago

There's been some good implicit/explicit discussion about SoA on this post [1]. For anyone curious, there are a few different terms that refer to basically the same thing:

- Struct of Arrays (SoA) vs Array of Structs (AoS);

- Row-major order vs column-major order; and

- Row-based vs column based / columnar (in databases)

Most code has arrays of structs (or "lists of objects", the effect is the same), and most databases are row based (same thing). But many game engines use SoA and keep heterogeneous elements together. Some databases like DuckDB do this too, this is an article about the pros and cons of columnar storage in DBs [2].

1. https://news.ycombinator.com/item?id=49012056

2. https://motherduck.com/learn/columnar-storage-guide/