Structure of Arrays: Storing each field of a collection of records in its own contiguous array, instead of an array of objects — better for cache locality and SIMD. Structure of Arrays is a way of laying out data in memory. Instead of one array of objects, each with its own fields, you keep one array per field: all prices together, all quantities together, all IDs together.
Frequently asked questions about Structure of Arrays
How is Structure of Arrays used in practice?
When code processes one field across many records, such as summing prices, the values sit next to each other in memory. The processor reads them efficiently and can use SIMD instructions to handle several at once.
What should you keep in mind with Structure of Arrays?
Game engines, scientific computing and analytical databases use this layout for speed. Column-oriented databases like ClickHouse and file formats like Parquet apply the same idea to storage, which is why they are so fast for reports. In typical web applications, you meet the benefit through those tools rather than by restructuring your own objects.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.