Skip to content

Feature Comparison With Alternatives

Aryeh Citron edited this page Apr 27, 2026 · 11 revisions

vs Official Cosmos DB Emulators

Microsoft provides three official emulators, each with a significantly different architecture:

Windows Emulator (GA) Linux Docker (:latest) Linux vNext (:vnext-preview)
Architecture Standalone Windows desktop application (MSI installer). Runs as a Windows service. Docker image — the Windows emulator ported to a Linux container via SQLPAL compatibility layer. Essentially Windows binaries running on Linux. Docker image — a ground-up rewrite. Lightweight gate-level simulation backed by PostgreSQL internally.
Image / install size ~2 GB install + 10 GB disk ~2 GB Docker image ~200 MB Docker image
Typical startup time 10–30 s 30–60 s (can take minutes in CI) 3–5 s
Connection mode Gateway + Direct Gateway + Direct Gateway only
Supported APIs NoSQL, MongoDB, Cassandra, Gremlin, Table NoSQL, MongoDB, Cassandra, Gremlin, Table NoSQL only
Platform Windows only (64-bit Server 2016+, Win 10/11) Linux / macOS / Windows (Docker) — but no Apple Silicon or ARM Linux / macOS / Windows (Docker) — ARM64 supported
Status GA (but lagging behind the cloud service) Effectively abandoned — still GA in name, but critically broken for many users Preview — active development, frequent releases

Setup & Operations

Feature CosmosDB.InMemoryEmulator Windows Emulator (GA) Linux Docker (:latest) Linux vNext (preview) Real Azure Cosmos DB
Pricing ✅ Free ✅ Free ✅ Free ✅ Free ❌ Pay-per-RU + storage
In-process (no external deps) ✅ ❌ Installer ❌ Docker ❌ Docker ❌ Requires network
Fast startup ✅ Instant ❌ 10–30 s ❌ 30–60 s ⚠️ 3–5 s ❌ Provisioning minutes
Works offline ✅ ✅ ✅ ✅ ❌ Requires internet
CI-friendly ✅ ⚠️ Flaky (Windows runners) ❌ Frequently broken in CI (#86) ⚠️ Docker setup required; regressions between releases ⚠️ Needs secrets, network, costs
Multiple instances / parallel ✅ One per test ❌ Single instance only ⚠️ Multiple containers possible ⚠️ Multiple containers possible ⚠️ Shared state; needs cleanup
Test isolation ✅ New instance per test ⚠️ Shared state ⚠️ Shared state ⚠️ Shared state ❌ Shared; risk of data leakage
Stable under load ✅ No sockets/network ⚠️ Socket exhaustion, 407s, hangs ❌ Crashes, 429s, 503s under non-trivial load ⚠️ CPU spikes after prolonged use (#267) ✅ (at cost)
No crashes / corruption ✅ Pure in-memory ⚠️ Can spike CPU, enter corrupted state ❌ PAL PANIC core dumps, fatal errors, evaluation expiry crashes ⚠️ Regressions break features between releases (patch, batch, aggregates) ✅
Platform support ✅ Any (.NET) ❌ Windows only ⚠️ Linux / macOS / Windows; no ARM ✅ Linux / macOS / Windows; ARM64 supported ✅ Any platform
No special reset needed ✅ Dispose and recreate ⚠️ May need "Reset Data" or /DisableRIO ⚠️ Sometimes needs container replacement ✅ Recreate container ⚠️ Manual cleanup
Custom auth keys ✅ Any / none ⚠️ Well-known key; restart to change ⚠️ Well-known key ⚠️ Well-known key (configurable via --key-file) ✅
Serverless throughput mode ✅ (no RU enforcement) ❌ Provisioned only ❌ Provisioned only ❌ Provisioned only ✅
Unlimited containers ✅ ⚠️ Degrades past 10 fixed / 5 unlimited ⚠️ Same limits as Windows ✅ ✅
Connection mode ✅ Gateway (via FakeCosmosHandler) ✅ Gateway + Direct ✅ Gateway + Direct ⚠️ Gateway only ✅ Gateway + Direct
Evaluation period / expiry ✅ None ✅ None ❌ Periodic expiry; must pull latest image ✅ None ✅ None
SSL certificate setup ✅ None needed ⚠️ Self-signed; auto-installed ⚠️ Manual cert export + install ⚠️ Manual cert or use --protocol http ✅ Managed
Community sentiment ✅ ⚠️ Grudging acceptance on Windows ❌ Widely despised — "broken", "souring our perception of Cosmos" (dozens of complaints) ⚠️ Promising but immature — "frequent regressions" in preview ✅ Trusted (at cost)

Detailed Feature Parity

Legend:

  • ✅ = Full support
  • ⚠️ = Partial support (details in Notes)
  • ❌ = Not supported

CRUD & Data Operations

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
CreateItemAsync ✅ ✅ ✅ ✅ ✅
ReadItemAsync ✅ ✅ ✅ ✅ ✅
UpsertItemAsync ✅ ✅ ✅ ✅ ✅
ReplaceItemAsync ✅ ✅ ✅ ✅ ✅
DeleteItemAsync ✅ ✅ ✅ ✅ ✅
PatchItemAsync ✅ ✅ ✅ ⚠️ ✅ vNext: regressions (#246)
CreateItemStreamAsync ✅ ✅ ✅ ✅ ✅
ReadItemStreamAsync ✅ ✅ ✅ ✅ ✅
UpsertItemStreamAsync ✅ ✅ ✅ ✅ ✅
ReplaceItemStreamAsync ✅ ✅ ✅ ✅ ✅
DeleteItemStreamAsync ✅ ✅ ✅ ✅ ✅
PatchItemStreamAsync ✅ ✅ ✅ ⚠️ ✅ vNext: regressions (#246)
ReadManyItemsAsync ✅ ✅ ✅ ✅ ✅
ReadManyItemsStreamAsync ✅ ✅ ✅ ✅ ✅
DeleteAllItemsByPartitionKeyStreamAsync ✅ ✅ ✅ ✅ ✅

Patch Operations

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
Set ✅ ✅ ✅ ⚠️ ✅ vNext: had regressions
Replace ✅ ✅ ✅ ⚠️ ✅
Add ✅ ✅ ✅ ⚠️ ✅
Remove ✅ ✅ ✅ ⚠️ ✅
Increment ✅ ✅ ✅ ⚠️ ✅
Move ✅ ✅ ✅ ⚠️ ✅
Conditional patch (filter predicate) ✅ ✅ ✅ ⚠️ ✅ vNext: precondition handling bugs (#242)
Atomic rollback on failure ✅ ✅ ✅ ⚠️ ✅

Transactional Batch

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
CreateItem in batch ✅ ✅ ✅ ⚠️ ✅ vNext: 403 / missing-id regressions (#243, #247)
ReadItem in batch ✅ ✅ ✅ ⚠️ ✅
UpsertItem in batch ✅ ✅ ✅ ⚠️ ✅
ReplaceItem in batch ✅ ✅ ✅ ⚠️ ✅
DeleteItem in batch ✅ ✅ ✅ ⚠️ ✅
PatchItem in batch ✅ ✅ ✅ ⚠️ ✅
Atomic rollback (all-or-nothing) ✅ ✅ ✅ ⚠️ ✅
100-operation limit ✅ ✅ ✅ ✅ ✅
2 MB size limit ✅ ✅ ✅ ✅ ✅
Triggers in batch operations ❌ ✅ ✅ ❌ ✅ InMemory: triggers not fired for batch ops

Concurrency & System Properties

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
ETag concurrency (IfMatch) ✅ ✅ ✅ ✅ ✅
ETag concurrency (IfNoneMatch) ✅ ✅ ✅ ✅ ✅
_etag system property ✅ ✅ ✅ ✅ ✅
_ts system property ✅ ✅ ✅ ✅ ✅
_rid system property ❌ ✅ ✅ ✅ ✅ InMemory: not generated
_self system property ❌ ✅ ✅ ✅ ✅ InMemory: not generated
_attachments system property ❌ ✅ ✅ ✅ ✅ InMemory: not generated
Document size limit (2 MB) ✅ ✅ ✅ ✅ ✅

Container & Database Operations

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
CreateDatabaseAsync ✅ ✅ ✅ ✅ ✅
ReadDatabaseAsync ✅ ✅ ✅ ✅ ✅
DeleteDatabaseAsync ✅ ✅ ✅ ✅ ✅
GetDatabaseQueryIterator ✅ ✅ ✅ ✅ ✅
CreateContainerAsync ✅ ✅ ✅ ✅ ✅
ReadContainerAsync ✅ ✅ ✅ ✅ ✅
ReplaceContainerAsync ✅ ✅ ✅ ✅ ✅
DeleteContainerAsync ✅ ✅ ✅ ✅ ✅
GetContainerQueryIterator ✅ ✅ ✅ ✅ ✅
CreateDatabaseStreamAsync ✅ ✅ ✅ ✅ ✅
ReadDatabaseStreamAsync ✅ ✅ ✅ ✅ ✅
DeleteDatabaseStreamAsync ✅ ✅ ✅ ✅ ✅
CreateContainerStreamAsync ✅ ✅ ✅ ✅ ✅
ReadContainerStreamAsync ✅ ✅ ✅ ✅ ✅
ReplaceContainerStreamAsync ✅ ✅ ✅ ✅ ✅
DeleteContainerStreamAsync ✅ ✅ ✅ ✅ ✅

Container Policies

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
Partition key (single) ✅ ✅ ✅ ✅ ✅
Partition key (hierarchical / composite) ✅ ✅ ✅ ⚠️ ✅ vNext: null values rejected (#279)
Unique key policy enforcement ✅ ✅ ✅ ✅ ✅
TTL — container-level default ✅ ✅ ✅ ⚠️ ✅ InMemory: lazy eviction (items remain until next access); vNext: incomplete (#239)
TTL — per-item override ✅ ✅ ✅ ⚠️ ✅ Same lazy eviction caveat
Indexing policy — stored ✅ ✅ ✅ ❌ ✅ InMemory: stored but not enforced; vNext: not implemented (#233)
Indexing policy — enforced at query time ❌ ✅ ✅ ❌ ✅ InMemory: always does full scan regardless of indexing policy
Composite index required for multi-field ORDER BY ❌ ✅ ✅ ❌ ✅ InMemory: multi-field ORDER BY works without composite index
Conflict resolution policy — stored ✅ ✅ ✅ ❌ ✅ InMemory: stored on ContainerProperties but not enforced
Conflict resolution policy — enforced ❌ ✅ ✅ ❌ ✅
Computed properties ✅ ✅ ✅ ❌ ✅
JSON property order preservation ✅ ✅ ✅ ❌ ✅ vNext: not preserved (#268, #276)

Throughput & RU

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
ReadThroughputAsync ✅ ✅ ✅ ✅ ✅ InMemory: returns stored value
ReplaceThroughputAsync ✅ ✅ ✅ ✅ ✅ InMemory: persists value (no actual throttling effect)
Request charge in response headers ⚠️ ✅ ✅ ❌ ✅ InMemory: synthetic 1.0 RU always
Throttling (429) on RU exhaustion ❌ ✅ ✅ ❌ ✅ InMemory: no throttling simulation
Autoscale throughput ❌ ❌ ❌ ❌ ✅ No emulator supports autoscale

SQL Query — Clauses & Syntax

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
SELECT ✅ ✅ ✅ ✅ ✅
SELECT * ✅ ✅ ✅ ✅ ✅
SELECT VALUE ✅ ✅ ✅ ⚠️ ✅ vNext: had issues (#258, #270)
FROM ✅ ✅ ✅ ✅ ✅
WHERE ✅ ✅ ✅ ✅ ✅
ORDER BY (single field) ✅ ✅ ✅ ✅ ✅
ORDER BY (multi-field) ✅ ✅ ✅ ✅ ✅ InMemory: works without composite index
ORDER BY RANK ✅ ✅ ✅ ✅ ✅
ORDER BY RANK RRF(...) ❌ ✅ ✅ ✅ ✅ InMemory: explicit error; Reciprocal Rank Fusion not implemented
GROUP BY ✅ ✅ ✅ ✅ ✅
HAVING ✅ ✅ ✅ ✅ ✅
DISTINCT ✅ ✅ ✅ ✅ ✅
TOP ✅ ✅ ✅ ✅ ✅
OFFSET ... LIMIT ✅ ✅ ✅ ✅ ✅
JOIN (array expansion) ✅ Unlimited ⚠️ Max 5 per query ⚠️ Max 5 per query ✅ ✅
Subqueries (scalar) ✅ ✅ ✅ ✅ ✅
Correlated subqueries ✅ ✅ ✅ ✅ ✅
EXISTS ✅ ✅ ✅ ✅ ✅
ARRAY(subquery) ✅ ✅ ✅ ✅ ✅
IN ✅ ✅ ✅ ✅ ✅
BETWEEN ✅ ✅ ✅ ✅ ✅
LIKE ✅ ✅ ✅ ✅ ✅
Ternary operator (? :) ✅ ✅ ✅ ✅ ✅
Null coalesce (??) ✅ ✅ ✅ ✅ ✅
String concatenation (||) ✅ ✅ ✅ ✅ ✅
Parameterised queries ✅ ✅ ✅ ✅ ✅
SQL comments (--, /* */) ✅ ✅ ✅ ❌ ✅ vNext: can cause errors (#272)
Non-ASCII characters ✅ ✅ ✅ ❌ ✅ vNext: returns 500 (#263)
Quoted identifiers (["name"]) ❌ ✅ ✅ ✅ ✅ InMemory: disabled in parser to allow c["array"][0] syntax
Cross-partition queries ✅ ✅ ✅ ❌ ✅ vNext: not yet implemented
Query pagination (MaxItemCount, continuation) ✅ ✅ ✅ ⚠️ ✅ vNext: continuation token issues (#259)
Large result sets ✅ ✅ ✅ ⚠️ ✅ vNext: HTTP 500 on large results (#269)

SQL Query — Aggregate Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
COUNT ✅ ✅ ✅ ⚠️ ✅ vNext: regressions (#273, #274)
SUM ✅ ✅ ✅ ⚠️ ✅
AVG ✅ ✅ ✅ ⚠️ ✅
MIN ✅ ✅ ✅ ⚠️ ✅
MAX ✅ ✅ ✅ ⚠️ ✅

SQL Query — String Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
CONCAT ✅ ✅ ✅ ✅ ✅
CONTAINS ✅ ✅ ✅ ✅ ✅ Optional case-insensitive 3rd arg
STARTSWITH ✅ ✅ ✅ ✅ ✅ Optional case-insensitive 3rd arg
ENDSWITH ✅ ✅ ✅ ✅ ✅ Optional case-insensitive 3rd arg
INDEX_OF ✅ ✅ ✅ ✅ ✅ Optional start position
LEFT ✅ ✅ ✅ ✅ ✅
RIGHT ✅ ✅ ✅ ✅ ✅
LENGTH ✅ ✅ ✅ ✅ ✅
LOWER / TOLOWER ✅ ✅ ✅ ✅ ✅
UPPER / TOUPPER ✅ ✅ ✅ ✅ ✅
TRIM ✅ ✅ ✅ ✅ ✅
LTRIM ✅ ✅ ✅ ✅ ✅
RTRIM ✅ ✅ ✅ ✅ ✅
REPLACE ✅ ✅ ✅ ✅ ✅
REPLICATE ✅ ✅ ✅ ✅ ✅
REVERSE ✅ ✅ ✅ ✅ ✅
SUBSTRING ✅ ✅ ✅ ✅ ✅
REGEXMATCH ✅ ✅ ✅ ✅ ✅ Supports i, m, s, x modifiers
STRING_EQUALS / STRINGEQUALS ✅ ✅ ✅ ✅ ✅ Optional case-insensitive 3rd arg
TOSTRING / ToString ✅ ✅ ✅ ✅ ✅
STRINGTOARRAY ✅ ✅ ✅ ✅ ✅
STRINGTOBOOLEAN ✅ ✅ ✅ ✅ ✅
STRINGTONULL ✅ ✅ ✅ ✅ ✅
STRINGTONUMBER ✅ ✅ ✅ ✅ ✅
STRINGTOOBJECT ✅ ✅ ✅ ✅ ✅
STRINGJOIN ✅ ✅ ✅ ✅ ✅ Join array with separator
STRINGSPLIT ✅ ✅ ✅ ✅ ✅ Split by delimiter

SQL Query — Mathematical Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
ABS ✅ ✅ ✅ ✅ ✅
CEILING / CEIL ✅ ✅ ✅ ✅ ✅
FLOOR ✅ ✅ ✅ ✅ ✅
ROUND ✅ ✅ ✅ ✅ ✅ Supports optional precision arg
SQRT ✅ ✅ ✅ ✅ ✅
SQUARE ✅ ✅ ✅ ✅ ✅
POWER ✅ ✅ ✅ ✅ ✅
EXP ✅ ✅ ✅ ✅ ✅
LOG ✅ ✅ ✅ ✅ ✅ Supports optional base arg
LOG10 ✅ ✅ ✅ ✅ ✅
SIGN ✅ ✅ ✅ ✅ ✅
TRUNC / TRUNCATE ✅ ✅ ✅ ✅ ✅
PI ✅ ✅ ✅ ✅ ✅
RAND ✅ ✅ ✅ ✅ ✅
SIN ✅ ✅ ✅ ✅ ✅
COS ✅ ✅ ✅ ✅ ✅
TAN ✅ ✅ ✅ ✅ ✅
COT ✅ ✅ ✅ ✅ ✅
ASIN ✅ ✅ ✅ ✅ ✅
ACOS ✅ ✅ ✅ ✅ ✅
ATAN ✅ ✅ ✅ ✅ ✅
ATN2 ✅ ✅ ✅ ✅ ✅
DEGREES ✅ ✅ ✅ ✅ ✅
RADIANS ✅ ✅ ✅ ✅ ✅
NUMBERBIN ✅ ✅ ✅ ✅ ✅

SQL Query — Integer / Bitwise Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
INTADD ✅ ✅ ✅ ✅ ✅
INTSUB ✅ ✅ ✅ ✅ ✅
INTMUL ✅ ✅ ✅ ✅ ✅
INTDIV ✅ ✅ ✅ ✅ ✅
INTMOD ✅ ✅ ✅ ✅ ✅
INTBITAND ✅ ✅ ✅ ✅ ✅
INTBITOR ✅ ✅ ✅ ✅ ✅
INTBITXOR ✅ ✅ ✅ ✅ ✅
INTBITNOT ✅ ✅ ✅ ✅ ✅
INTBITLEFTSHIFT ✅ ✅ ✅ ✅ ✅
INTBITRIGHTSHIFT ✅ ✅ ✅ ✅ ✅

SQL Query — Type-Checking Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
IS_DEFINED ✅ ✅ ✅ ✅ ✅
IS_NULL ✅ ✅ ✅ ✅ ✅
IS_ARRAY ✅ ✅ ✅ ✅ ✅
IS_BOOL ✅ ✅ ✅ ✅ ✅
IS_NUMBER ✅ ✅ ✅ ✅ ✅
IS_STRING ✅ ✅ ✅ ✅ ✅
IS_OBJECT ✅ ✅ ✅ ✅ ✅
IS_PRIMITIVE ✅ ✅ ✅ ✅ ✅
IS_FINITE_NUMBER ✅ ✅ ✅ ✅ ✅
IS_INTEGER ✅ ✅ ✅ ✅ ✅
IS_NAN ✅ ✅ ✅ ✅ ✅
TYPE ✅ ✅ ✅ ✅ ✅ Returns type name as string

SQL Query — Array Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
ARRAY_CONTAINS ✅ ✅ ✅ ✅ ✅ Supports partial match 3rd arg
ARRAY_LENGTH ✅ ✅ ✅ ✅ ✅
ARRAY_SLICE ✅ ✅ ✅ ✅ ✅
ARRAY_CONCAT ✅ ✅ ✅ ✅ ✅
ARRAY_CONTAINS_ANY ✅ ✅ ✅ ✅ ✅
ARRAY_CONTAINS_ALL ✅ ✅ ✅ ✅ ✅
SETINTERSECT ✅ ✅ ✅ ✅ ✅
SETUNION ✅ ✅ ✅ ✅ ✅
SETDIFFERENCE ✅ ✅ ✅ ✅ ✅
CHOOSE ✅ ✅ ✅ ✅ ✅ 1-based index selection
OBJECTTOARRAY ✅ ✅ ✅ ✅ ✅
ARRAYTOOBJECT ✅ ✅ ✅ ✅ ✅

SQL Query — Conversion Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
TOSTRING / ToString ✅ ✅ ✅ ✅ ✅
TONUMBER / ToNumber ✅ ✅ ✅ ✅ ✅
TOBOOLEAN / ToBoolean ✅ ✅ ✅ ✅ ✅

SQL Query — Date/Time Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
GETCURRENTDATETIME ✅ ✅ ✅ ✅ ✅
GETCURRENTDATETIMESTATIC ✅ ✅ ✅ ✅ ✅
GETCURRENTTIMESTAMP ✅ ✅ ✅ ✅ ✅
GETCURRENTTIMESTAMPSTATIC ✅ ✅ ✅ ✅ ✅
GETCURRENTTICKS ✅ ✅ ✅ ✅ ✅
GETCURRENTTICKSSTATIC ✅ ✅ ✅ ✅ ✅
DATETIMEADD ✅ ✅ ✅ ✅ ✅
DATETIMEPART ✅ ✅ ✅ ✅ ✅ Supports year, month, day, hour, minute, second, millisecond, microsecond, nanosecond, weekday
DATETIMEDIFF ✅ ✅ ✅ ✅ ✅
DATETIMEFROMPARTS ✅ ✅ ✅ ✅ ✅
DATETIMEBIN ✅ ✅ ✅ ✅ ✅
DATETIMETOTICKS ✅ ✅ ✅ ✅ ✅
TICKSTODATETIME ✅ ✅ ✅ ✅ ✅
DATETIMETOTIMESTAMP ✅ ✅ ✅ ✅ ✅
TIMESTAMPTODATETIME ✅ ✅ ✅ ✅ ✅

SQL Query — Spatial Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
ST_DISTANCE ✅ ✅ ✅ ✅ ✅
ST_WITHIN ✅ ✅ ✅ ✅ ✅
ST_INTERSECTS ✅ ✅ ✅ ✅ ✅
ST_ISVALID ✅ ✅ ✅ ✅ ✅
ST_ISVALIDDETAILED ✅ ✅ ✅ ✅ ✅
ST_AREA ✅ ✅ ✅ ✅ ✅

SQL Query — Conditional Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
IIF ✅ ✅ ✅ ✅ ✅
COALESCE ✅ ✅ ✅ ✅ ✅

SQL Query — Full-Text Search Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
FULLTEXTCONTAINS ⚠️ ✅ ✅ ✅ ✅ InMemory: case-insensitive substring match (~90% accurate), not NLP tokenization/BM25
FULLTEXTCONTAINSALL ⚠️ ✅ ✅ ✅ ✅ Same approximate implementation
FULLTEXTCONTAINSANY ⚠️ ✅ ✅ ✅ ✅ Same approximate implementation
FULLTEXTSCORE ⚠️ ✅ ✅ ✅ ✅ InMemory: naive term-frequency scoring, not BM25
Full-text index enforcement ❌ ✅ ✅ ✅ ✅ InMemory: no full-text index required; always scans

SQL Query — Vector Search Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
VECTORDISTANCE (cosine) ✅ ✅ ✅ ✅ ✅ InMemory: brute-force computation
VECTORDISTANCE (dotproduct) ✅ ✅ ✅ ✅ ✅
VECTORDISTANCE (euclidean) ✅ ✅ ✅ ✅ ✅
ANN (approximate nearest neighbour) indexing ❌ ✅ ✅ ✅ ✅ InMemory: always brute-force; no DiskANN/quantizedFlat index

SQL Query — Other Functions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
DOCUMENTID ✅ ✅ ✅ ✅ ✅ InMemory: returns _rid or id
User-Defined Functions (udf.*) ✅ ✅ ✅ ❌ ✅ vNext: not planned

Change Feed

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
Incremental / Latest Version mode ✅ ✅ ✅ ✅ ✅
AllVersionsAndDeletes mode ✅ ✅ ✅ ✅ ✅ InMemory: via internal checkpoint mechanism
Change Feed Processor (polling) ✅ ✅ ✅ ✅ ✅
Manual checkpoint processor ✅ ✅ ✅ ✅ ✅
Stream iterator ✅ ✅ ✅ ✅ ✅
Delete tombstones ✅ ✅ ✅ ✅ ✅
FeedRange-scoped change feed ✅ ✅ ✅ ✅ ✅ InMemory: MurmurHash3-based scoping
Start from beginning ✅ ✅ ✅ ✅ ✅
Start from now ✅ ✅ ✅ ✅ ✅
Start from continuation ✅ ✅ ✅ ✅ ✅
Start from point in time ✅ ✅ ✅ ✅ ✅
Persistence across export/import ❌ N/A N/A N/A ✅ InMemory: change feed log not included in state export
MaxChangeFeedSize cap ⚠️ N/A N/A N/A ✅ InMemory: default 1000 entries; oldest evicted when exceeded

Stored Procedures, Triggers & UDFs

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
Stored procedures (C# handlers) ✅ N/A N/A N/A N/A InMemory-only: register C# lambdas directly
Stored procedures (JavaScript via Jint) ✅ ✅ ✅ ❌ ✅ Requires CosmosDB.InMemoryEmulator.JsTriggers package; vNext: not planned
Pre-triggers (C# handlers) ✅ N/A N/A N/A N/A InMemory-only
Pre-triggers (JavaScript via Jint) ✅ ✅ ✅ ❌ ✅ Requires JsTriggers package; vNext: not planned
Post-triggers (C# handlers) ✅ N/A N/A N/A N/A InMemory-only
Post-triggers (JavaScript via Jint) ✅ ✅ ✅ ❌ ✅ Requires JsTriggers package; vNext: not planned
UDFs in queries (C# handlers) ✅ N/A N/A N/A N/A InMemory-only
UDFs in queries (JavaScript via Jint) ✅ ✅ ✅ ❌ ✅ Requires JsTriggers package; vNext: not planned
Pre-triggers in batch operations ❌ ✅ ✅ ❌ ✅ InMemory: triggers not fired during batch
Post-triggers in batch operations ❌ ✅ ✅ ❌ ✅ InMemory: triggers not fired during batch
Pre-triggers for PatchItemStreamAsync ❌ ✅ ✅ ❌ ✅ InMemory: pre-triggers skipped; post fires as Replace

FeedRange & Partitioning

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
Single partition key ✅ ✅ ✅ ✅ ✅
Hierarchical / composite partition keys ✅ ✅ ✅ ⚠️ ✅ vNext: null values rejected (#279)
GetFeedRangesAsync ✅ ✅ ✅ ✅ ✅ InMemory: defaults to 1; configurable via FeedRangeCount
FeedRange-scoped queries ✅ ✅ ✅ ✅ ✅ InMemory: MurmurHash3-based partitioning
Partition key extraction from document ✅ ✅ ✅ ✅ ✅
Cross-partition queries ✅ ✅ ✅ ❌ ✅
Physical partition splits/merges ❌ ✅ ✅ ❌ ✅ InMemory: static equal-width hash intervals

Users & Permissions

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
CreateUser ✅ ✅ ✅ ❌ ✅ vNext: returns 400 (#275)
ReadUser ✅ ✅ ✅ ❌ ✅
DeleteUser ✅ ✅ ✅ ❌ ✅
ReplaceUser ✅ ✅ ✅ ❌ ✅
CreatePermission ✅ ✅ ✅ ❌ ✅ InMemory: stub tokens, not HMAC-signed
ReadPermission ✅ ✅ ✅ ❌ ✅
DeletePermission ✅ ✅ ✅ ❌ ✅
ReplacePermission ✅ ✅ ✅ ❌ ✅
Permission token authorization ❌ ✅ ✅ ❌ ✅ InMemory: tokens generated but not enforced

LINQ Support

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
GetItemLinqQueryable<T>() ✅ ✅ ✅ ✅ ✅
.ToFeedIterator() ✅ ✅ ✅ ✅ ✅ Via FakeCosmosHandler
LINQ → SQL translation ✅ ✅ ✅ ✅ ✅ Handled by SDK; InMemory executes the generated SQL

Response Metadata & Diagnostics

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
ETag in response ✅ ✅ ✅ ✅ ✅
Session token in response ⚠️ ✅ ✅ ✅ ✅ InMemory: synthetic session tokens
Request charge in response ⚠️ ✅ ✅ ❌ ✅ InMemory: always 1.0 RU
Activity ID in response ✅ ✅ ✅ ✅ ✅
Diagnostics ⚠️ ✅ ✅ ❌ ✅ InMemory: synthetic diagnostics
DatabaseResponse metadata (RequestCharge, ActivityId, Diagnostics, Headers) ❌ ✅ ✅ ✅ ✅ InMemory: NSubstitute mocks; only StatusCode + Resource populated
ContainerResponse metadata ❌ ✅ ✅ ✅ ✅ Same limitation as DatabaseResponse
Sub-status codes (fine-grained errors) ⚠️ ✅ ✅ ✅ ✅ InMemory: limited sub-status classification; most return 0

Advanced Features

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB Notes
Bulk operations (AllowBulkExecution) ✅ ✅ ✅ ❌ ✅ vNext: .NET SDK limitation
Multi-container routing (via Builder) ✅ ✅ ✅ ✅ ✅
Fault injection (custom HTTP responses) ✅ ❌ ❌ ❌ ❌ InMemory exclusive
State export (JSON) ✅ ❌ ❌ ❌ ❌ InMemory exclusive
State import (JSON) ✅ ❌ ❌ ❌ ❌ InMemory exclusive
State persistence directory (auto-persist) ✅ ❌ ❌ ❌ ❌ InMemory exclusive
Point-in-time restore (change feed replay) ✅ ❌ ❌ ❌ ✅ InMemory: via change feed replay; Real: continuous backup
DI integration (UseInMemoryCosmosDB) ✅ ❌ ❌ ❌ ❌ InMemory exclusive
DI typed client proxy (UseInMemoryCosmosDB<TClient>) ✅ ❌ ❌ ❌ ❌ InMemory exclusive; Castle.Core dynamic proxy
Custom handler wrapping (DelegatingHandler) ✅ ❌ ❌ ❌ ❌ InMemory exclusive
OnContainerCreated / OnHandlerCreated callbacks ✅ ❌ ❌ ❌ ❌ InMemory exclusive
Data explorer UI ❌ ✅ ✅ ✅ ✅
Consistency levels (Session, Eventual, Bounded Staleness, Consistent Prefix) ❌ ⚠️ ⚠️ ⚠️ ✅ InMemory: always Strong; Official: Session & Strong only
Client-side encryption (Always Encrypted) ❌ ✅ ✅ ❌ ✅ Requires Azure Key Vault
Analytical store (Synapse Link) ❌ ❌ ❌ ❌ ✅ No emulator supports this
Multi-region / geo-replication ❌ ❌ ❌ ❌ ✅ No emulator supports this
Resource tokens / RBAC enforcement ❌ ✅ ✅ ❌ ✅
OpenTelemetry integration ❌ ❌ ❌ ✅ ✅
Data persistence across restarts ✅ ✅ ⚠️ ⚠️ ✅ InMemory: via StatePersistenceDirectory; Docker: volume mount required
Multiple database APIs (MongoDB, Cassandra, Gremlin, Table) ❌ ✅ ✅ ❌ ✅ InMemory & vNext: NoSQL only

vs Community Alternatives

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy
Language C# (NuGet) Go (binary / Docker) C# (NuGet) C# (NuGet)
In-process (no external deps) ✅ ❌ Separate process ✅ ✅

CRUD Operations

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
CreateItem ✅ ✅ ✅ ⚠️
ReadItem ✅ ✅ ✅ ⚠️
UpsertItem ✅ ✅ ✅ ⚠️
ReplaceItem ✅ ✅ ✅ ⚠️
DeleteItem ✅ ✅ ✅ ⚠️
PatchItem ✅ ❌ ❌ ❌
Stream API (all variants) ✅ ❌ ❌ ❌
ReadMany ✅ ❌ ❌ ❌
Bulk operations ✅ ❌ ❌ ❌
Document size limit (2 MB) ✅ ❌ ❌ ❌
ETag concurrency ✅ ❌ ❌ ❌
TTL / expiration ✅ ❌ ❌ ❌
Unique key policy ✅ ❌ ❌ ❌
Delete all by partition key ✅ ❌ ❌ ❌

Queries — Clauses

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
SELECT / FROM / WHERE ✅ ✅ ✅ ⚠️
ORDER BY ✅ ✅ ❌ ❌
GROUP BY / HAVING ✅ ✅ ❌ ❌
DISTINCT ✅ ✅ ❌ ❌
TOP ✅ ✅ ❌ ❌
OFFSET ... LIMIT ✅ ✅ ❌ ❌
JOIN (array expansion) ✅ Unlimited ✅ ❌ ❌
Subqueries / EXISTS ✅ ✅ ❌ ❌
IN ✅ ✅ ❌ ❌
BETWEEN ✅ ❌ ❌ ❌
LIKE ✅ ❌ ❌ ❌
SELECT VALUE ✅ ✅ ❌ ❌
ARRAY(subquery) ✅ ❌ ❌ ❌
Parameterised queries ✅ ✅ ❌ ✅
Cross-partition queries ✅ ✅ ❌ ❌
Query pagination (continuation) ✅ ✅ ✅ ❌

Queries — Aggregate Functions

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
COUNT ✅ ✅ ❌ ❌
SUM ✅ ✅ ❌ ❌
AVG ✅ ✅ ❌ ❌
MIN ✅ ✅ ❌ ❌
MAX ✅ ✅ ❌ ❌

Queries — String Functions

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
CONCAT ✅ ✅ ❌ ❌
CONTAINS ✅ ✅ ⚠️ ❌
STARTSWITH ✅ ✅ ⚠️ ❌
ENDSWITH ✅ ✅ ❌ ❌
INDEX_OF ✅ ✅ ❌ ❌
LEFT / RIGHT ✅ ✅ ❌ ❌
LENGTH ✅ ✅ ❌ ❌
LOWER / UPPER ✅ ✅ ❌ ❌
TRIM / LTRIM / RTRIM ✅ ✅ ❌ ❌
REPLACE ✅ ✅ ❌ ❌
REPLICATE ✅ ✅ ❌ ❌
REVERSE ✅ ✅ ❌ ❌
SUBSTRING ✅ ✅ ❌ ❌
REGEXMATCH ✅ ❌ ❌ ❌
STRING_EQUALS ✅ ❌ ❌ ❌
STRINGTOARRAY ✅ ❌ ❌ ❌
STRINGTOBOOLEAN ✅ ❌ ❌ ❌
STRINGTONULL ✅ ❌ ❌ ❌
STRINGTONUMBER ✅ ❌ ❌ ❌
STRINGTOOBJECT ✅ ❌ ❌ ❌
STRINGJOIN ✅ ❌ ❌ ❌
STRINGSPLIT ✅ ❌ ❌ ❌

Queries — Math Functions

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
ABS / CEILING / FLOOR / ROUND ✅ ✅ ❌ ❌
SQRT / SQUARE / POWER / EXP ✅ ✅ ❌ ❌
LOG / LOG10 / SIGN ✅ ✅ ❌ ❌
TRUNC / PI / RAND ✅ ✅ ❌ ❌
SIN / COS / TAN / COT ✅ ✅ ❌ ❌
ASIN / ACOS / ATAN / ATN2 ✅ ✅ ❌ ❌
DEGREES / RADIANS ✅ ✅ ❌ ❌
NUMBERBIN ✅ ❌ ❌ ❌
INTADD / INTSUB / INTMUL / INTDIV / INTMOD ✅ ❌ ❌ ❌
INTBITAND / INTBITOR / INTBITXOR / INTBITNOT ✅ ❌ ❌ ❌
INTBITLEFTSHIFT / INTBITRIGHTSHIFT ✅ ❌ ❌ ❌

Queries — Type-Checking Functions

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
IS_DEFINED / IS_NULL ✅ ✅ ❌ ❌
IS_ARRAY / IS_BOOL / IS_NUMBER / IS_STRING / IS_OBJECT ✅ ✅ ❌ ❌
IS_PRIMITIVE ✅ ✅ ❌ ❌
IS_FINITE_NUMBER / IS_INTEGER / IS_NAN ✅ ❌ ❌ ❌
TYPE ✅ ❌ ❌ ❌

Queries — Array Functions

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
ARRAY_CONTAINS ✅ ✅ ❌ ❌
ARRAY_LENGTH ✅ ✅ ❌ ❌
ARRAY_SLICE ✅ ✅ ❌ ❌
ARRAY_CONCAT ✅ ✅ ❌ ❌
ARRAY_CONTAINS_ANY / ARRAY_CONTAINS_ALL ✅ ❌ ❌ ❌
SETINTERSECT / SETUNION / SETDIFFERENCE ✅ ❌ ❌ ❌
CHOOSE ✅ ❌ ❌ ❌
OBJECTTOARRAY / ARRAYTOOBJECT ✅ ❌ ❌ ❌

Queries — Date/Time Functions

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
All 15 date/time functions ✅ ❌ ❌ ❌ Cosmium has no date/time function support

Queries — Spatial Functions

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
All 6 ST_* functions ✅ ❌ ❌ ❌

Queries — Conditional / Other Functions

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
IIF ✅ ✅ ❌ ❌
COALESCE ✅ ❌ ❌ ❌
FULLTEXTCONTAINS / FULLTEXTSCORE ⚠️ ❌ ❌ ❌
VECTORDISTANCE ✅ ❌ ❌ ❌

Advanced Features

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy Notes
Transactional batches (atomic, rollback) ✅ ⚠️ Non-atomic "bulk" ❌ ❌
Change feed ✅ 3+ modes + processor ❌ ❌ ❌
ETag concurrency ✅ ❌ ❌ ❌
TTL / expiration ✅ ❌ ❌ ❌
Stored procedures ✅ C# + optional JS ❌ ❌ ❌
UDFs in queries ✅ C# + optional JS ❌ ❌ ❌
Triggers (pre/post) ✅ C# + optional JS ❌ ❌ ❌
Full-text search ⚠️ Approximate ❌ ❌ ❌
Vector search ✅ ❌ ❌ ❌
FeedRange support ✅ ❌ ❌ ❌
LINQ integration ✅ ❌ ❌ ❌
Hierarchical partition keys ✅ ❌ ❌ ❌
Unique key policy ✅ ❌ ❌ ❌
Fault injection ✅ ❌ ❌ ❌
State export/import ✅ ✅ JSON persist ❌ ❌
Point-in-time restore ✅ ❌ ❌ ❌
Multi-container routing ✅ ✅ Multi-database ❌ ❌
DI integration ✅ ❌ ❌ ❌
Custom handler wrapping ✅ ❌ ❌ ❌
Users & permissions ✅ Stub ❌ ❌ ❌
Response metadata (RU, ETag, Activity ID) ✅ ✅ ❌ ❌

Project Health

CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy
Actively maintained ✅ ✅ ✅ ❌ (3 years stale)
License MIT MIT MIT GPL-3.0

Summary Scorecard

Counts based on the detailed tables above. "Applicable" excludes cloud-only infrastructure features (geo-replication, analytical store, autoscale, etc.) that no emulator supports.

Area CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext
CRUD operations (15) ✅ 15/15 ✅ 15/15 ✅ 15/15 ⚠️ 13/15
Patch operations (8) ✅ 8/8 ✅ 8/8 ✅ 8/8 ⚠️ ~5/8
Transactional batch ops (10) ⚠️ 9/10 ✅ 10/10 ✅ 10/10 ⚠️ ~7/10
SQL clauses & syntax (~30) ⚠️ ~28/30 ✅ ~29/30 ✅ ~29/30 ⚠️ ~22/30
SQL aggregate functions (5) ✅ 5/5 ✅ 5/5 ✅ 5/5 ⚠️ ~4/5
SQL string functions (27) ✅ 27/27 ✅ 27/27 ✅ 27/27 ✅ 27/27
SQL math functions (25) ✅ 25/25 ✅ 25/25 ✅ 25/25 ✅ 25/25
SQL integer/bitwise functions (11) ✅ 11/11 ✅ 11/11 ✅ 11/11 ✅ 11/11
SQL type-checking functions (12) ✅ 12/12 ✅ 12/12 ✅ 12/12 ✅ 12/12
SQL array functions (12) ✅ 12/12 ✅ 12/12 ✅ 12/12 ✅ 12/12
SQL date/time functions (15) ✅ 15/15 ✅ 15/15 ✅ 15/15 ✅ 15/15
SQL spatial functions (6) ✅ 6/6 ✅ 6/6 ✅ 6/6 ✅ 6/6
SQL conditional functions (2) ✅ 2/2 ✅ 2/2 ✅ 2/2 ✅ 2/2
Full-text search (5) ⚠️ 4/5 approx ✅ 5/5 ✅ 5/5 ✅ 5/5
Vector search (2) ⚠️ 1/2 ✅ 2/2 ✅ 2/2 ✅ 2/2
Change feed (12) ⚠️ 10/12 ✅ 11/12 ✅ 11/12 ✅ 11/12
Stored procedures / triggers / UDFs (11) ⚠️ 8/11 ✅ 11/11 ✅ 11/11 ❌ 0/11
Container policies (11) ⚠️ 8/11 ✅ 11/11 ✅ 11/11 ⚠️ 4/11
Users & permissions (9) ⚠️ 8/9 ✅ 9/9 ✅ 9/9 ❌ 0/9
InMemory-exclusive features (10) ✅ 10/10 ❌ 0/10 ❌ 0/10 ❌ 0/10

InMemory Emulator Strengths

  • ✅ 130+ SQL functions — every function in the Cosmos DB SQL language
  • ✅ Instant startup — no Docker, no installer, no network
  • ✅ Perfect test isolation — new instance per test, no shared state
  • ✅ Fault injection — simulate 429s, 503s, timeouts, custom HTTP errors
  • ✅ State export/import & PITR — snapshot and restore for test setup
  • ✅ DI integration — one-line setup, typed client proxy
  • ✅ No platform restrictions — any OS that runs .NET

InMemory Emulator Limitations (things the Official Emulators do that InMemory doesn't)

  • ❌ Quoted identifiers (["My Column"]) — disabled to allow array syntax
  • ❌ ORDER BY RANK RRF — Reciprocal Rank Fusion not implemented
  • ❌ ANN vector indexing — always brute-force, no DiskANN/quantizedFlat
  • ❌ Full-text search fidelity — approximate matching, no NLP tokenization/BM25
  • ❌ Indexing policy enforcement — stored but never enforced
  • ❌ Consistency levels — always Strong; no Session/Eventual/Bounded Staleness simulation
  • ❌ Client encryption — requires Azure Key Vault
  • ❌ Resource token authorization — tokens generated but not enforced
  • ❌ Data Explorer UI — no visual interface
  • ❌ Triggers in batch — pre/post triggers not fired during transactional batch
  • ❌ System properties _rid, _self, _attachments — not generated
  • ❌ DatabaseResponse / ContainerResponse full metadata — only StatusCode + Resource
  • ❌ Multi-API — NoSQL only (no MongoDB, Cassandra, Gremlin, Table)
  • ❌ Physical partition splits/merges — static hash intervals
  • ❌ Throttling simulation — no 429 on RU exhaustion

When to Use Each

InMemory Emulator

  • Unit tests and integration tests in CI
  • Local development without Docker
  • Testing retry logic via fault injection
  • Fast feedback loops (instant startup)
  • Deterministic, reproducible test runs
  • No external dependencies
  • When you need full SQL query testing (130+ functions)

Windows Emulator

  • Full-fidelity testing on Windows
  • Testing client encryption or resource tokens
  • Need for Data Explorer UI
  • Multi-API testing (MongoDB, Cassandra, etc.)

Linux Docker (:latest)

  • ⚠️ Not recommended — critically broken for many users
  • Legacy CI pipelines that haven't migrated

Linux vNext (:vnext-preview)

  • Cross-platform Docker-based testing
  • ARM64 environments (Apple Silicon)
  • When you need real HTTP-level fidelity
  • Testing OpenTelemetry integration

Real Azure Cosmos DB

  • Final acceptance testing
  • Performance benchmarking with real RU costs
  • Verifying consistency level behaviour
  • Multi-region / geo-replication testing
  • Analytical store and Synapse Link
  • Autoscale throughput testing

See Also

vs Official Cosmos DB Emulators

Microsoft provides three official emulators, each with a significantly different architecture:

Windows Emulator (GA) Linux Docker (:latest) Linux vNext (:vnext-preview)
Architecture Standalone Windows desktop application (MSI installer). Runs as a Windows service. Docker image — the Windows emulator ported to a Linux container via SQLPAL compatibility layer. Essentially Windows binaries running on Linux. Docker image — a ground-up rewrite. Lightweight gate-level simulation backed by PostgreSQL internally.
Image / install size ~2 GB install + 10 GB disk ~2 GB Docker image ~200 MB Docker image
Typical startup time 10–30 s 30–60 s (can take minutes in CI) 3–5 s
Connection mode Gateway + Direct Gateway + Direct Gateway only
Supported APIs NoSQL, MongoDB, Cassandra, Gremlin, Table NoSQL, MongoDB, Cassandra, Gremlin, Table NoSQL only
Platform Windows only (64-bit Server 2016+, Win 10/11) Linux / macOS / Windows (Docker) — but no Apple Silicon or ARM Linux / macOS / Windows (Docker) — ARM64 supported
Status GA (but lagging behind the cloud service) Effectively abandoned — still GA in name, but critically broken for many users Preview — active development, frequent releases

Setup & Operations

Feature CosmosDB.InMemoryEmulator Windows Emulator (GA) Linux Docker (:latest) Linux vNext (preview) Real Azure Cosmos DB
Pricing ✅ Free ✅ Free ✅ Free ✅ Free ❌ Pay-per-RU + storage
In-process (no external deps) ✅ ❌ Installer ❌ Docker ❌ Docker ❌ Requires network
Fast startup ✅ Instant ❌ 10–30 s ❌ 30–60 s ⚠️ 3–5 s ❌ Provisioning minutes
Works offline ✅ ✅ ✅ ✅ ❌ Requires internet
CI-friendly ✅ ⚠️ Flaky (Windows runners) ❌ Frequently broken in CI (#86) ⚠️ Docker setup required; regressions between releases ⚠️ Needs secrets, network, costs
Multiple instances / parallel ✅ One per test ❌ Single instance only ⚠️ Multiple containers possible ⚠️ Multiple containers possible ⚠️ Shared state; needs cleanup
Test isolation ✅ New instance per test ⚠️ Shared state ⚠️ Shared state ⚠️ Shared state ❌ Shared; risk of data leakage
Stable under load ✅ No sockets/network ⚠️ Socket exhaustion, 407s, hangs ❌ Crashes, 429s, 503s under non-trivial load ⚠️ CPU spikes after prolonged use (#267) ✅ (at cost)
No crashes / corruption ✅ Pure in-memory ⚠️ Can spike CPU, enter corrupted state ❌ PAL PANIC core dumps, fatal errors, evaluation expiry crashes ⚠️ Regressions break features between releases (patch, batch, aggregates) ✅
Platform support ✅ Any (.NET) ❌ Windows only ⚠️ Linux / macOS / Windows; no ARM ✅ Linux / macOS / Windows; ARM64 supported ✅ Any platform
No special reset needed ✅ Dispose and recreate ⚠️ May need "Reset Data" or /DisableRIO ⚠️ Sometimes needs container replacement ✅ Recreate container ⚠️ Manual cleanup
Custom auth keys ✅ Any / none ⚠️ Well-known key; restart to change ⚠️ Well-known key ⚠️ Well-known key (configurable via --key-file) ✅
Serverless throughput mode ✅ (no RU enforcement) ❌ Provisioned only ❌ Provisioned only ❌ Provisioned only ✅
Unlimited containers ✅ ⚠️ Degrades past 10 fixed / 5 unlimited ⚠️ Same limits as Windows ✅ ✅
Connection mode ✅ Gateway (via FakeCosmosHandler) ✅ Gateway + Direct ✅ Gateway + Direct ⚠️ Gateway only ✅ Gateway + Direct
Evaluation period / expiry ✅ None ✅ None ❌ Periodic expiry; must pull latest image ✅ None ✅ None
SSL certificate setup ✅ None needed ⚠️ Self-signed; auto-installed ⚠️ Manual cert export + install ⚠️ Manual cert or use --protocol http ✅ Managed
Community sentiment ✅ ⚠️ Grudging acceptance on Windows ❌ Widely despised — "broken", "souring our perception of Cosmos" (dozens of complaints) ⚠️ Promising but immature — "frequent regressions" in preview ✅ Trusted (at cost)

CRUD & Data Operations

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB
CreateItem / ReadItem / UpsertItem / ReplaceItem / DeleteItem ✅ ✅ ✅ ✅ ✅
Stream API (all CRUD variants) ✅ ✅ ✅ ✅ ✅
ReadMany ✅ ✅ ✅ ✅ ✅
Patch operations (Set/Add/Replace/Remove/Increment) ✅ ✅ ✅ ⚠️ Has had regressions (#246) ✅
Conditional patching (filter predicate) ✅ ✅ ✅ ⚠️ Precondition handling had bugs (#242) ✅
Transactional batches (atomic, rollback) ✅ ✅ ✅ ⚠️ Batch had 403 / missing-id regressions (#243, #247) ✅
Bulk operations ✅ ✅ ✅ ❌ (.NET SDK limitation) ✅
ETag concurrency (IfMatch / IfNoneMatch) ✅ ✅ ✅ ✅ ✅
TTL / expiration (container + per-item) ✅ (lazy eviction) ✅ ✅ ⚠️ TTL removal was incomplete (#239) ✅
Document size limit (2 MB) ✅ Enforced ✅ ✅ ✅ ✅
System properties (_ts, _etag) ✅ ✅ Full ✅ Full ✅ Full ✅ Full (_rid, _self, _attachments too)
Delete all items by partition key ✅ ✅ ✅ ✅ ✅
Unique key policy enforcement ✅ ✅ ✅ ✅ ✅
JSON property order preservation ✅ ✅ ✅ ❌ Not preserved (#268, #276) ✅

Query Language

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB
SQL query parser ✅ 125+ functions ✅ Full ✅ Full ⚠️ Most functions; some gaps (#236) ✅ Full
SELECT / FROM / WHERE ✅ ✅ ✅ ✅ ✅
ORDER BY (single & multi-field) ✅ ✅ ✅ ✅ ✅
GROUP BY / HAVING ✅ ✅ ✅ ✅ ✅
DISTINCT ✅ ✅ ✅ ✅ ✅
TOP ✅ ✅ ✅ ✅ ✅
OFFSET ... LIMIT ✅ ✅ ✅ ✅ ✅
JOIN (array expansion) ✅ Unlimited ⚠️ Max 5 per query ⚠️ Max 5 per query ✅ ✅
Subqueries / EXISTS ✅ ✅ ✅ ✅ ✅
IN ✅ ✅ ✅ ✅ ✅
BETWEEN ✅ ✅ ✅ ✅ ✅
LIKE ✅ ✅ ✅ ✅ ✅
Parameterised queries ✅ ✅ ✅ ✅ ✅
VALUE keyword (scalar projection) ✅ ✅ ✅ ⚠️ SELECT VALUE had issues (#258, #270) ✅
Aggregate functions (COUNT, SUM, AVG, MIN, MAX) ✅ ✅ ✅ ⚠️ Had regressions (#273, #274) ✅
String functions (26 incl. REGEXMATCH, StringTo*) ✅ ✅ ✅ ✅ ✅
Math functions (30 incl. Int*, NumberBin, trig) ✅ ✅ ✅ ✅ ✅
Type-checking functions (10 incl. IS_INTEGER) ✅ ✅ ✅ ✅ ✅
Array functions (10 incl. SetIntersect, SetUnion) ✅ ✅ ✅ ✅ ✅
Date/time functions (15 incl. DateTimeBin) ✅ ✅ ✅ ✅ ✅
Spatial functions (ST_DISTANCE, ST_WITHIN, etc.) ✅ 6 functions ✅ ✅ ✅ ✅
Conditional functions (IIF, COALESCE) ✅ ✅ ✅ ✅ ✅
Non-ASCII characters in queries ✅ ✅ ✅ ❌ Returns 500 (#263) ✅
SQL comments (--, /* */) ✅ ✅ ✅ ❌ Can cause errors (#272) ✅
Cross-partition queries ✅ ✅ ✅ ❌ Not yet implemented ✅
Computed properties ✅ ✅ ✅ ❌ ✅
Custom index policy ⚠️ Stored, not enforced ✅ ✅ ❌ Not yet implemented (#233) ✅
Query pagination (MaxItemCount, continuation) ✅ ✅ ✅ ⚠️ Continuation token issues reported (#259) ✅
Large result sets ✅ ✅ ✅ ⚠️ HTTP 500 on large results (#269) ✅

Advanced Features

Feature CosmosDB.InMemoryEmulator Windows Emulator Linux Docker Linux vNext Real Azure Cosmos DB
Change feed (Incremental / Latest Version) ✅ ✅ ✅ ✅ ✅
Change feed (AllVersionsAndDeletes via checkpoint) ✅ ✅ ✅ ✅ ✅
Change feed processor (polling) ✅ ✅ ✅ ✅ ✅
Change feed manual checkpoint processor ✅ ✅ ✅ ✅ ✅
Change feed stream iterator ✅ ✅ ✅ ✅ ✅
Delete tombstones in change feed ✅ ✅ ✅ ✅ ✅
Stored procedures ✅ (C# handlers + optional JS via Jint) ✅ (JavaScript) ✅ (JavaScript) ❌ Not planned ✅ (JavaScript)
User-defined functions (UDFs) ✅ (C# handlers + optional JS via Jint) ✅ (JavaScript) ✅ (JavaScript) ❌ Not planned ✅ (JavaScript)
Triggers (pre/post) ✅ (C# + optional JS via Jint) ✅ (JavaScript) ✅ (JavaScript) ❌ Not planned ✅ (JavaScript)
Full-text search (FULLTEXTCONTAINS, FULLTEXTSCORE) ✅ (approximate, no BM25) ✅ ✅ ✅ ✅ (BM25)
Vector search (VECTORDISTANCE) ✅ Brute-force (cosine, dot, euclidean) ✅ ✅ ✅ ✅ (ANN indexing)
FeedRange scoping (queries) ✅ (MurmurHash3) ✅ ✅ ✅ ✅ (automatic)
FeedRange scoping (change feed) ✅ (MurmurHash3) ✅ ✅ ✅ ✅
LINQ integration ✅ ✅ ✅ ✅ ✅
.ToFeedIterator() (via FakeCosmosHandler) ✅ ✅ ✅ ✅ ✅
Composite / hierarchical partition keys ✅ ✅ ✅ ⚠️ Null values rejected (#279) ✅
Multi-container routing (InMemoryCosmos.Builder) ✅ ✅ ✅ ✅ ✅
Fault injection (custom HTTP responses) ✅ ❌ ❌ ❌ ❌
State export/import (JSON) ✅ ❌ ❌ ❌ ❌
Point-in-time restore ✅ (change feed replay) ❌ ❌ ❌ ✅ (continuous backup)
Users & permissions (CRUD) ✅ (stub, no auth enforced) ✅ ✅ ❌ Returns 400 (#275) ✅
DI integration (UseInMemoryCosmosDB) ✅ ❌ ❌ ❌ ❌
Custom handler wrapping (DelegatingHandler pipeline) ✅ ❌ ❌ ❌ ❌
Request charge / diagnostics ⚠️ Synthetic (1.0 RU) ✅ ✅ ❌ Not yet implemented ✅
All consistency levels ⚠️ Simulated (implicit strong) ⚠️ Session & Strong only ⚠️ Session & Strong only ⚠️ Limited ✅
IndexingPolicy enforcement ⚠️ Stored, not enforced ✅ ✅ ❌ Not yet implemented ✅
Conflict resolution policy ⚠️ Stored, not enforced ✅ ✅ ❌ ✅
Client encryption (Always Encrypted) ❌ ✅ ✅ ❌ ✅
Analytical store (Synapse Link) ❌ ❌ ❌ ❌ ✅
Multi-region / geo-replication ❌ ❌ ❌ ❌ ✅
Resource tokens / RBAC enforcement ❌ ✅ ✅ ❌ ✅
OpenTelemetry integration ❌ ❌ ❌ ✅ ✅
Data explorer UI ❌ ✅ ✅ ✅ (port 1234) ✅ (Azure Portal)
Data persistence across restarts ✅ Via StatePersistenceDirectory ✅ ⚠️ Volume mount required ⚠️ Via --data-path mount ✅
Multiple database APIs (Mongo, Cassandra, Gremlin, Table) ❌ NoSQL only ✅ All five ✅ All five ❌ NoSQL only ✅ All five

vs Community Alternatives

Feature CosmosDB.InMemoryEmulator Cosmium FakeCosmosDb FakeCosmosEasy
Language C# (NuGet) Go (binary / Docker) C# (NuGet) C# (NuGet)
In-process (no external deps) ✅ ❌ Separate process ✅ ✅
CRUD Operations
Create / Read / Upsert / Replace / Delete ✅ ✅ ✅ ⚠️ Basic
Stream API variants ✅ ❌ ❌ ❌
ReadMany ✅ ❌ ❌ ❌
Patch operations ✅ ❌ ❌ ❌
Document size limits (2 MB) ✅ ❌ ❌ ❌
Queries
SQL query parser ✅ 125+ functions ⚠️ ~60 functions ⚠️ Basic ⚠️ Basic
GROUP BY / HAVING ✅ ✅ ❌ ❌
DISTINCT / TOP / OFFSET LIMIT ✅ ✅ ❌ ❌
Subqueries / EXISTS ✅ ✅ ❌ ❌
JOIN (array expansion) ✅ Unlimited ✅ ❌ ❌
BETWEEN / LIKE / IN ✅ ⚠️ IN only (no BETWEEN/LIKE) ❌ ❌
Parameterised queries ✅ ✅ ❌ ✅
Aggregate functions (COUNT, SUM, AVG, MIN, MAX) ✅ ✅ ❌ ❌
String functions (26) ✅ ⚠️ 19 (no REGEXMATCH, StringTo*) ⚠️ Basic (CONTAINS, STARTSWITH) ❌
Math functions (30 incl. Int*, trig) ✅ ✅ ~30 ❌ ❌
Type-checking functions (10) ✅ ✅ ❌ ❌
Array functions (10 incl. Set*) ✅ ⚠️ 6 (no ObjectToArray, Choose) ❌ ❌
Date/time functions (15) ✅ ❌ ❌ ❌
Spatial functions (6 ST_*) ✅ ❌ ❌ ❌
Conditional functions (IIF, COALESCE) ✅ ✅ IIF only ❌ ❌
Cross-partition queries ✅ ✅ ❌ ❌
Query pagination (continuation tokens) ✅ ✅ ✅ ❌
Advanced Features
Transactional batches ✅ (atomic, rollback) ⚠️ Non-atomic "bulk" ❌ ❌
Change feed ✅ (3 modes + processor) ❌ ❌ ❌
ETag concurrency ✅ ❌ ❌ ❌
TTL / expiration ✅ ❌ ❌ ❌
Stored procedures ✅ (C# handlers + optional JS) ❌ ❌ ❌
UDFs in queries ✅ (C# handlers + optional JS) ❌ ❌ ❌
Triggers (pre/post) ✅ (C# + optional JS) ❌ ❌ ❌
Full-text search ✅ (approximate) ❌ ❌ ❌
Vector search (VECTORDISTANCE) ✅ ❌ ❌ ❌
FeedRange support ✅ ❌ ❌ ❌
LINQ integration ✅ ❌ ❌ ❌
Composite / hierarchical partition keys ✅ ❌ ❌ ❌
Unique key policy enforcement ✅ ❌ ❌ ❌
Fault injection ✅ ❌ ❌ ❌
State export/import ✅ ✅ (JSON persist) ❌ ❌
Point-in-time restore ✅ ❌ ❌ ❌
Multi-container routing ✅ ✅ (multi-database) ❌ ❌
DI integration ✅ ❌ ❌ ❌
Custom handler wrapping (DelegatingHandler) ✅ ❌ ❌ ❌
Users & permissions ✅ (stub) ❌ ❌ ❌
Response metadata (RU, ETag, activity ID) ✅ ✅ ❌ ❌
Project Health
Actively maintained ✅ ✅ ✅ ❌ (3 years stale)
License MIT MIT MIT GPL-3.0

Clone this wiki locally