-
Notifications
You must be signed in to change notification settings - Fork 2
Feature Comparison With Alternatives
Aryeh Citron edited this page Apr 27, 2026
·
11 revisions
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 |
| 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 | ❌ Provisioning minutes | |
| Works offline | ✅ | ✅ | ✅ | ✅ | ❌ Requires internet |
| CI-friendly | ✅ | ❌ Frequently broken in CI (#86) | |||
| Multiple instances / parallel | ✅ One per test | ❌ Single instance only | |||
| Test isolation | ✅ New instance per test | ❌ Shared; risk of data leakage | |||
| Stable under load | ✅ No sockets/network | ❌ Crashes, 429s, 503s under non-trivial load | ✅ (at cost) | ||
| No crashes / corruption | ✅ Pure in-memory | ❌ PAL PANIC core dumps, fatal errors, evaluation expiry crashes | ✅ | ||
| Platform support | ✅ Any (.NET) | ❌ Windows only | ✅ Linux / macOS / Windows; ARM64 supported | ✅ Any platform | |
| No special reset needed | ✅ Dispose and recreate | /DisableRIO
|
✅ Recreate container | ||
| Custom auth keys | ✅ Any / none | --key-file) |
✅ | ||
| Serverless throughput mode | ✅ (no RU enforcement) | ❌ Provisioned only | ❌ Provisioned only | ❌ Provisioned only | ✅ |
| Unlimited containers | ✅ | ✅ | ✅ | ||
| Connection mode | ✅ Gateway (via FakeCosmosHandler) | ✅ Gateway + Direct | ✅ Gateway + Direct | ✅ Gateway + Direct | |
| Evaluation period / expiry | ✅ None | ✅ None | ❌ Periodic expiry; must pull latest image | ✅ None | ✅ None |
| SSL certificate setup | ✅ None needed | --protocol http
|
✅ Managed | ||
| Community sentiment | ✅ | ❌ Widely despised — "broken", "souring our perception of Cosmos" (dozens of complaints) | ✅ Trusted (at cost) |
Legend:
- ✅ = Full support
⚠️ = Partial support (details in Notes)- ❌ = Not supported
| 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 | ✅ | ✅ | ✅ | ✅ | ✅ |
| 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 | ✅ | ✅ | ✅ | ✅ |
| 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 |
| 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) | ✅ | ✅ | ✅ | ✅ | ✅ |
| 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 | ✅ | ✅ | ✅ | ✅ | ✅ |
| 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) |
| 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 |
| 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 | ✅ | ✅ | |||
| 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) |
| Feature | CosmosDB.InMemoryEmulator | Windows Emulator | Linux Docker | Linux vNext | Real Azure Cosmos DB | Notes |
|---|---|---|---|---|---|---|
COUNT |
✅ | ✅ | ✅ | ✅ | vNext: regressions (#273, #274) | |
SUM |
✅ | ✅ | ✅ | ✅ | ||
AVG |
✅ | ✅ | ✅ | ✅ | ||
MIN |
✅ | ✅ | ✅ | ✅ | ||
MAX |
✅ | ✅ | ✅ | ✅ |
| 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 |
| 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 |
✅ | ✅ | ✅ | ✅ | ✅ |
| 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 |
✅ | ✅ | ✅ | ✅ | ✅ |
| 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 |
| 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 |
✅ | ✅ | ✅ | ✅ | ✅ |
| Feature | CosmosDB.InMemoryEmulator | Windows Emulator | Linux Docker | Linux vNext | Real Azure Cosmos DB | Notes |
|---|---|---|---|---|---|---|
TOSTRING / ToString
|
✅ | ✅ | ✅ | ✅ | ✅ | |
TONUMBER / ToNumber
|
✅ | ✅ | ✅ | ✅ | ✅ | |
TOBOOLEAN / ToBoolean
|
✅ | ✅ | ✅ | ✅ | ✅ |
| 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 |
✅ | ✅ | ✅ | ✅ | ✅ |
| 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 |
✅ | ✅ | ✅ | ✅ | ✅ |
| Feature | CosmosDB.InMemoryEmulator | Windows Emulator | Linux Docker | Linux vNext | Real Azure Cosmos DB | Notes |
|---|---|---|---|---|---|---|
IIF |
✅ | ✅ | ✅ | ✅ | ✅ | |
COALESCE |
✅ | ✅ | ✅ | ✅ | ✅ |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| Feature | CosmosDB.InMemoryEmulator | Cosmium | FakeCosmosDb | FakeCosmosEasy |
|---|---|---|---|---|
| Language | C# (NuGet) | Go (binary / Docker) | C# (NuGet) | C# (NuGet) |
| In-process (no external deps) | ✅ | ❌ Separate process | ✅ | ✅ |
| 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 | ✅ | ❌ | ❌ | ❌ |
| 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) | ✅ | ✅ | ✅ | ❌ |
| Feature | CosmosDB.InMemoryEmulator | Cosmium | FakeCosmosDb | FakeCosmosEasy | Notes |
|---|---|---|---|---|---|
COUNT |
✅ | ✅ | ❌ | ❌ | |
SUM |
✅ | ✅ | ❌ | ❌ | |
AVG |
✅ | ✅ | ❌ | ❌ | |
MIN |
✅ | ✅ | ❌ | ❌ | |
MAX |
✅ | ✅ | ❌ | ❌ |
| 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 |
✅ | ❌ | ❌ | ❌ |
| 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
|
✅ | ❌ | ❌ | ❌ |
| 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 |
✅ | ❌ | ❌ | ❌ |
| 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
|
✅ | ❌ | ❌ | ❌ |
| Feature | CosmosDB.InMemoryEmulator | Cosmium | FakeCosmosDb | FakeCosmosEasy | Notes |
|---|---|---|---|---|---|
| All 15 date/time functions | ✅ | ❌ | ❌ | ❌ | Cosmium has no date/time function support |
| Feature | CosmosDB.InMemoryEmulator | Cosmium | FakeCosmosDb | FakeCosmosEasy | Notes |
|---|---|---|---|---|---|
| All 6 ST_* functions | ✅ | ❌ | ❌ | ❌ |
| Feature | CosmosDB.InMemoryEmulator | Cosmium | FakeCosmosDb | FakeCosmosEasy | Notes |
|---|---|---|---|---|---|
IIF |
✅ | ✅ | ❌ | ❌ | |
COALESCE |
✅ | ❌ | ❌ | ❌ | |
FULLTEXTCONTAINS / FULLTEXTSCORE
|
❌ | ❌ | ❌ | ||
VECTORDISTANCE |
✅ | ❌ | ❌ | ❌ |
| Feature | CosmosDB.InMemoryEmulator | Cosmium | FakeCosmosDb | FakeCosmosEasy | Notes |
|---|---|---|---|---|---|
| Transactional batches (atomic, rollback) | ✅ | ❌ | ❌ | ||
| 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 | ❌ | ❌ | ❌ | ||
| 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) | ✅ | ✅ | ❌ | ❌ |
| CosmosDB.InMemoryEmulator | Cosmium | FakeCosmosDb | FakeCosmosEasy | |
|---|---|---|---|---|
| Actively maintained | ✅ | ✅ | ✅ | ❌ (3 years stale) |
| License | MIT | MIT | MIT | GPL-3.0 |
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 | |
| Patch operations (8) | ✅ 8/8 | ✅ 8/8 | ✅ 8/8 | |
| Transactional batch ops (10) | ✅ 10/10 | ✅ 10/10 | ||
| SQL clauses & syntax (~30) | ✅ ~29/30 | ✅ ~29/30 | ||
| SQL aggregate functions (5) | ✅ 5/5 | ✅ 5/5 | ✅ 5/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) | ✅ 5/5 | ✅ 5/5 | ✅ 5/5 | |
| Vector search (2) | ✅ 2/2 | ✅ 2/2 | ✅ 2/2 | |
| Change feed (12) | ✅ 11/12 | ✅ 11/12 | ✅ 11/12 | |
| Stored procedures / triggers / UDFs (11) | ✅ 11/11 | ✅ 11/11 | ❌ 0/11 | |
| Container policies (11) | ✅ 11/11 | ✅ 11/11 | ||
| Users & permissions (9) | ✅ 9/9 | ✅ 9/9 | ❌ 0/9 | |
| InMemory-exclusive features (10) | ✅ 10/10 | ❌ 0/10 | ❌ 0/10 | ❌ 0/10 |
- ✅ 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
- ❌ 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
- 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)
- Full-fidelity testing on Windows
- Testing client encryption or resource tokens
- Need for Data Explorer UI
- Multi-API testing (MongoDB, Cassandra, etc.)
⚠️ Not recommended — critically broken for many users- Legacy CI pipelines that haven't migrated
- Cross-platform Docker-based testing
- ARM64 environments (Apple Silicon)
- When you need real HTTP-level fidelity
- Testing OpenTelemetry integration
- 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
- Known Limitations — Full list of behavioural differences with detailed test references
- Features — Complete feature documentation with examples
- Getting Started — Quick setup guide
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 |
| 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 | ❌ Provisioning minutes | |
| Works offline | ✅ | ✅ | ✅ | ✅ | ❌ Requires internet |
| CI-friendly | ✅ | ❌ Frequently broken in CI (#86) | |||
| Multiple instances / parallel | ✅ One per test | ❌ Single instance only | |||
| Test isolation | ✅ New instance per test | ❌ Shared; risk of data leakage | |||
| Stable under load | ✅ No sockets/network | ❌ Crashes, 429s, 503s under non-trivial load | ✅ (at cost) | ||
| No crashes / corruption | ✅ Pure in-memory | ❌ PAL PANIC core dumps, fatal errors, evaluation expiry crashes | ✅ | ||
| Platform support | ✅ Any (.NET) | ❌ Windows only | ✅ Linux / macOS / Windows; ARM64 supported | ✅ Any platform | |
| No special reset needed | ✅ Dispose and recreate | /DisableRIO
|
✅ Recreate container | ||
| Custom auth keys | ✅ Any / none | --key-file) |
✅ | ||
| Serverless throughput mode | ✅ (no RU enforcement) | ❌ Provisioned only | ❌ Provisioned only | ❌ Provisioned only | ✅ |
| Unlimited containers | ✅ | ✅ | ✅ | ||
| Connection mode | ✅ Gateway (via FakeCosmosHandler) | ✅ Gateway + Direct | ✅ Gateway + Direct | ✅ Gateway + Direct | |
| Evaluation period / expiry | ✅ None | ✅ None | ❌ Periodic expiry; must pull latest image | ✅ None | ✅ None |
| SSL certificate setup | ✅ None needed | --protocol http
|
✅ Managed | ||
| Community sentiment | ✅ | ❌ Widely despised — "broken", "souring our perception of Cosmos" (dozens of complaints) | ✅ Trusted (at cost) |
| 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) | ✅ | ✅ | ✅ | ✅ | |
| Conditional patching (filter predicate) | ✅ | ✅ | ✅ | ✅ | |
| Transactional batches (atomic, rollback) | ✅ | ✅ | ✅ | ✅ | |
| Bulk operations | ✅ | ✅ | ✅ | ❌ (.NET SDK limitation) | ✅ |
| ETag concurrency (IfMatch / IfNoneMatch) | ✅ | ✅ | ✅ | ✅ | ✅ |
| TTL / expiration (container + per-item) | ✅ (lazy eviction) | ✅ | ✅ | ✅ | |
| 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) | ✅ |
| Feature | CosmosDB.InMemoryEmulator | Windows Emulator | Linux Docker | Linux vNext | Real Azure Cosmos DB |
|---|---|---|---|---|---|
| SQL query parser | ✅ 125+ functions | ✅ Full | ✅ Full | ✅ Full | |
SELECT / FROM / WHERE
|
✅ | ✅ | ✅ | ✅ | ✅ |
ORDER BY (single & multi-field) |
✅ | ✅ | ✅ | ✅ | ✅ |
GROUP BY / HAVING
|
✅ | ✅ | ✅ | ✅ | ✅ |
DISTINCT |
✅ | ✅ | ✅ | ✅ | ✅ |
TOP |
✅ | ✅ | ✅ | ✅ | ✅ |
OFFSET ... LIMIT |
✅ | ✅ | ✅ | ✅ | ✅ |
JOIN (array expansion) |
✅ Unlimited | ✅ | ✅ | ||
Subqueries / EXISTS
|
✅ | ✅ | ✅ | ✅ | ✅ |
IN |
✅ | ✅ | ✅ | ✅ | ✅ |
BETWEEN |
✅ | ✅ | ✅ | ✅ | ✅ |
LIKE |
✅ | ✅ | ✅ | ✅ | ✅ |
| Parameterised queries | ✅ | ✅ | ✅ | ✅ | ✅ |
VALUE keyword (scalar projection) |
✅ | ✅ | ✅ | ✅ | |
| Aggregate functions (COUNT, SUM, AVG, MIN, MAX) | ✅ | ✅ | ✅ | ✅ | |
| 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 | ✅ | ✅ | ❌ Not yet implemented (#233) | ✅ | |
| Query pagination (MaxItemCount, continuation) | ✅ | ✅ | ✅ | ✅ | |
| Large result sets | ✅ | ✅ | ✅ | ✅ |
| 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 | ✅ | ✅ | ✅ | ✅ | |
| 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 | ✅ | ✅ | ❌ Not yet implemented | ✅ | |
| All consistency levels | ✅ | ||||
| IndexingPolicy enforcement | ✅ | ✅ | ❌ Not yet implemented | ✅ | |
| Conflict resolution policy | ✅ | ✅ | ❌ | ✅ | |
| 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
|
✅ | --data-path mount |
✅ | |
| Multiple database APIs (Mongo, Cassandra, Gremlin, Table) | ❌ NoSQL only | ✅ All five | ✅ All five | ❌ NoSQL only | ✅ All five |
| 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 | ✅ | ✅ | ✅ | |
| Stream API variants | ✅ | ❌ | ❌ | ❌ |
| ReadMany | ✅ | ❌ | ❌ | ❌ |
| Patch operations | ✅ | ❌ | ❌ | ❌ |
| Document size limits (2 MB) | ✅ | ❌ | ❌ | ❌ |
| Queries | ||||
| SQL query parser | ✅ 125+ functions | |||
GROUP BY / HAVING
|
✅ | ✅ | ❌ | ❌ |
DISTINCT / TOP / OFFSET LIMIT
|
✅ | ✅ | ❌ | ❌ |
Subqueries / EXISTS
|
✅ | ✅ | ❌ | ❌ |
JOIN (array expansion) |
✅ Unlimited | ✅ | ❌ | ❌ |
BETWEEN / LIKE / IN
|
✅ | ❌ | ❌ | |
| Parameterised queries | ✅ | ✅ | ❌ | ✅ |
| Aggregate functions (COUNT, SUM, AVG, MIN, MAX) | ✅ | ✅ | ❌ | ❌ |
| String functions (26) | ✅ | ❌ | ||
| Math functions (30 incl. Int*, trig) | ✅ | ✅ ~30 | ❌ | ❌ |
| Type-checking functions (10) | ✅ | ✅ | ❌ | ❌ |
| Array functions (10 incl. Set*) | ✅ | ❌ | ❌ | |
| 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) | ❌ | ❌ | |
| 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 |
Getting Started
Integration & Dependency Injection
Data Management
Reference
Help