<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abinav Rameesh on Medium]]></title>
        <description><![CDATA[Stories by Abinav Rameesh on Medium]]></description>
        <link>https://medium.com/@abramees?source=rss-f30444bacbad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ttvg2NqVPyeXcrn_iWPyqQ.png</url>
            <title>Stories by Abinav Rameesh on Medium</title>
            <link>https://medium.com/@abramees?source=rss-f30444bacbad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 02:29:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abramees/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Azure DocumentDB: Schema Drift? No problem!]]></title>
            <link>https://medium.com/@abramees/azure-documentdb-schema-drift-no-problem-0575f54cd461?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/0575f54cd461</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Sat, 05 Sep 2026 05:19:36 GMT</pubDate>
            <atom:updated>2026-09-05T05:19:36.845Z</atom:updated>
            <content:encoded><![CDATA[<p>A retail customer of ours has been running two backends side by side for a while now: critical services already migrated to Azure DocumentDB, and a handful of legacy services still on Couchbase, slowly being phased out.</p><p>This quarter, their engineering team pointed an agentic coding layer at both — same task, same goal: find every product that does <strong>not</strong> have a valid campaign price set, and validate the result against seven years of accumulated production data.</p><p>The two backends did not behave the same way. The reason comes down to a query semantics decision made years ago, one that most teams never think about until their schema has drifted enough for it to matter.</p><h3>The task: find products with no valid campaign price</h3><p>campaign_price is supposed to be simple — a number if a promotional price is set, and absent otherwise. But seven years of independent service development gave &quot;no valid campaign price&quot; three different representations. Some documents never had the field at all. Some had it explicitly set to null once a campaign ended. And a batch of documents, written by an older service that serialized values as strings before a later refactor, stored the literal string &quot;null&quot; instead of the JSON/BSON null value.</p><p>Finding “products with no valid campaign price” should be a single, simple filter. Whether it actually is one depends entirely on how the underlying query engine treats missing and null-like values.</p><h3>Query complexity on Couchbase</h3><p>Couchbase’s N1QL follows an <strong>open-world</strong> data model. A query referencing a field that doesn’t exist on a document doesn’t evaluate to false — it evaluates to a special MISSING value, and comparisons involving MISSING follow three-valued logic (true / false / unknown) rather than clean booleans. Critically, N1QL treats &quot;field doesn&#39;t exist,&quot; &quot;field is null,&quot; and &quot;field holds the string \&quot;null\&quot;&quot; as three separate, unrelated states, with no automatic equivalence between any of them.</p><p>That means finding “no valid campaign price” requires enumerating every historical representation by hand:</p><pre>SELECT product_id, name<br>FROM products<br>WHERE campaign_price IS MISSING<br>   OR campaign_price IS NULL<br>   OR campaign_price = &quot;null&quot;;</pre><p>Drop any one of those three branches and the corresponding batch of products silently disappears from the result set — no error, no warning, just a quietly incomplete answer that only becomes correct once every legacy representation has been discovered and named explicitly.</p><h3>Query complexity on Azure DocumentDB</h3><p>Azure DocumentDB is Microsoft’s MongoDB-compatible database, built on fully open-source PostgreSQL. Its query language, MQL, follows a <strong>closed-world</strong> model that behaves differently by default. In MongoDB-style semantics, a plain query like:</p><pre>db.products.find({ campaign_price: null });</pre><p>already matches both “field is missing” and “field is explicitly null” — no separate truth state to reason about, no need to know that distinction exists ahead of time. Folding in the third legacy representation is additive, not a rewrite of the underlying logic:</p><pre>db.products.find({<br>  campaign_price: { $in: [null, &quot;null&quot;] }<br>});</pre><p>One clause. No three-valued logic, no IS MISSING versus IS NULL distinction to maintain, and no separate branch required for the stringified artifact. The engine&#39;s default null-matching behavior already does the work that N1QL requires an explicit, exhaustive OR chain to achieve.</p><h3>The agentic 0-to-1 problem</h3><p>This is where the story stopped being a syntax curiosity and became an operational one. When the customer’s agentic coding layer was pointed at the legacy Couchbase services, it wrote the version of the query it had the least reason not to write:</p><pre>SELECT product_id, name<br>FROM products<br>WHERE campaign_price IS NULL;</pre><p>Reasonable-looking, wrong at scale. It caught only one of the three representations “no valid campaign price” actually took across seven years of drift. The agent had no way to infer IS MISSING or the &quot;null&quot; string artifact from the schema alone — both are <em>tribal knowledge</em>, invisible in any single document&#39;s current shape. Going from that first draft to a correct query meant discovering, one failed validation at a time, which representations existed and patching the OR chain to match.</p><p>Against the services already running on DocumentDB, the same agent, given the same task, wrote:</p><pre>db.products.find({ campaign_price: { $in: [null, &quot;null&quot;] } });</pre><p>on its first pass — already correct, because null matching missing-or-null is the <em>default</em> behavior an agent trained on standard MongoDB query semantics already expects, and adding the string artifact was a single, self-contained addition rather than a new logical branch to learn.</p><p>That’s the practical difference between an engine where “no valid campaign price” is one idea with a couple of literal representations, and one where it’s three separate logical universes an agent has to individually discover.</p><h3>The token consumption gap</h3><p>The correctness gap shows up directly in how many tokens it takes an agent to get there.</p><p>On Couchbase, each wrong first-pass query triggered its own loop: run the query, compare the result count against the expected baseline, notice the discrepancy, reason about <em>why</em> rows were missing, patch in one more OR clause, and re-validate. For this single field, that was two to three iterations before the query correctly covered IS MISSING, IS NULL, and the &quot;null&quot; string artifact. Each iteration carries its own context — the previous query, the result diff, an explanation of open-world semantics, the revised query — and that cost repeats for every drifted field across every legacy service still being migrated.</p><p>On DocumentDB, the agent’s first-pass query was already correct. Zero iterations, zero repair loops, zero accumulated context from failed attempts. The token cost of reaching a correct query was just the token cost of writing the query.</p><p>That gap doesn’t stay fixed. It scales with the same two variables that define any migration of this shape: number of fields affected by drift, and number of services being touched. A platform with dozens of drifted fields across dozens of services doesn’t just accumulate more <em>chances</em> for a silently wrong Couchbase query — it accumulates more multi-iteration repair loops, and therefore more token spend, for every one of them. On DocumentDB’s closed-world model, that multiplier disappears almost entirely, because there’s nothing left to iteratively discover.</p><h3>The bigger pattern</h3><p>Schema drift is inevitable once a platform has run for years across multiple teams. It isn’t a design failure — it’s what production systems look like at scale. The real question is what the query engine does with that drift by default: quietly reconcile the common cases, or require every one of them to be rediscovered and named, query by query, service by service.</p><p>For this customer, the services already migrated to Azure DocumentDB didn’t need their agentic layer to relearn seven years of tribal knowledge about campaign_price to get a correct answer on the first try. The legacy Couchbase services did — and paid for that rediscovery in validation cycles and tokens, on real data, in production.</p><p><em>Azure DocumentDB is a MongoDB-compatible database service, built on the </em><a href="https://github.com/documentdb/documentdb"><em>MIT licensed open-source DocumentDB project</em></a><em>.</em></p><p><em>For more Azure DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0575f54cd461" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure DocumentDB: Sometimes the right architecture is fewer cores. Not More.]]></title>
            <link>https://medium.com/@abramees/azure-documentdb-sometimes-the-right-architecture-is-fewer-cores-not-more-4fb16c186e05?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fb16c186e05</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 01:18:03 GMT</pubDate>
            <atom:updated>2026-07-25T01:18:03.188Z</atom:updated>
            <content:encoded><![CDATA[<p>A customer came to us recently with a number that doesn’t leave much room for negotiation. 600,000 writes per second. Sustained. Non-negotiable. This wasn’t a batch job or an analytics pipeline. It was a trading application, and the people running it have been doing this long enough to know exactly what they need and why.</p><p>The instinct, ours and theirs, was to scale up. Bigger node, more cores, more memory, to brute-force the throughput.</p><p>We tried.</p><p>We cut every index we could justify cutting. We minimized cross-shard queries. We stripped the workload down to the leanest possible write path. Anything that could shave overhead off a single write, we did it.</p><p>It wasn’t enough and it was never going to be enough, because the bottleneck wasn’t compute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MCKYi3H-Xh8AdDPv4Gbh3g.png" /></figure><h3>Where the ceiling actually was</h3><p>We pushed to a 64-core M200 node, assuming that 80,000 IOPS and 1.2 GB/s of throughput on our newest SSD v2-backed disks would give us headroom. It didn’t. With their write throughput and per second payload sizes in total, we hit the 1.2 GB/s disk bandwidth limits almost immediately, and no amount of index tuning was going to change the physics of a single disk attached to a single node.</p><p>600,000 writes per second, even at a modest average document size, translates into disk throughput demand that dwarfs 1.2 GB/s well before you account for index maintenance. The M200 node had plenty of vCPUs and memory to spare. CPU utilization wasn’t the problem, and memory pressure wasn’t the problem. Every metric that mattered was downstream of one thing - how fast bytes could physically land on disk and get acknowledged back to the client.</p><p>The customer’s requirements weren’t unreasonable. The workload wasn’t poorly designed either. The constraint was architectural. A single node, no matter how large, has a ceiling on disk bandwidth, because a single node has a fixed number of disks and a fixed per-disk throughput limit. Once you’re pinned against that ceiling, adding cores does nothing. You’re not compute-bound. You’re I/O-bound. No amount of vertical scaling fixes that. You can add every core available and the write acknowledgment latency doesn’t move, because the disk underneath hasn’t gotten any faster.</p><h3>What actually worked: scaling down to scale out</h3><p>We took the node size down<em> </em>75%, from an M200 to an M60. Moreover, instead of one node, we deployed four.</p><p>On paper that looks like a downgrade. Fewer cores per node, less memory per node, a smaller SKU by every conventional measure of “bigger is better.” In practice, four M60 nodes gave us four independent disks instead of one. That meant four times the aggregate disk bandwidth. We went from being capped at 1.2 GB/s on a single node to almost 5 GB/s across the now 4-node cluster.</p><p>The IOPS ceiling moved the same way, scaling near-linearly with node count rather than staying pinned to whatever a single SSD v2 disk could sustain. Throughput stopped being the constraint, and the 600K writes/sec target was no longer a stretch goal. It was met, with headroom to absorb burst traffic during volatile trading windows.</p><p>The trade-off is worth naming honestly. Each individual M60 has less compute than the single M200. But compute was never the scarce resource here. The workload’s actual demand was disk bandwidth, and disk bandwidth scales with node count in a way that vCPU count never could on a single machine. Four smaller engines each pulling their own weight on I/O beat one large engine choking on a single I/O path and the aggregate cost profile came out favorably too, since the customer was no longer paying for compute headroom they didn’t need.</p><p>The mechanism that made this possible, and the part that matters most, is that the customer kept their data un-sharded. Instead of splitting collections apart to distribute load via the conventional NoSQL scale-out playbook, where data is range sharded, they distributed whole, un-sharded collections across the four nodes.</p><p>With this approach, Collection A lives entirely on one node’s share of the cluster. Collection B lives entirely on another and so on. No partitioning logic. No cross-shard query complexity. No application-level awareness of where any given document physically lives, and no query-routing logic to optimize or maintain. The service handled placement and distribution transparently. The application just kept writing, exactly as it had on a single node, only now backed by four times the disk bandwidth as before.</p><p>Scaling out doesn’t have to mean sharding. Sharding is one way to distribute load across nodes — splitting a single logical collection into pieces but it’s not the only way, and it’s not free. It changes query patterns. It complicates transactions and lookups that used to be local, and it pushes topology awareness into places the application shouldn’t have to think about. Distributing collections whole across nodes gets you the same aggregate hardware benefit. More disks, more bandwidth, and more parallelism, all without touching the data model.</p><h3>Why this matters beyond one trading desk</h3><p>The instinctive scaling story in most NoSQL systems is your writes are too high, so shard, and shard again, and keep sharding as the numbers grow. That model works, but it comes with a tax. Cross-shard queries, rebalancing overhead, transactions that used to be single-document and now aren’t, and application code that has to know about the topology of its own data. Teams pay that tax because they assume it’s the only path to horizontal scale.</p><p>What this customer’s setup demonstrates is a different lever entirely: disk bandwidth is horizontally scalable independent of core count, and independent of sharding. If your bottleneck is genuinely I/O and for high-throughput write-heavy workloads, it usually is, since write-heavy systems tend to exhaust disk throughput long before they exhaust compute, the answer isn’t a bigger single node. It’s more nodes, each doing less compute-per-node but contributing more aggregate disk throughput, while the data model itself stays exactly as simple as it was on day one.</p><p>The lesson generalizes past this one workload. Before reaching for a bigger box, or reaching for a sharding strategy, look at which resource is actually saturated. If it’s disk, not compute, the fix is more disks and not more cores. For a trading application where correctness and simplicity of the data model are as important as raw throughput, that’s not a workaround. That’s the architecture doing its job.</p><p><em>Azure DocumentDB is a MongoDB-compatible database service, built on the </em><a href="https://github.com/documentdb/documentdb"><em>MIT licensed open-source DocumentDB project</em></a><em>.</em></p><p><em>For more Azure DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fb16c186e05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure DocumentDB Admin knobs you don’t need, until you do]]></title>
            <link>https://medium.com/@abramees/azure-documentdb-admin-knobs-you-dont-need-until-you-do-6afcf89c1810?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/6afcf89c1810</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 01:38:41 GMT</pubDate>
            <atom:updated>2026-07-22T01:38:41.727Z</atom:updated>
            <content:encoded><![CDATA[<p>Azure DocumentDB’s core architectural bet is scale-up over scale-out. Give a node more memory and more IOPS before asking a customer to reason about shard keys, chunk balancing, or which collections live where. Most collections, even large ones, fit comfortably on a single well-provisioned node. Sharding is available, but it’s the exception, not the default posture.</p><p>That bet only holds up if the exception is easy to invoke when a workload actually needs it. This is the story of a customer who needed it, why it happened, and the operation that made it a non-event: moveCollection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8NkRAhp1cgT40N8D-ZUgAQ.png" /></figure><h3>The setup</h3><p>Long-time readers will recognize this customer. They’re the same team that migrated 47 TB and 7,000+ collections off a 27-node MongoDB Atlas replica set into a lean, un-sharded Azure DocumentDB cluster in under 48 hours. That migration’s defining decision was refusing to mirror the source topology. The source was sharded on _id across nine shards. The target didn&#39;t need to be. Every collection fit on a node, so every collection stayed un-sharded, distributed across a small cluster by storage volume.</p><p>That decision held up in production. The customer never had to think about shard keys, chunk distribution, or rebalancing for any of their collections. That was the entire point.</p><p>But a cluster that grows eventually surfaces a workload the initial distribution didn’t anticipate.</p><h3>Where it started to bend</h3><p>As the cluster grew from three shards to four, a handful of collections stood out. They weren’t the largest collections. They were the ones taking unfiltered find() calls — full collection scans with no query predicate narrowing the working set. Queries like that only run fast when the entire collection sits in memory. The moment part of it gets evicted, the next scan pays a disk read, and latency stops being predictable.</p><p>The problem wasn’t that these collections were too big for a node. It was who they shared a node with. Co-located next to other high-throughput collections, they were competing for the same in-memory cache. Every eviction cycle taxed the collections that could least afford it. The customer saw exactly the failure mode you’d expect: cold reads adding tens of milliseconds, inconsistently, on the collections most sensitive to it.</p><p>Re-architecting around this — introducing a shard key, splitting a collection that didn’t need splitting, redesigning access patterns — would have reintroduced the exact complexity the original migration was designed to avoid. That wasn’t an option worth considering.</p><h3>The actual fix</h3><p>The fix didn’t touch the data model at all. It moved data.</p><p>moveCollection relocates an existing, un-sharded collection from one shard to another, without converting it into a sharded collection and without changing how the application queries it. From the driver&#39;s perspective, nothing changes. From the cluster&#39;s perspective, that collection now has a new home.</p><p>The customer used it to isolate the cache-sensitive collections onto a single shard sized to hold all of them fully in memory, and let the remaining collections redistribute across the other three. No shard key. No chunk migration. No query rewrite. Just a placement change, applied to exactly the collections that needed it.</p><p>In practice, that meant iterating over the list of offending collections and issuing one moveCollection command per namespace:</p><pre>const dbName = &quot;&lt;your-database&gt;&quot;; <br>const toShard = &quot;shard_3&quot;;<br>const collections = [<br>  &quot;collectionOne&quot;,<br>  &quot;collectionTwo&quot;,<br>  &quot;collectionThree&quot;,<br>  // ...<br>];<br><br>for (const coll of collections) {<br>  const ns = `${dbName}.${coll}`;<br>  try {<br>    print(`Moving ${ns} -&gt; ${toShard} ...`);<br>    const res = db.adminCommand({ moveCollection: ns, toShard: toShard });<br>    print(`  ok=${res.ok}`);<br>  } catch (e) {<br>    print(`  ERROR moving ${ns}: ${e.message}`);<br>  }<br>}</pre><p>Nothing exotic. A target shard, a list of collection names, and a loop over the admin command — with enough error handling to see exactly which namespace failed if one did. The customer’s actual list ran to several dozen collections, all sharing the same query profile: unfiltered scans that only perform well fully cached.</p><p>The result was immediate: the isolated collections stopped fighting for cache space, eviction pressure on them dropped, and their query latency became consistent instead of spiky. Everything else in the cluster kept behaving exactly as it had before, because nothing else moved.</p><h3>Why this is the right shape of knob</h3><p>It would be easy to read this as sharding by another name. It isn’t. Sharding asks you to pick a key, live with its distribution properties, and reason about cross-shard queries for the life of the collection. moveCollection asks you to answer one question — does this collection need to be somewhere else? — and then get out of the way.</p><p>That’s a meaningfully smaller commitment. The customer’s several hundred other collections never needed this knob and never will. The four or five that did got a targeted fix that took effect without a migration project, a maintenance window, or a change to a single line of application code.</p><p>This is also, not incidentally, the same instinct behind the original migration decision. Don’t reshape the workload to fit the topology. Reshape the topology, narrowly, to fit the workload — and only where the data actually demands it.</p><h3>What this sets up</h3><p>Today, isolating a hot collection to a shard is a decision a DBA or platform engineer makes by watching cache metrics and reaching for a documented operation. It’s a deliberate, informed action.</p><p>It’s not hard to see where this goes next. As agentic tooling matures, tuning decisions like this — watch for cache eviction pressure, isolate the offending collection, verify latency recovers — are exactly the kind of narrow, well-bounded optimization an agent could make after a workload has already found its steady state. The knob doesn’t need to disappear. It just needs to eventually be turned by something other than a human watching a dashboard.</p><p>For now, it’s turned by hand. And for a cluster running seven-thousand-plus collections without a single shard key in sight, that’s still one knob doing a lot of work.</p><p><em>Azure DocumentDB is a MongoDB-compatible database service, built on the </em><a href="https://github.com/documentdb/documentdb"><em>MIT licensed open-source DocumentDB project</em></a><em>.</em></p><p><em>For more Azure DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6afcf89c1810" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Scale-Up Bet: Why Azure DocumentDB went against NoSQL convention]]></title>
            <link>https://medium.com/@abramees/the-scale-up-bet-why-azure-documentdb-went-against-nosql-convention-f36acc88361d?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/f36acc88361d</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Wed, 08 Jul 2026 19:08:04 GMT</pubDate>
            <atom:updated>2026-07-08T19:08:04.711Z</atom:updated>
            <content:encoded><![CDATA[<p>Most NoSQL databases converged on the same answer to growth: shard early, shard often. Cassandra, DynamoDB, Couchbase, Aerospike — the industry default is horizontal scale-out as the primary lever, with vertical scaling treated as a stopgap. Azure DocumentDB made a different bet. Scale up first. Shard only when you actually need to.</p><p>This was not an obvious call. When the architecture was being decided, scale-out was the trend, the safe choice, the thing every comparable system was doing. Betting against that consensus meant betting that most workloads don’t need distributed-systems complexity on day one. Moreover, the ones that eventually do would be better served by adding it later, not by inheriting it upfront.</p><p>Moreover, this was no longer just a developer or architect play. This was an agentic play as well, as most things are these days. The idea was that scaling out involves more architectural decision and more complex decision making. These complexities are much simpler when there’s just a handful of collections even if they are very large. However, when running with hundreds or thousands of collections, all of which can explode in the future, scaling up is far simpler for agents and the iterative process. Sharding hundreds or thousands of collections to fit their query profiles will cause significant delays.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HhaQGVBtxL2SGKT5Q6_HQ.png" /></figure><h3>What “scale up first” actually means</h3><p>A single physical shard in Azure DocumentDB supports up to 32 TB of compressed storage. Depending on average compression ratios of 70%, that’s roughly 110 TB of logical data per node. Compute and storage scale independently. You can grow vCores and RAM without touching disk, and then grow disk size without forcing a compute upgrade. Scaling up is a zero-downtime operation. No rebalancing, no change in the number of physical shards, and no impact to the running application.</p><p>Compare that to the typical NoSQL default of capping a physical shard at 2–4 TB. At that ceiling, an application with no distributed-systems need of its own still ends up sharded, because the storage engine ran out of room before the workload ran out of reasons to stay simple. The application inherits partition key design, cross-shard query limitations, and rebalancing operations it never asked for.</p><p>Azure DocumentDB inverts that default. Sharding is defined per collection, not per cluster, and it’s optional. Sharded and unsharded collections coexist in the same cluster, and the service places them across physical shards to balance load. The application doesn’t manage or even know that placement. So, a workload only takes on sharding complexity when its data volume or throughput actually demands it, collection by collection, not as a tax paid upfront for the entire database.</p><p>When workloads do outgrow a single shard (32 TB isn’t infinite) — Azure DocumentDB adds physical shards and distributes data automatically, without asking the application to redesign around a partition key it guessed at during initial data modeling. Read replicas layer on top of this for read scaling, decoupled from the write-scaling story entirely.</p><h3>Why this mattered for migrations</h3><p>An airline customer consolidated a CRM system running across three separate databases — Couchbase, Aerospike, and Cassandra onto Azure DocumentDB. The reasons traced directly back to this architectural choice.</p><p>Migrating from systems where scale-out is mandatory from the first byte means every migration target has to answer for partition strategy before answering for functionality. A scale-up-first target removes that as a precondition. You migrate first, model your growth path second, and only introduce physical sharding for the collections that actually need it.</p><p>This is also why heterogeneous migrations onto Azure DocumentDB tend to compress in scope compared to migrating between two scale-out systems. There’s no forced re-partitioning step just to get data onto the new platform. The same logic extends to RDBMS migrations, where the source system had no partition key concept at all. Scale-up-first meets that workload where it is.</p><h3>Why this matters more now, for agentic workloads</h3><p>Agents that read, write, and iterate against a database do so fast, and they do so without a human pausing to think about partition key design before the next iteration. A workload that forces sharding decisions before there’s a stable access pattern is a workload that punishes exactly the kind of rapid, exploratory iteration agentic development depends on.</p><p>Scale-up-first removes that gate. An agent-driven prototype can create a collection, load data, iterate on query patterns, and scale the underlying cluster, all without a sharding decision blocking any of it. The sharding conversation only starts once there’s a real reason to have it - sustained throughput or storage past what a single physical shard can hold. That’s a decision made with data, not made defensively in anticipation of data that may never arrive.</p><p>The scale-out default optimized for the largest possible workload from the start. The scale-up bet optimized for the workload you actually have, with a clear path to the one you might eventually get. Three years past GA, the latter has turned out to be the more common shape of a real application.</p><h3>Separate request-based scale out from storage-based scale out</h3><p>Lastly, this architecture also separates scaling out for sheer request volume purposes from being coupled with scaling out for storage purposes.</p><p>For instance, consider a single collection, large enough to exceed the current 32 TB storage limits. This would also mean, the collection is large enough to exceed a raw, pre-compressed size of 110 TB.</p><p>In such scenarios, we have no choice but to shard the collection horizontally across multiple nodes.</p><p>However, in most scenarios, the cluster in total may be large in size while individual collections add up to that total.</p><p>In those scenarios, the data can continue to remain unsharded, while we physically place those collections in their entirety on one of the physical nodes. This allows for a collectively large request volume that cannot be sustained by a single node, without the complexities of sharding the dataset just for request volume scaling.</p><p>Lastly, even if a handful or less of the collections out grow their node’s capacity, just those can be sharded and auto distributed by the service while the lion’s share is kept simple.</p><p><em>Azure DocumentDB is a MongoDB-compatible database service, built on the </em><a href="https://github.com/documentdb/documentdb"><em>MIT licensed open-source DocumentDB project</em></a><em>.</em></p><p><em>For more Azure DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f36acc88361d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why a Real-Time personalization team left Aerospike for Azure DocumentDB]]></title>
            <link>https://medium.com/@abramees/why-a-real-time-personalization-team-left-aerospike-for-azure-documentdb-ace33d6ce693?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/ace33d6ce693</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Wed, 08 Jul 2026 06:48:22 GMT</pubDate>
            <atom:updated>2026-07-08T06:48:22.680Z</atom:updated>
            <content:encoded><![CDATA[<p>A mid-size ad-tech company, let’s call them Signal, since that’s roughly what they sell, spent six weeks evaluating Aerospike for a user-profile store. Sub-millisecond reads, a data layer built for flash, and a track record in adtech. On paper, it was the obvious pick. Then their engineers actually modeled the schema, and the evaluation turned into a pain-point audit.</p><p>This is the story of what they found, and why they ended up on Azure DocumentDB instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*ZlyGHcfC2LxrQRzezm3SgQ.png" /></figure><h3><strong>The setup: a profile store that needed to grow sideways</strong></h3><p>Signal’s use case was simple to describe and hard to model. A per-user profile document holding device IDs, segment memberships, recent event history, and a growing list of behavioral scores. Every field would eventually need renaming, nesting, or extension as the product evolved.</p><p>The single requirement to let the schema evolve surfaced all five problems.</p><h3><strong>Fifteen-byte bin names turn schema design into abbreviation golf</strong></h3><p>Aerospike bin names are capped at 15 characters (14 single-byte characters plus a null terminator, per Aerospike’s limits documentation). That’s not a soft guideline. Tooling and features can misbehave if you exceed it.</p><p>Signal’s field names — `recent_purchase_segment`, `device_fingerprint_hash` — didn’t survive contact with that limit. Engineers ended up truncating to cryptic short forms.</p><p>Azure DocumentDB’s MongoDB-compatible document model doesn’t impose an artificial field-name ceiling. Field names are just BSON keys — `recentPurchaseSegment` reads the same in the schema as it does in the query. No abbreviation required.</p><h3><strong>8 MiB record ceiling that fights the shape of real data</strong></h3><p>Aerospike caps total record size — data plus metadata — at 8 MiB, governed by `max-record-size`. For most workloads that’s generous. For a profile document with an unbounded event history, it’s a countdown clock. Signal’s engineers had to pre-build an overflow strategy. Split records, secondary lookups and manual reassembly before writing a single line of code.</p><p>Azure DocumentDB documents follow the same MongoDB conventions developers already know. Because the storage engine underneath is PostgreSQL, large or deeply nested documents are handled by a mature, general-purpose storage layer rather than a purpose-built in-memory cache. There’s no bespoke overflow architecture required before day one.</p><h3><strong>Every record taxes your RAM</strong></h3><p>This is the one that actually killed the deal.</p><p>In Aerospike, primary index entries live in DRAM by default. That’s roughly 64 bytes per record, multiplied by your replication factor, whether that record holds 50 bytes or 50 kilobytes of payload.</p><p>Aerospike’s own capacity planning guide walks through the math: 100 million small records at RF2 can burn through 12.8 GiB of RAM on index metadata alone, often more memory than the actual data consumes. The fix Aerospike recommends is architectural: consolidate many small records into fewer, larger docs, to keep the index-to-data ratio sane.</p><p>That’s a real engineering cost. A data-modeling discipline the team has to impose on every future schema change, forever. DocumentDB, running on PostgreSQL’s B-tree indexing underneath for primary key indexes, doesn’t force the same RAM tax per record. Index storage scales with disk, not with a hard requirement that every index entry sit in memory. Signal’s engineers stopped budgeting RAM per record and started budgeting it per actual query pattern.</p><h3><strong>1–128 KiB “Goldilocks zone” that shapes every decision you make</strong></h3><p>Aerospike documentation is candid about this. Records perform best between 1 KiB and 128 KiB. Below that, index overhead dominates. Above it, read and write latency degrades because every I/O drags more bytes. That band is workable — but it means every new entity type gets sized, tested, and often re-modeled around a target that has nothing to do with the actual product problem.</p><p>Signal’s profile document didn’t fit neatly in that band on day one, and it definitely wouldn’t in year two. With DocumentDB, the document model absorbs growth — nested arrays, subdocuments, growing histories — using standard MongoDB query and projection semantics to pull only the fields a given read actually needs.</p><p>The data model bends to the product. Not the other way around.</p><h3><strong>A namespace-wide set ceiling that punishes multi-tenant designs</strong></h3><p>Aerospike limits each namespace to 4,095 sets (one reserved for transaction monitors) — effectively, a hard ceiling on how many “tables” a single namespace can hold. For a platform like Signal’s, where new customer segments and internal entity types accumulate over time, that ceiling is a wall you can see coming from a long way off, and a namespace re-architecture isn’t a small project.</p><p>Azure DocumentDB, backed by PostgreSQL, doesn’t impose an equivalent low-thousands cap on collections. Teams can model multi-tenant and multi-entity systems the way the product actually grows, instead of pre-negotiating with a namespace limit years in advance.</p><h3><strong>What actually changed the decision</strong></h3><p>None of these five points were disqualifying in isolation.</p><p>Together, they described a pattern. Aerospike’s limits are the visible edges of a system tuned hard for raw throughput at flash-storage economics — a real, legitimate design point, just not Signal’s. Every one of the five pain points required the team to design around the database before they designed the product.</p><p>Signal picked Azure DocumentDB for the same MongoDB API and drivers their engineers already knew, running on the operational maturity of PostgreSQL underneath, a comprehensive free-tier and managed-service economics without the constant tax of pre-modeling around index RAM, record ceilings, and namespace math.</p><p>The best infrastructure is the one nobody has to think about again.</p><p><em>Azure DocumentDB is a MongoDB-compatible database service, built on the </em><a href="https://github.com/documentdb/documentdb"><em>MIT licensed open-source DocumentDB project</em></a><em>.</em></p><p><em>For more Azure DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ace33d6ce693" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two and a half years in: What we got right (and wrong) building Azure DocumentDB]]></title>
            <link>https://medium.com/@abramees/two-and-a-half-years-in-what-we-got-right-and-wrong-building-azure-documentdb-bb916c048b7d?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb916c048b7d</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 05:15:10 GMT</pubDate>
            <atom:updated>2026-07-03T05:15:10.705Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKIH6aZQ5LHbGKDpXMXOKw.jpeg" /></figure><p>Last month marked two and a half years since Azure DocumentDB went GA. That’s long enough to have real scar tissue, and short enough that we still remember exactly which decisions originally felt like gambles.</p><p>Looking back, three of our early day bets defined the journey more than anything else: compatibility first, open source second, and most recent, a collision with agentic workloads that humbled almost every assumption we came in with.</p><p>Here’s the honest version of how each one played out.</p><h3><strong>Bet One: Compatibility Above Everything</strong></h3><p>When we started, the obvious move would have been to build out managed-service conveniences early — autoscale knobs, tiering options, resiliency features, and the usual dials customers expect from a cloud database. We didn’t do that.</p><p>Instead, we went all in on MongoDB API compatibility. The goal was blunt. Get as close to 100% coverage of the MongoDB API surface as possible before touching anything else. Not 80%, not “the common operators plus some workarounds.” 100% first.</p><p>Even our TCO story — the pitch every enterprise buyer wants on slide two waited until compatibility was in a defensible place. That ordering was uncomfortable at times. It meant going to market without some of the polish that makes a database feel “finished.”</p><p>It was still the right call. The proof isn’t a benchmark or a whitepaper. It’s the hero customers who came on board during that compatibility-first phase and are still running on Azure DocumentDB today. When your API surface doesn’t force a rewrite, migration risk drops from a boardroom conversation to an engineering ticket. That’s what unlocked the early adoption we needed to survive long enough to make the next two bets.</p><p>To be honest, we didn’t get to 100%. We got to 99%. But that’s a great place to be before jumping into managed service functionality.</p><h3><strong>Bet Two: Going Open Source, Backwards</strong></h3><p>Most databases that go open source start there and add managed offerings later. We did it in reverse. Azure DocumentDB launched as a managed service first, and only after GA did we commit to the DocumentDB open source project.</p><p>That ordering created a specific kind of friction that teams going open-source-first rarely deal with. We had existing commercial commitments, existing customer expectations, and an existing internal culture built around a closed roadmap. Walking that back into the open wasn’t a switch we flipped. It was a slow, sometimes uncomfortable renegotiation of how the team thought about its own work.</p><p>The hardest part wasn’t technical. It was philosophical.</p><p>“Reach over revenue” is easy to say in a slide and genuinely hard to live by when every roadmap decision, every design tradeoff, every messy internal debate is now visible on GitHub instead of being hidden behind closed doors. Putting decisions on front street publicly, and in the open, before they’re polished is still something we’re acclimating ourselves to.</p><p>We’d be lying if we said otherwise.</p><p>But the DocumentDB open source project is real. It’s growing, and the community health metrics back that up. Going in reverse was harder than going in order would have been. It also forced a level of discipline that a green-field open source project doesn’t get from day one.</p><h3><strong>Bet Three: Agents Broke Our Cleanest Assumption</strong></h3><p>Here’s where the last stretch of the journey got genuinely surprising.</p><p>We assumed that all the work we’d put into API compatibility would translate directly into a frictionless path for AI agents.</p><p>Agents speak through drivers and SDKs. We figured if the API surface already looks like MongoDB, agent frameworks should just work. That was the theory.</p><p>It was wrong. Or at least very, very incomplete.</p><p>Compatibility turned out to be a head start, but not the finish line. What agentic workloads actually needed was a different list entirely:</p><p><strong>Instant availability —</strong> agents spin up and tear down resources in ways that don’t tolerate provisioning latency. A cluster that takes minutes to become usable is a cluster an agent framework will route around.</p><p><strong>Fewer decisions to provision —</strong> every configuration choice we left in a human’s hands became a decision an agent either had to be told how to make, or one it made badly.</p><p><strong>Precision on the edge cases — </strong>vector indexes, RAG retrieval patterns, complex aggregations, and less glamorously, making sure agents weren’t quietly connecting through deprecated drivers. None of that comes for free with API compatibility. All of it needed dedicated work.</p><p><strong>Latency as a first-class concern —</strong> prompt and context engineering turned out to demand the same rigor we’d normally reserve for developer-facing feedback loops. An agent waiting on a slow query isn’t just slower. It changes how the agent reasons about what to do next.</p><p>We’re still early in figuring this space out, and we’re saying that plainly rather than pretending otherwise. The compatibility bet bought us a seat at the table. It didn’t write the agentic playbook for us.</p><h3><strong>What This Adds Up To</strong></h3><p>Three phases, three different kinds of hard:</p><p><strong>Compatibility first </strong>— a bet on reducing customer risk before reducing our own.</p><p><strong>Open source in reverse — </strong>a bet on transparency that required unlearning old habits.</p><p><strong>The agent phase </strong>— a bet still in progress, built on a hypothesis that turned out to be only half right.</p><p>None of these were clean wins. Each one taught us something the previous one couldn’t have. If there’s a pattern across all three, it’s that the hardest parts were never the technical ones. They were the assumptions we had to admit were wrong in public.</p><p>Hard to say exactly what the next two and a half years hold. Given how much the last set of assumptions got upended, we’re not going to pretend to know.</p><p>But we’ll be sure to share the honest version again when we get there.</p><p><em>Azure DocumentDB is a MongoDB-compatible database service, built on the </em><a href="https://github.com/documentdb/documentdb"><em>MIT licensed open-source DocumentDB project</em></a><em>.</em></p><p><em>For more Azure DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb916c048b7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure DocumentDB — MongoDB API Compatibility Turned Out to Be Two Features]]></title>
            <link>https://medium.com/@abramees/azure-documentdb-mongodb-api-compatibility-turned-out-to-be-two-features-b45322326c5f?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/b45322326c5f</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 06:22:59 GMT</pubDate>
            <atom:updated>2026-06-23T06:22:59.158Z</atom:updated>
            <content:encoded><![CDATA[<h3>Where it started</h3><p>The original ask, when we started investing heavily in MongoDB compatibility for Azure DocumentDB, was not abstract. It was enterprise-grade and blunt:</p><p><em>Can I move a real MongoDB application? Production workloads, real queries, real drivers, all without spending cycles rewriting my codebase?</em></p><p>“Compatibility” as a marketing claim is easy. Compatibility that holds up under real migration timelines, real application complexity, and real production expectations is something to build deliberately, operator by operator, and stage by stage.</p><p>So that’s what we did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JfPsoTQK2GUKKy5LLGCLIw.png" /><figcaption>Azure DocumentDB (with MongoDB compatibility) - MongoDB API Compatibility</figcaption></figure><h3>What the numbers actually look like</h3><p>Today, Azure DocumentDB’s published compatibility story is measurably different from what people may remember from older cloud-era MongoDB narratives. Here’s where things stand across the four operator categories that matter most for migration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*H8hAHnw_nqJ9G6ZM1jNpJA.png" /></figure><p>Those numbers reflect sustained engineering investment across hundreds of individual operators and edge cases. This coverage enables a migration team to open an existing codebase and actually run it, rather than spending the first two sprints mapping out what needs to be rewritten.</p><p>For enterprises evaluating a migration to a fully managed, first-party Azure service, running at roughly 40% lower cost than MongoDB Atlas at comparable tiers, that operator surface area coverage is what makes the conversation. Not because it makes migration effortless. Migrations are never effortless. It removes the class of surprises that derails timelines and erodes trust in the target platform.</p><p>When 99% of your queries, operators, and aggregation stages work the way they always have, your engineers can focus on the real migration work: connection string updates and load testing. Not porting query logic.</p><h3>What’s actually in the gap</h3><p>Regarding the nearly 1% — the small percentage of unsupported operators is almost entirely intentional. Most of them are things you wouldn’t call from application code anyway.</p><p>When you look at what’s unsupported, it falls into a few clean categories:</p><p><strong>Control plane operations handled by Azure infrastructure.</strong> Commands like fsync, fsyncUnlock, logRotate, rotateCertificates, shutdown, and compact aren&#39;t exposed to users because Azure manages them at the infrastructure level. You don&#39;t call fsync in a managed service. The service handles durability guarantees. Similarly, setFeatureCompatibilityVersion and setDefaultRWConcern are surfaced through Azure&#39;s management layer, not through the MongoDB wire protocol.</p><p><strong>Shard management that Azure handles automatically.</strong> A large set of sharding commands — addShardToZone, removeShard, moveChunk, balancerStart, balancerStop, mergeChunks, split, and the rest of the shard operations catalog — are all marked N/A because Azure manages shard placement and rebalancing under the hood.</p><p><strong>Replication commands.</strong> Replication commands are entirely N/A. Azure manages replication for you. Service-managed failover and Graceful failover are control-plane features. You don’t manipulate replica sets from the application layer; the cluster topology is managed on your behalf.</p><p><strong>Role and user management via Microsoft Entra ID.</strong> Commands like grantRolesToUser, revokeRolesFromUser, and updateUser are N/A because DocumentDB&#39;s managed service routes identity and access management through Microsoft Entra ID.</p><p><strong>Query plan cache management already handled.</strong> The entire query plan cache command category is N/A. Our database engine manages query plan caching for you. That’s our responsibility.</p><p><strong>Aggregation pipeline stages for cluster introspection.</strong> The unsupported aggregation stages — $listSessions, $listLocalSessions, $listSampledQueries, $listSearchIndexes, $planCacheStats, $shardedDataDistribution, and $changeStreamSplitLargeEvent — are all cluster-introspection or infrastructure-management stages. They expose internal state that doesn&#39;t translate meaningfully to a managed service architecture where that state is deliberately abstracted.</p><p><strong>Operators deprecated by MongoDB itself.</strong> $where, $accumulator, and $function are deprecated in MongoDB. Azure DocumentDB not supporting them isn&#39;t a gap — it&#39;s alignment with MongoDB&#39;s own trajectory.</p><p>The practical implication: if you’re writing application code against Azure DocumentDB (with MongoDB compatibility) — queries, aggregation pipelines, update operations, indexes — you are almost certainly working within the fully supported surface. The gaps live in the operational and administrative layer, not the query layer, and in that layer, they’ve been replaced by a managed service that handles those concerns for you.</p><h3>The Part We Didn’t Anticipate</h3><p>Here’s where the story gets more interesting.</p><p>The same engineering work that reduces migration risk for enterprises turned out to have a second beneficiary: agents.</p><p>Not hypothetically. Concretely.</p><p>When Azure DocumentDB behaves the way developers, frameworks, and tools already expect — when the MongoDB query surface just <em>works</em> — a downstream set of things gets easier without any additional work:</p><ul><li><strong>Agent toolkits don’t need special-case database logic</strong></li><li><strong>Skills can assume familiar MongoDB query patterns</strong></li><li><strong>Copilots generate useful code</strong></li><li><strong>Agentic workflows iterate faster</strong></li></ul><h3>Why this matters more for Agents than it did for developers</h3><p>Developer-facing compatibility gaps are not ideal but recoverable. A developer hits an unsupported operator, reads the error, finds the workaround, moves on. The cost is measured in hours or days.</p><p>Agent-facing compatibility gaps are structural. An agent that assumes $facet works and discovers mid-workflow that it doesn&#39;t, doesn&#39;t gracefully pivot. The skill breaks. The workflow stalls. Someone has to debug it, understand why, and fix the skill — at which point you&#39;ve lost the velocity advantage that agents are supposed to provide in the first place.</p><p>This is why the agent velocity case for compatibility is actually stronger than the migration case, even though migration is where the investment originated. With enterprise migrations, the compatibility risk is front-loaded: you find the gaps during evaluation, you account for them in the project plan, you mitigate them before go-live. It’s a one-time cost.</p><p>With agents, the compatibility risk is continuous. Every new skill, every new agentic workflow, every new copilot integration runs against the real operator surface. High compatibility means that surface is reliable, predictable, and doesn’t require per-skill gap analysis before deployment.</p><h3>What “Compatibility as a Platform Property” actually unlocks</h3><p>The question “Can I move my app?” is still a real question, and the answer for Azure DocumentDB is now yes — a resounding yes, across nearly the full operator surface. But the question that’s becoming more interesting is: “How quickly can my developers, and my agents get useful work done once they land here?”</p><p>That’s a much better place to be competing from.</p><p><em>Azure DocumentDB is a MongoDB-compatible database service, built on the </em><a href="https://github.com/documentdb/documentdb"><em>MIT licensed open-source DocumentDB project</em></a><em>.</em></p><p><em>For more Azure DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b45322326c5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[100 TB of Writes ≠ 100 TB of Work: How Azure DocumentDB addresses HBase’s write amplification]]></title>
            <link>https://medium.com/@abramees/100-tb-of-writes-100-tb-of-work-how-azure-documentdb-addresses-hbases-write-amplification-9f7b091263c2?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f7b091263c2</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 22:03:50 GMT</pubDate>
            <atom:updated>2026-06-21T22:03:50.552Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbYUkV5Iu-BopvwAgXkNoA.png" /><figcaption>Azure DocumentDB vs HBase — write amplification and the performance impact of writes at scale</figcaption></figure><p>We previously spoke about how a customer of ours saved 52% when migrating from HBase to Azure DocumentDB. That post was very focused on the financials and the TCO reductions. There was much more to that story from a technical perspective. In particular, the architecture that HBase relies on, to promise low latency writes, can have an impact on the rest of the fleet, when running at scale. This post focuses on a more technical comparison between the two databases.</p><p>Every write looks the same from the application’s point of view. Call insert, get an acknowledgment, move on. What happens below that acknowledgment, is where two very different database philosophies diverge.</p><p>For the same customer who moved a 100 TB workload off HBase and onto Azure DocumentDB — ingestion speed was never a complaint. HBase took writes about as fast as anything in the Hadoop ecosystem. The complaint was what happened after. The performance graph looked less like a flat line and more like a sine wave. Some hours were fine. Others, for no reason the application team could point to, were not.</p><p>The reason traces back to a single mechanism: compaction.</p><h3>What actually happens when HBase takes a write</h3><p>HBase is built on a Log-Structured Merge (LSM) tree, a design that optimizes the write path by deferring organization to later. A single application-triggered write sets off a chain of background work:</p><ul><li><strong>Flush</strong> — the in-memory MemStore fills up and gets written to disk as a new HFile. That’s the first physical write.</li><li><strong>Minor compaction</strong> — as HFiles accumulate, HBase periodically merges a handful of them into a larger file to keep read performance from degrading. That’s anywhere from one to three more writes.</li><li><strong>Major compaction</strong> — on a schedule, HBase rewrites <em>every</em> HFile in a region into a single file, dropping deleted and expired cells along the way. That’s another full rewrite of the data.</li></ul><p>Add it up, and a single logical write can cost <strong>3 to 10 I/O operations</strong> by the time HBase finishes organizing itself. The data isn’t written once — it’s written, then rewritten, then rewritten again, each pass trading disk and network I/O for better read performance down the line.</p><p>That trade-off is reasonable in isolation. The problem is that compaction doesn’t politely wait for a quiet moment. It runs continuously, competing with live application traffic for the same disks and the same I/O budget. When small, this is background noise. At 100 TB, compaction stops being a background task and becomes one of the primary consumers of I/O on the cluster.</p><p>It also explains a sizing detail that’s easy to miss until you’ve been burned by it: HBase capacity planning typically has to account for a compaction overhead buffer on top of raw data and replication. That buffer isn’t padding. It’s the structural cost of a write-fast, organize-later design.</p><h3>How this can impact reads</h3><p>Reads pay for this too, not just writes.</p><p>Picture a region server handling steady read traffic for a customer-facing dashboard. A major compaction kicks off on a region holding recently active data. For the next several minutes, every read against that region competes directly with the compaction job for the same disk I/O.</p><p>Worse, as the compaction process writes out its merged HFile, the block cache entries that reads were relying on get invalidated. The data they pointed to no longer lives where the cache thinks it does. Requests that used to hit cache now miss and go to disk instead. A dashboard query that normally returns in single-digit milliseconds can stretch into the hundreds, not because anything about the query changed, but because the region server is busy rewriting files in the background.</p><p>This is well-documented enough that platform teams are routinely told to schedule major compactions for off-peak hours specifically to avoid degrading reads during business hours. This in itself is an admission that the read path isn’t insulated from what compaction is doing.</p><h3>Enter Azure DocumentDB: A different write path</h3><p>Azure DocumentDB handles the same logical write very differently — not because of a tuning flag, but because of how its storage engine is architected. There’s no MemStore, no HFiles, and no background process competing with application traffic to consolidate and rewrite data after the fact.</p><p>A write is persisted once. A write-ahead log captures it for crash recovery and durability, adding a modest 10%–20% overhead. There’s no flush-then-compact cycle running in parallel, because there’s nothing left over that needs cleaning up later. The data is structured correctly the first time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*lEw4Ov834eRkP1HRonduqw.png" /></figure><p>That gap is the whole story. It’s not that Azure DocumentDB is faster or better in some abstract sense. It’s that Azure DocumentDB doesn’t generate the multiplier. There’s no background rewrite cycle stealing I/O from the application, which means there’s no sine wave to debug, no compaction window to schedule, and no mysterious slowdown that only shows up under sustained write pressure.</p><p>Run that same dashboard scenario on Azure DocumentDB. There’s no equivalent dip to explain. A sustained burst of writes doesn’t trigger a background process that rewrites files, invalidates cache entries, or competes with reads for disk I/O. No such process exists.</p><p>The pages a read touches are the same pages they’d touch whether the system is idle or absorbing heavy write traffic, and the cache stays valid because nothing is swapping the underlying files out from under it. The dashboard query that took 4 milliseconds during a quiet hour takes roughly 4 milliseconds during a write-heavy one, too. Not because Azure DocumentDB tries harder to protect reads, but because writes and reads were never put in competition with each other in the first place.</p><h3>Why this matters more than it used to</h3><p>For a long time, “write fast now, clean up later” was a defensible trade-off. Batch jobs ran overnight. Compaction windows could be scheduled for off-peak hours. Inconsistent latency during a 2 a.m. major compaction wasn’t anyone’s problem.</p><p>That assumption doesn’t hold anymore. AI-driven applications write continuously — embeddings, agent state, event streams, feature updates — and they don’t have a quiet 2 a.m. window where compaction can run undisturbed. An application iterating rapidly on agentic workflows needs the same I/O profile at 9 a.m. that it has at 9 p.m. The platform underneath it has to deliver that without asking the team to over-provision compute just to absorb a self-inflicted I/O spike.</p><p>More than the agents themselves, businesses are global. Their entire customer base doesn’t sleep at the same time. While one set is falling asleep, another wakes up. All are just as important and they all deserve the same performance characteristics.</p><p>That’s really the dividing line between the two philosophies. HBase asks you to plan around compaction: pad your capacity, schedule your major compactions, and budget for the I/O it consumes as your data grows. Azure DocumentDB removes the question by never creating the multiplier in the first place — a write costs roughly what a write should cost, whether your dataset is 1 TB or 100 TB.</p><p>100 TB of data moving through a database isn’t 100 TB of work for the storage layer. How much <em>extra</em> work it actually is — 1.1x or 10x — depends entirely on what the write path does after the application stops paying attention.</p><p><em>Azure DocumentDB is a MongoDB-compatible database service, built on the </em><a href="https://github.com/documentdb/documentdb"><em>MIT licensed open-source DocumentDB project</em></a><em>.</em></p><p><em>For more Azure DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f7b091263c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-Cloud isn’t a buzzword anymore. It’s two shell scripts with DocumentDB]]></title>
            <link>https://medium.com/@abramees/multi-cloud-isnt-a-buzzword-anymore-it-s-two-shell-scripts-with-documentdb-dbf8a7db1102?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbf8a7db1102</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 18:50:12 GMT</pubDate>
            <atom:updated>2026-06-21T18:50:12.027Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80TyOS-TRTuEYLRwDllRQA.jpeg" /><figcaption>Achieving multi-cloud functionality, with simplicity, powered by open source DocumentDB</figcaption></figure><h3>The conversations keep moving down the stack</h3><p>For us on the Azure DocumentDB team, every customer conversation starts the same way: at the top, with a business problem, before it drills all the way down to the database. What’s interesting is watching <em>what</em> that business problem has been, era over era.</p><p>First, it was the cloud itself. Enterprises were migrating off self-managed infrastructure, pursuing infinite scale, in an attempt to stop babysitting hardware and taking time away from focusing on their immediate business problems. In many ways, this wave is still going on.</p><p>Then, once teams had a secure foothold in a single cloud, the bar moved. Reliability and security stopped being checkboxes and became the conversation. Uptime SLAs, encryption at rest and in transit and audit trails. The database had to earn trust, not just store documents.</p><p>More recently, it’s been vector search. Everyone wants an integrated vector database experience sitting next to their operational data, because nobody wants to stitch together a second system just to power retrieval for an LLM.</p><p>But underneath all three of those waves, a quieter, steadier request has been building: hybrid and multi-cloud deployment. Sometimes it’s a data governance regulation that says certain data can’t leave a certain jurisdiction. Sometimes it’s selective geo-fencing for a specific customer segment. Sometimes it’s simply resilience, not wanting your entire data layer to depend on a single provider’s control plane having a good day. Whatever the driver, this ask isn’t a one-off anymore. It’s a recurring line item in nearly every architecture conversation we have.</p><h3>Why multi-cloud databases are usually a nightmare</h3><p>Here’s the problem. Multi-cloud database deployments are typically painful by design. Most managed database services replicate data using proprietary engines that only understand one cloud’s networking, one cloud’s storage layer and from a resiliency standpoint — one cloud’s failover primitives. The moment you want a standby in a different cloud provider, you’re either out of luck, or, you’re hand-rolling your own replication, your own DR playbook, and usually a consulting engagement to go with it.</p><p>Open-source changes that equation, because the database stops being tied to any one cloud’s plumbing. <a href="https://github.com/documentdb/documentdb">DocumentDB</a> is a MongoDB-compatible, MIT-licensed document database built on PostgreSQL. Because it’s fully open-source PostgreSQL underneath (and not a custom fork), it inherits decades of battle-tested, vendor-neutral replication mechanics rather than something specific to a single managed service.</p><h3>How the DocumentDB K8s operator layers resilience</h3><p>The <a href="https://github.com/documentdb/documentdb-kubernetes-operator">DocumentDB Kubernetes Operator</a> takes that foundation and builds high availability in layers, each one addressing a wider failure domain than the last:</p><ul><li><strong>Local HA</strong> — multiple instances inside a single Kubernetes cluster, with instant, automatic failover if a pod or node goes down. You can also spread replicas across availability zones to protect against a zone outage.</li><li><strong>Multi-region HA</strong> — replicas spread across Azure regions, coordinated using Azure Kubernetes Fleet Manager.</li><li><strong>Multi-cloud HA</strong> — replicas spread across providers entirely — Azure, AWS, GCP — coordinated using Istio as the connective tissue between clusters.</li></ul><p>The first layer is automatic by design. Pod and node failures are common enough that you want the system reacting in seconds, with no human in the loop.</p><p>The two broader layers are deliberately different.</p><p>Both rely on physical WAL replication, and both use a manual failover step (kubectl documentdb promote) rather than automatic promotion. That&#39;s not a limitation, it&#39;s a design choice — when the failure domain is an entire region or an entire cloud provider, you want a human confirming the decision, not a controller reacting to a transient network blip and promoting a replica three time zones away.</p><p>The layers are also composable. A production deployment isn’t forced to pick one. You can run local HA inside each region, regional HA inside each cloud, and multi-cloud HA spanning all of it.</p><h3>From zero to three clouds, with just two scripts</h3><p>This is where it stops being theoretical. Inside the operator repo, there’s a documentdb-playground folder, and inside that, a <a href="https://github.com/documentdb/documentdb-kubernetes-operator/tree/main/documentdb-playground/multi-cloud-deployment">multi-cloud-deployment</a> example that stands the whole thing up using Azure Kubernetes Fleet and Istio.</p><p>The honest pitch is that it’s just two deploy.sh scripts. They handle the parts that are genuinely tedious to get right by hand — provisioning the clusters, wiring up the Istio mesh across cloud boundaries, getting certificates and trust established between environments that don&#39;t naturally know about each other. That&#39;s the heavy lifting, and it&#39;s already done for you.</p><p>What’s actually left in your hands is YAML. Instance counts, storage sizing, which regions or providers host which replica — the configuration choices that should be yours to make, without needing to understand the mesh networking required to make cross-cloud traffic work in the first place.</p><p>Here’s what that actually looks like end to end. The first script provisions everything.</p><pre>./deploy.sh</pre><p>It’s really that simple and here’s what it does if you open it up.</p><p>That one command stands up an AKS Fleet hub in East US 2, an AKS member cluster, a GKE cluster in us-central1-a, and an EKS cluster in us-west-2 — joins the GKE and EKS clusters to the Fleet, installs cert-manager everywhere, and wires up the Istio multi-cluster mesh with a shared root CA and east-west gateways so the three clusters can actually talk to each other.</p><p>By the time it finishes, you’ve got working kubectl contexts for hub, azure-documentdb, gcp-documentdb, and aws-documentdb, and the DocumentDB operator is already installed and propagated to all three.</p><p>The second script deploys the database itself:</p><pre>./deploy-documentdb.sh</pre><p>This picks a primary cluster (EKS by default), deploys DocumentDB with Istio-based cross-cloud replication, and if you’ve enabled it, it creates an Azure DNS zone with an SRV record so you can connect with a single mongodb+srv:// URI regardless of which cloud is currently primary. A quick status check across all three:</p><pre>for c in azure-documentdb gcp-documentdb aws-documentdb; do<br>  echo &quot;=== $c ===&quot;<br>  kubectl --context $c get documentdb,pods -n documentdb-preview-ns<br>done</pre><p>And when you actually want to fail over to a different cloud — say, EKS to GKE — it’s one command run against the hub:</p><pre>kubectl documentdb promote \<br>  --documentdb documentdb-preview \<br>  --namespace documentdb-preview-ns \<br>  --hub-context hub \<br>  --target-cluster gcp-documentdb \<br>  --cluster-context gcp-documentdb</pre><p>That’s the entire mental model: two scripts to go from nothing to three clouds running DocumentDB with cross-cloud replication, and one command whenever you need to actually move primary traffic.</p><h3>The point of open source is portability</h3><p>The reason this is possible at all comes back to the licensing choice. Because DocumentDB is MIT-licensed and built on standard PostgreSQL replication, the same engine that runs in your dev environment can run identically on Azure, AWS, GCP, or on-prem. There’s no proprietary cross-region replication protocol locking you to one provider’s roadmap — just Kubernetes, CNPG, and Istio, all of which work the same way regardless of whose logo is on the cluster.</p><p>That’s the real shift happening underneath all the customer conversations. Hybrid and multi-cloud aren’t requests to work around a vendor. They’re a baseline expectation now. And the architecture to support it shouldn’t require a team of consultants to stand up. It should require two shell scripts and an afternoon of YAML.</p><p>If you want to see it for yourself, clone the <a href="https://github.com/documentdb/documentdb-kubernetes-operator">operator repo</a>, head into documentdb-playground/multi-cloud-deployment, and run it. It&#39;s the fastest way to go from &quot;we need a multi-cloud story&quot; to actually having one.</p><p>To take a look at a video showcasing the playground in action with Azure DocumentDB, check out this YouTube video: <a href="https://www.youtube.com/watch?v=2wp9MEAyH4c">Running Open Source DocumentDB Across Three Clouds with Zero‑Data‑Loss Failover</a></p><p>To take a look at the contents of the scripts in the playground, check out <a href="https://www.youtube.com/watch?v=ftMBcT9bnNs">this video</a> detailing the scripts.</p><p><em>DocumentDB is an MIT-licensed, MongoDB-compatible open-source database built on PostgreSQL, and also part of The Linux Foundation. Stay up to speed with DocumentDB through the </em><a href="https://documentdb.io/"><em>project’s w</em>ebsite</a><em> or join in on the conversation on </em><a href="https://discord.gg/documentdb"><em>Discord</em></a><em>.</em></p><p><em>For more DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbf8a7db1102" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Azure DocumentDB solves Apache Cassandra’s ad hoc joins challenge]]></title>
            <link>https://medium.com/@abramees/how-azure-documentdb-solves-apache-cassandras-ad-hoc-joins-challenge-f0a7aae9722d?source=rss-f30444bacbad------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0a7aae9722d</guid>
            <dc:creator><![CDATA[Abinav Rameesh]]></dc:creator>
            <pubDate>Sun, 14 Jun 2026 16:20:22 GMT</pubDate>
            <atom:updated>2026-06-14T16:20:22.436Z</atom:updated>
            <content:encoded><![CDATA[<p>The moment your Cassandra schema didn’t anticipate the query pattern is where the real challenge begins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DI1cA83Rda-NBSPSqYpO1g.png" /><figcaption>Azure DocumentDB, despite being a NoSQL offering does not require complex data modeling upfront</figcaption></figure><p>A recent customer conversation crystallized something we’ve seen play out many times with teams running Apache Cassandra, particularly at scale.</p><p>The requirement on the table sounded very simple.</p><p><em>Given an order ID, return the order details and the customer’s shipping address.</em></p><p>Two pieces of data. One logical request.</p><p>Typically, this is a quick and simple query. However, depending on the data model that was chosen to match the originally optimized queries, these could be two disconnected pieces of data. In Cassandra, if you didn’t design your schema specifically for this access pattern from the very beginning, it becomes either another data duplication scenario or more likely, an exercise in application-side orchestration.</p><h3>How Cassandra’s data model works</h3><p>Cassandra’s design philosophy is a deliberate trade-off. It is built for write-heavy, horizontally scalable workloads where most, if not all queries are known in advance, and the data model is shaped to serve exactly those queries. This data model includes not just sharding strategies and secondary indexes but also data duplication to match query patterns. This works exceptionally well when access patterns are stable and pre-determined.</p><p>There are of course constraints that show up in a real-world scenario and the tradeoffs are inherent. Cassandra has no native join mechanism, no cross-table query functionality, and no cross keyspace query capabilities.<strong> </strong>There is no JOIN, no $lookup, and concept of subqueries. Each CQL statement operates strictly against a single table.</p><p>This is a feature. It’s a consequence of how Cassandra achieves its performance guarantees. Data is co-located by partition key, and a query that spans partitions or tables would require coordination across nodes, which defeats the architecture’s core low latency, high throughput promise.</p><p>The problem surfaces the moment an ad hoc requirement arrives that the original schema didn’t account for.</p><h3>The Multi-Step Cassandra query in practice</h3><p>For the order-plus-shipping-address use case, here’s what actually happens in Cassandra when the schema wasn’t pre-optimized for this join:</p><p><strong>Step 1: </strong>Fetch the order record.</p><pre>SELECT order_id, customer_id, items, total, created_at<br>FROM orders<br>WHERE order_id = ?;</pre><p><strong>Step 2: </strong>Extract the customer_id from the result set in application code.</p><p><strong>Step 3: </strong>Issue a second query using the extracted customer_id value.</p><pre>SELECT customer_id, name, shipping_address<br>FROM customers<br>WHERE customer_id = ?;</pre><p><strong>Step 4: </strong>Stitch the two result sets together in application code to assemble<strong> </strong>the user facing response.</p><p>That’s four distinct steps consisting of two database roundtrips and two application-layer transformations. The query was simple, but the effort needed to answer what is logically a single question was more than necessary. Each round-trip adds latency. Each stitching step is application logic that needs to be written, tested, and maintained. At scale, adding a new query can become challenging.</p><h3>What happens at Scale</h3><p>Teams that have lived in Cassandra long enough develop a standard set of responses to this problem, and none of them are free.</p><p><strong>Data duplication.</strong> The shipping address gets written into the orders table directly, alongside the order data. Now the query is a single table query. But every time a customer updates their address, every historical order record potentially needs updating too. Or you accept that historical records hold stale data. In some cases, there is a duplicate orders table, let’s call it orders_with_shipping_address that duplicates the orders data but also includes the shipping address. Write amplification increases, and eventual consistency becomes a correctness concern.</p><p><strong>Materialized views.</strong> Cassandra’s materialized views allow you to maintain an alternative representation of a table’s data for different query patterns. But here too, they add write overhead, they have their own failure modes, consistency lag, and they only work within the boundaries of a single base table. Users can of course create self-driven “views” as well.</p><p><strong>Denormalization as a design principle.</strong> Experienced Cassandra architects will tell you to model your data around your queries, and not around your domain. That’s sound advice within the Cassandra paradigm. But it means your schema becomes tightly coupled to a fixed set of access patterns. When requirements evolve, and they always do, the schema has to evolve too, requiring new tables, new materialized views, and data backfills.</p><p>The cumulative effect leads to more writes, more storage, more operational surface area, and a codebase carrying complex query orchestration logic that belongs in the database layer.</p><h3>The same query on Azure DocumentDB</h3><p>Azure DocumentDB (with MongoDB compatibility), built on the <a href="https://github.com/documentdb/documentdb">open-source DocumentDB engine</a>, approaches this differently. The MongoDB operator surface area gives you two clean options for the same requirement.</p><p><strong>Option 1: Embed the address in the order document</strong></p><p>If the shipping address at the time of the order is what matters (which is usually true for order history), embed it directly.</p><pre>{<br>  &quot;_id&quot;: &quot;order_12345&quot;,<br>  &quot;customer_id&quot;: &quot;cust_67890&quot;,<br>  &quot;items&quot;: [...],<br>  &quot;total&quot;: 149.99,<br>  &quot;shipping_address&quot;: {<br>    &quot;street&quot;: &quot;123 Main St&quot;,<br>    &quot;city&quot;: &quot;Seattle&quot;,<br>    &quot;state&quot;: &quot;WA&quot;,<br>    &quot;zip&quot;: &quot;98101&quot;<br>  }<br>}</pre><p>Single document. Single read. No application-side stitching. The address is a point-in-time snapshot, which is typically exactly what you want for an order record, the address the order was actually shipped to, regardless of what the customer updates later.</p><p>Theoretically, this approach is in some ways similar to the Cassandra approach of planning ahead for this query. However, even if you choose to embed later, this can be applied to just new documents going forward while older documents are TTL’d over time.</p><p>Alternatively, the single document can be updated during query time. An initial latency hit is taken to update the document and embed the shipping_address. Future reads use the embedded portion in the result set.</p><p><strong>Option 2: Use </strong><strong>$lookup to join across collections</strong></p><p>When the data lives in separate collections and you want the current canonical value rather than a snapshot, the aggregation pipeline handles the join server-side.</p><pre>db.orders.aggregate([<br>  { $match: { _id: &quot;order_12345&quot; } },<br>  {<br>    $lookup: {<br>      from: &quot;customers&quot;,<br>      localField: &quot;customer_id&quot;,<br>      foreignField: &quot;_id&quot;,<br>      as: &quot;customer&quot;<br>    }<br>  },<br>  {<br>    $project: {<br>      order_id: &quot;$_id&quot;,<br>      items: 1,<br>      total: 1,<br>      shipping_address: { $arrayElemAt: [&quot;$customer.shipping_address&quot;, 0] }<br>    }<br>  }<br>])</pre><p>In this scenario, when the new query arrived later in the application’s journey, the existing document was not updated to include an embedded shipping_address. Data from disparate collections didn’t need to be stitched together either. A simple $lookup query joins data from two collections on the database server.</p><p>No planning ahead. No data duplication and no client-side stitching.</p><h3>The broader pattern</h3><p>The Cassandra scenario isn’t unique. It appears anywhere the access pattern wasn’t fully anticipated during schema design.</p><p>In each case, the Cassandra response is the same: duplicate, create views, or orchestrate multiple queries in the application. The Azure DocumentDB response is simpler. Embed objects where a snapshot is appropriate or use the aggregation pipeline for an ad hoc query.</p><p>The difference is where the complexity lives. In Cassandra, it creeps into the application layer and the operational model. In Azure DocumentDB, it stays in the database query, where it belongs.</p><h3>One more thing: The Cassandra Migrator</h3><p>If you’re evaluating a move from Cassandra to Azure DocumentDB, our <a href="https://github.com/fonsecamar/azure-documentdb-schema-migrator">recently published Cassandra-to-AzureDocumentDB migrator</a> doesn’t just handle CQL conversion. It analyses multi-step query patterns and optimizes them into single operations, turning the four-step orchestration described above into the single $lookup pipeline automatically.</p><p>We’d love some feedback!</p><p><em>Azure DocumentDB is a MongoDB-compatible database service, built on the </em><a href="https://github.com/documentdb/documentdb"><em>MIT licensed open-source DocumentDB project</em></a><em>.</em></p><p><em>For more Azure DocumentDB stories, </em><a href="https://www.linkedin.com/in/abinavrameesh/"><em>follow Abinav Rameesh on LinkedIn</em></a><em>.</em></p><p><em>And if you’re exploring Azure DocumentDB for your team, follow the </em><a href="https://www.linkedin.com/company/azuredocumentdb"><em>Azure DocumentDB page</em></a><em> for product updates and community content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0a7aae9722d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>