Modern enterprise applications constantly struggle with the fundamental tension between relational data normalization and complex domain object models. When a standard business entity—such as an employee record complete with nested addresses, contact lists, performance reviews, and multi-dimensional dictionaries—is mapped into a traditional relational database, the resulting structure often spans dozens of tables. This structural divergence forces developers to choose between complex ORM (Object-Relational Mapping) configurations with extensive query joining or adopting alternative persistence models. Recently, a comprehensive benchmark pitting Entity Framework Core (EF Core) against redb Pro has illuminated the stark performance trade-offs inherent in handling deep object graphs versus flat relational data.
The core of the performance discrepancy lies in structural reconstruction. Reading a single, highly nested employee record can require as many as 62 individual SQL operations and take nearly two seconds when executed via EF Core on a fully normalized schema. In contrast, running the same workload through redb Pro—operating on equivalent data and structural shapes—completes the read in 131 milliseconds across nine queries on the initial run, dropping to 36 milliseconds and five queries on subsequent cached executions. This disparity does not stem from intrinsic engine efficiency alone, but rather from the fundamental architectural overhead required to stitch disparate relational tables back together into a single application-level business object.
Anatomical Breakdown of the Test Models
To establish a fair methodological framework for comparison, researchers utilized a representative business domain model. The test subject, an EmployeeProps class, contains standard scalar attributes alongside complex collections and nested types: primitive arrays for skills, nested building information linked to multiple addresses, contact metadata dictionaries, and direct object references.
For the EF Core implementation, the engineering team avoided manually constructing the relational schema. Instead, they deployed the redb flat command-line utility from the redb.CLI package to automatically unfold the redb class structure into a fully normalized relational format. This automated DDL (Data Definition Language) generation process produced a schema comprising 54 distinct tables and 59 foreign keys. Every nested class, array, and dictionary spawned its own relation, cascading multiple levels deep for collection elements.
The corresponding C# entity classes were generated using standard scaffolding tools (dotnet ef dbcontext scaffold) without manual tuning. However, reading this object graph through EF Core required developers to write extensive LINQ expressions incorporating 31 explicit Include and ThenInclude chains, finalized with AsSplitQuery(). Without split queries, executing a single SQL query joining 30 independent collections would trigger a Cartesian explosion, multiplying row counts exponentially. Consequently, EF Core issues a separate query for every single collection, creating an administrative and computational burden that scales linearly with the depth of the object graph. Furthermore, this approach necessitates custom application-layer mapping code to manually assemble 54 separate database entities into the unified business class, whereas redb Pro natively returns a strongly typed RedbObject<EmployeeProps> without intermediate mapping layers.
Architectural Evolution: From Pivot Folding to Database Streams

Understanding how redb Pro achieves its performance metrics requires examining its underlying storage and retrieval architecture. Unlike conventional ORMs, redb does not assign a dedicated table to every class. Instead, objects are maintained in a primary table while field values are decoupled into a secondary table, assigning one row per individual field. Nested classes, array elements, and dictionary entries manifest as value rows linked to their respective parents, allowing the engine to store graph hierarchies of arbitrary depth within just two primary tables.
Historically, executing LINQ queries over these decoupled field structures presented significant computational bottlenecks. Earlier iterations of redb relied on a "pivot" mechanism that rebuilt target objects by reading all involved value rows across the entire schema, executing a massive GROUP BY aggregation per object, and only then applying filters, sorting, and pagination. Under this paradigm, the computational cost scaled with the total size of the schema rather than the result set size. Finding a single matching record incurred the exact same performance penalty as scanning millions of rows because the database engine was forced to fold the entire dataset preemptively.
To resolve this limitation, recent architectural updates introduced a query pattern known internally as "streams." In this updated model, the primary object table drives the query execution, while individual fields are incorporated using optimized LEFT JOIN operations rather than aggressive aggregation folding. Filters, sorting parameters, and pagination limits are evaluated directly alongside the joins, empowering the database engine to terminate execution immediately once the requested page is fulfilled.
Comparative benchmark evaluations across PostgreSQL, Microsoft SQL Server, and SQLite demonstrate dramatic performance gains. On PostgreSQL, stream-based queries combined with optimized index column ordering delivered execution speeds up to eight times faster than legacy pivot queries. On SQL Server, where legacy pivot operations frequently incurred execution times scaling into multiple seconds and consumed gigabytes of memory per query, the stream architecture reduced query latencies by factors ranging from 17x to 47x.
Methodological Insights and Benchmark Results
The comparative empirical data published across standardized test suites provide granular insight into where each data access strategy excels. Executed on a standardized test environment containing 100,000 employee records and millions of value rows, the empirical measurements reveal clear operational boundaries.
Median performance metrics over comparable query sets on PostgreSQL demonstrate a decisive advantage for redb Pro when handling complex domain graphs. On initial execution runs across 110 test scenarios, redb Pro recorded a median query time of 107 milliseconds, compared to 816 milliseconds for EF Core—representing a roughly 7.7x performance differential. On repeat executions, this gap widened further, with redb Pro completing requests in 68 milliseconds against EF Core’s 790 milliseconds. When leveraging redb Pro’s built-in properties cache, median execution times dropped to 61 milliseconds.
A granular review of specific query archetypes underscores the structural advantages of redb Pro when retrieving complex domain aggregates:

- Loading a complete employee record by identifier: EF Core required 1,951 milliseconds across 62 queries, whereas redb Pro completed the task in 131 milliseconds across 9 queries.
- Filtering by salary across 100 objects: EF Core consumed 927 milliseconds (31 queries), compared to redb Pro’s 187 milliseconds (5 queries).
- Executing multi-level deep property filtering: EF Core registered 765 milliseconds (31 queries) versus redb Pro’s 62 milliseconds (7 queries).
- Evaluating array containment filters with multiple conditions: EF Core took 1,932 milliseconds, while redb Pro finished in 76 milliseconds.
Conversely, empirical testing unambiguously identifies scenarios where EF Core and traditional relational mapping retain a clear performance advantage. On flat data structures, scalar aggregations, and unnested relational operations, the traditional relational model outperforms decoupled document-style field storage. For instance, executing base-field operations on individual records, performing unnested arithmetic, or executing high-volume arithmetic sums and averages over isolated scalar columns consistently favored EF Core. In scenarios involving basic structural groupings or unnested multi-node tree evaluations, traditional flat tables bypass the join overhead required by decoupled field-value architectures.
Development Velocity and Architectural Implications
Beyond raw execution speed, architectural choices profoundly influence engineering productivity and software maintenance lifecycles. Traditional ORM implementations demand rigorous migration management. Every domain model alteration—such as introducing a new property, relocating an address structure, or converting a string field into a dictionary—requires generating migration scripts, executing schema updates, and meticulously maintaining synchronization across entity classes, fluent mapping configurations, and explicit query inclusion trees.
In contrast, redb Pro’s schema-less field storage paradigm reconciles database structures directly from C# domain classes at application startup. Schema modifications are applied automatically without requiring dedicated migration files. For enterprise environments undergoing rapid product evolution, this dynamic reconciliation eliminates significant administrative overhead.
However, administrators adopting decoupled storage engines must account for operational maintenance demands, particularly regarding database hygiene. Frequent updates to indexed fields within decoupled value tables generate dead tuples and index bloat, necessitating proactive vacuuming and index reindexing strategies in production database management systems like PostgreSQL and SQL Server.
Conclusion
The empirical comparison between EF Core and redb Pro provides a clear roadmap for enterprise system architecture. For domains dominated by deeply nested object graphs, rich domain models, and frequently evolving business requirements, redb Pro delivers order-of-magnitude performance improvements and significantly reduces maintenance overhead. Conversely, for high-throughput, flat data workloads, time-series logging, and unnested scalar analytics, traditional relational architectures utilizing EF Core remain the optimal engineering choice. Modern enterprise applications increasingly benefit from hybrid adoption strategies—deploying graph-centric persistence models for complex domain entities while retaining standard relational tables for high-velocity telemetry and logging streams within the same database ecosystem.




