Use a JSON column (ComplexProperty(...).ToJson() or OwnsOne/OwnsMany(...).ToJson()) for data that is owned by one row, read and written with it, and rarely queried alone: preferences, a variable set of attributes, a snapshot of an address at order time. Use tables when you need to join, filter or aggregate across rows at scale, enforce foreign keys, unique or check constraints, or update parts concurrently. Performance trade-off: reading the whole document with its owner is cheap (one row, no join), but filtering inside JSON means parsing every document unless you index it. On SQL Server, index a property by adding a computed column over JSON_VALUE(Data, '$.Country') and indexing that column; it works on every supported version. EF Core 10 can map to the native json data type on Azure SQL and SQL Server 2025, which stores documents in a binary form that is faster to read; check your target's support for dedicated JSON indexes before relying on them.
"I ask how the data is used. If it always travels with its owner, has a shape that varies, and nobody queries it on its own, JSON is a good fit: user preferences, a product's optional attributes, the shipping address as it was when the order was placed. One row, one read, no join, and the schema can evolve without a migration per attribute.
As soon as I need to join to it, enforce a foreign key or uniqueness, aggregate across many rows, or let two users update different parts at the same time, it belongs in tables. A JSON document is a single value to the database: constraints can't reach inside it and any update rewrites the whole thing.
In EF Core I map it with
ToJson(), and queries likeWhere(c => c.Preferences.Country == \"AU\")translate toJSON_VALUE. Without an index that parses every row. On SQL Server the reliable way to index is a persisted or non-persisted computed column overJSON_VALUEwith an ordinary index on it; the optimiser matches the expression. EF Core 10 also maps to the nativejsontype on Azure SQL and SQL Server 2025, which avoids reparsing text and is the default I'd pick on those targets."
modelBuilder.Entity<Customer>().ComplexProperty(c => c.Preferences, p => p.ToJson());
ALTER TABLE dbo.Customers ADD PrefCountry AS JSON_VALUE(Preferences, '$.Country');
CREATE INDEX IX_Customers_PrefCountry ON dbo.Customers(PrefCountry);
| Need | JSON column | Tables |
|---|---|---|
| Read with owner | One row, fast | Join |
| Filter across rows | Needs computed-column index | Normal indexes |
| Constraints and FKs | No | Yes |
| Schema changes | No migration per attribute | Migration |
| Concurrent partial updates | Whole document rewritten | Row-level |
Moving [25] sparse product attribute columns into one JSON column removed a [mostly-NULL] wide table; the one attribute used in search got a computed-column index and kept its query under [10 ms].
Checks storage judgement for JSON mapping.
Last updated 23 Nov 2026.