Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is like Array of Structures vs Structure of Arrays[1].

As mentioned, with a SoA approach it's much easier to replace a subset of the entire data. If you have control over the array pointers you could simply swap pointers, leading to an essentially free update.

Downside is that it's a lot more work (and usually less cache friendly) if you need to update all the data.

[1]: https://en.wikipedia.org/wiki/AOS_and_SOA



I guess column-oriented databases are also conceptually similar, though structure of arrays is certainly a closer analog.

Back in the days of planar graphics, usually cache didn't matter because there wasn't one. The difference between CPU and memory speeds was not so lopsided as it is today. Or you could say, memory was fast enough because CPUs were very slow.


> I guess column-oriented databases are also conceptually similar, though structure of arrays is certainly a closer analog.

Isn't a column oriented database pretty much just an SoA on disk. And a row oriented database is pretty an AoS on disk. modulo some complexity around indexes?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: