Data-oriented design (DOD) is a way of organizing software around how data is stored, laid out, and accessed in memory, rather than around objects or conceptual models. It treats memory layout, cache behavior, and data access patterns as the primary design concerns, and it lets those concerns drive how code and data structures are shaped. The term is most often used in game development, simulation, and other performance-sensitive systems programming, but the underlying idea—design for how the machine actually reads and writes data—applies to any software where speed and memory efficiency matter.
A useful way to see what distinguishes DOD is to contrast it with the approach most programmers learn first. In object-oriented design, you typically model the world as a collection of objects, each carrying its own data and behavior, and you write code that sends messages between them. In data-oriented design, you ask instead: what data exists, what transformations does it need to go through, and what is the most efficient layout for those transformations? The design follows the data and its access patterns, not the conceptual categories we use to talk about the problem.
The Core Idea
The central claim of data-oriented design is that on modern hardware, performance is governed less by the number of operations a program performs and more by where the data those operations need actually lives. Modern CPUs are far faster than main memory. Processors hide this gap with caches—small, fast memory regions that hold recently used data—and by fetching data in contiguous blocks called cache lines. If your code touches memory in a scattered, unpredictable order, the CPU spends much of its time waiting for data to arrive from main memory, and that waiting dominates runtime.
DOD takes this seriously. It favors data layouts that keep the fields a computation actually needs close together and processed in sequence, so the CPU can stream through memory efficiently. It tends to favor arrays of values over linked structures, flat buffers over trees of pointers, and logic that processes one property across many entities over logic that processes many properties on one entity at a time.
This is not a rejection of abstraction. It is a different ordering of priorities. DOD still uses functions, modules, and types. It just decides those things after understanding the data and how it will be traversed.
Where the Term Comes From
The phrase was popularized by game developers, notably through Mike Acton's talks at CppCon in the mid-2010s, where he argued for designing around data transformations and actual memory behavior rather than around object hierarchies. The idea grew out of a practical frustration: game engines had accumulated object-oriented architectures that looked elegant on paper but performed poorly because they churned through memory in cache-unfriendly ways.
It is worth separating data-oriented design from data-oriented programming in the specific sense some developers use it—a style built around "generic" processing of components, often associated with entity-component-system (ECS) architectures. ECS is one concrete pattern that embodies DOD principles, but it is not the whole of DOD. You can apply DOD thinking to a simple array-processing routine or a database engine without adopting ECS. Conversely, slapping an ECS library onto an object-modeled game does not automatically make it data-oriented if the underlying storage is still scattered.
The Reasons DOD Works
The benefits of DOD come from a small number of hardware realities that compound.
First, memory access latency and bandwidth are the bottleneck for many workloads, not arithmetic. A cache miss to main memory can cost hundreds of cycles, during which the CPU may have little to do. When data is laid out contiguously and accessed in order, hardware prefetchers can bring in the next cache line before you need it, and cache lines are used fully rather than wasted.
Second, cache lines are typically 64 bytes on common x86-64 and many ARM systems. If a cache line holds 64 bytes and your program touches only 8 bytes of it before moving on, you have paid for the whole line and used a fraction. Structuring data so that the fields needed together are adjacent—and so that irrelevant fields are not dragged in—makes each line do more useful work.
Third, predictable access patterns let compilers and hardware optimize. Tight loops over arrays can be vectorized, though vectorization depends on the operation, the types, aliasing, and compiler capability. A linked list rarely vectorizes. A contiguous scan often can.
Fourth, data-oriented structures make the actual work visible. When you design around transforms, you are forced to confront what the program really does with its data, which often reveals redundancy, unnecessary copying, and work that can be eliminated—sometimes producing large gains before any low-level tuning.
A Concrete Contrast
Imagine a program that tracks a large number of particles. In a typical object-oriented version, each particle might be an object with a position, velocity, and color, stored as separate heap allocations or in a container of objects. A loop updating positions calls through each object and reads its velocity and position. Because objects are scattered in memory, the loop may touch many cache lines to process a few useful values, and the fields it does not need still occupy space in each cache line.
In a data-oriented version, positions might live in one array, velocities in another, and colors in a third. The update loop iterates over the velocity and position arrays in step, reading and writing contiguous memory. The colors, unused during the update, are never loaded. The loop is simple, predictable, and easy for the hardware to prefetch; it may also be vectorizable. The same computation happens, but the machine executes it far more efficiently.
This is the "array of structures versus structure of arrays" distinction that DOD writers often emphasize. Neither is universally correct. If you always access all fields of a record together, an array of structures can be the better fit because one cache line holds the whole record. The right choice depends on which fields are accessed together and how often. That dependency is the essence of data-oriented design: there is no universal layout, only a layout suited to the access pattern.
Data-Oriented Design Versus Object-Oriented Design
The most common source of confusion is the relationship between DOD and object-oriented design. They are often framed as rivals, but the accurate picture is more nuanced.
Object-oriented design is a way of organizing code around encapsulated objects, inheritance, polymorphism, and interfaces. It is a tool for managing complexity and expressing domain relationships in code. DOD is a way of organizing data and computation around memory behavior. These are different axes. You can have object-oriented code that is cache-friendly, and you can have DOD code that is poorly organized as software. Many production systems blend the two: objects at the level where programmer comprehension matters, and flat, data-oriented storage underneath where performance matters.
The real tension appears at the extremes. When object-oriented design leads to a proliferation of small heap-allocated objects linked by pointers, deep inheritance chains, and interfaces invoked per element, it can produce code that is both hard to optimize and slow. DOD pushes back by asking whether those structures earn their cost. That is a discipline, not a doctrine.
Common Misconceptions
Several beliefs about DOD deserve correction.
"DOD means abandoning abstraction." It does not. It changes what drives the abstraction. Good DOD code often has helper functions, well-named types, and clean interfaces—they are simply shaped by data flow rather than by a conceptual object model.
"DOD is only for games." Games popularized it because they hit performance walls, but the principles apply to databases, simulations, data processing pipelines, audio and video processing, and anywhere large datasets are traversed repeatedly. Wherever locality matters, DOD thinking pays off.
"DOD is the same as ECS." ECS is a design pattern—entities are identifiers, components are pure data, systems process components—that aligns well with DOD principles. But DOD is broader, and ECS is not mandatory. Many data-oriented designs use plain arrays and loops and never build a component system.
"DOD is a replacement for measuring performance." It is not. Data-oriented redesign can yield large speedups, but data layout interacts with hardware in ways that are hard to fully predict. Measurement and profiling remain essential to confirm that a change actually helped.
How Data-Oriented Design Is Practiced
Practitioners of DOD tend to work through a recognizable sequence, even if they do not formalize it.
They start by identifying the actual data the system needs and the transformations it performs on that data. This often means listing the operations: update positions, resolve collisions, compute damage, render. Then they ask how often each operation runs and how it traverses the data.
Next they choose representations—arrays, packed structs, indexed records, contiguous buffers—that fit those traversals and allocate memory in a way that keeps related data close. They avoid unnecessary indirection where it costs more than it buys, and they separate hot data (accessed frequently) from cold data (accessed rarely) so that cold data does not pollute caches.
Then they write the code that processes the data in batches, often with a clean loop that touches contiguous memory, and they measure. When a layout or algorithm underperforms, they revise it. The cycle emphasizes the data access pattern as the thing to reason about.
Data-Oriented Design and Performance: Realistic Expectations
DOD is pitched at memory-bound problems. If a program is already limited by something else—a slow network, disk I/O, user interaction, or arithmetic-heavy computation—data layout may not be the dominant lever. And DOD is not free: it can make some code less intuitive to read, push complexity around, and require rewriting code that was written around different assumptions. The gains depend on the scale of data, the regularity of access, and the hardware.
It is also worth separating DOD from micro-optimizations. DOD is about structure—how data is shaped and traversed—not about hand-tuned instruction sequences. A well-structured data-oriented program is a good starting point for optimization, but it is not a guarantee of maximal speed. And because hardware details (cache size, memory latency, prefetch behavior) vary across machines, a layout that is excellent on one system may be merely good on another. DOD writers therefore tend to favor patterns that are robustly efficient across hardware rather than tuned to a single machine.
Where DOD Makes the Most Sense
The strongest cases for DOD arise when:
A system processes large collections of similar data repeatedly. Access patterns are regular and predictable, so contiguous layouts pay off. Performance is a primary requirement, not an incidental nicety. Data outgrows cache and memory bandwidth becomes a constraint.
These conditions describe game engines, physics simulations, particle systems, large-scale data analytics, and certain database and storage engines. In contrast, for small datasets, one-off scripts, user-facing applications whose bottleneck is elsewhere, and code that must prioritize flexibility and evolution over raw throughput, DOD may be unnecessary overhead. The design choice should follow the actual requirements, not a taste for either extreme.
The Practical Takeaway
The most useful way to understand data-oriented design is as a habit of asking: what does the machine actually do with this data, and is the data laid out so that those actions are efficient? That question is more valuable than any single rule. It leads naturally to considering cache lines, access patterns, and data transforms, and it pushes you to measure rather than assume.
DOD does not ask you to abandon good software design. It asks you to put data, and the hardware's treatment of it, at the center of the design conversation—especially when performance is a real requirement. The label "data-oriented design" gives that approach a name and a body of examples, but the underlying discipline is simply paying attention to the thing that modern processors spend most of their time waiting on.