Azure Cosmos DB vs Amazon ElastiCache: which fits your workload
Azure Cosmos DB is a multi-model database and Amazon ElastiCache is an in-memory cache, so the first question is which role your data plays. Choose Cosmos DB when the data is a system of record that must persist, be queried through document, key-value, graph or vector models, and possibly be written in more than one region. Microsoft's overview describes it as a fully managed NoSQL and vector database with document, vector, key-value, graph and table data models. Choose ElastiCache when the data is a fast-access layer in front of another store, such as session state or lookup results that the application can rebuild if the cache is lost. For each workload, write down where the authoritative copy lives before you compare anything else.
Beyond data role, two structural factors decide most cases. The first is the deployment model: Azure Cosmos DB is offered only as an Azure service, and Microsoft's documentation describes no self-hosted edition, so a workload that must run in your own data center or air-gapped network cannot use it. ElastiCache is an AWS managed service, while Valkey is BSD-licensed open source and can run on infrastructure you control. The second is whether writes must span regions. Microsoft pairs multi-region writes with a 99.999% availability SLA and automatic failover, but a serverless Cosmos DB account runs in a single region and cannot add regions after creation, so confirm the account type before you rely on global writes.
The last factor is what your team can operate. Cosmos DB removes much of the server management, but your team still owns partition key design, request unit (RU) throughput planning and the consistency level each workload accepts. ElastiCache removes much of the cache infrastructure work, but your team still owns key design, memory sizing, eviction behavior and what the application does when the cache is unavailable. Before you decide, have the team name the engine, the cache mode and the backup path in writing. ElastiCache backups can be exported as .rdb files to an S3 bucket in the same Region, but only for certain configurations, and node-based Memcached and clusters using data tiering are excluded, so check the export rules against your configuration before the design depends on them.
Which scenarios favor Azure Cosmos DB, and which favor ElastiCache
This table matches common scenarios to the service that fits better and states the condition under which each choice holds. Read the why column first, because most rows turn on where your application runs and where your data must live. The main takeaway is that Azure Cosmos DB fits Azure-native data and global writes, while ElastiCache fits a cache inside AWS, and neither fits a workload that must stay in your own data center.
| Scenario | Better fit | Why (the condition that holds) |
|---|---|---|
| Azure app needing globally distributed writes | Azure Cosmos DB | Holds when writes must land in several regions. Microsoft documents a 99.999% availability SLA for multi-region writes. |
| AWS app with a cache in front of an existing database | Amazon ElastiCache | Holds when the app and database run in AWS and the cache can sit in the same region. Valkey or Redis OSS handle key-value caching. |
| Vector similarity search inside an Azure app | Azure Cosmos DB | Holds when embeddings should sit next to operational records in one Azure service, using integrated vector and hybrid search. |
| Cache for an Azure-hosted app | Azure-hosted cache, unless cross-cloud costs are acceptable | Holds when the app is in Azure: ElastiCache runs on AWS, so calls cross clouds. Confirm cross-cloud latency and data transfer charges before choosing it. |
| Workload that must stay in your own data center | Neither product fits; self-host Valkey or another open-source store | Holds when data cannot leave your hardware. Cosmos DB has no self-hosted edition, and ElastiCache is an AWS-managed service. |
| Small key-value cache with variable traffic | Amazon ElastiCache Serverless for Valkey | Holds when you want usage-based billing. The AWS pricing page lists $0.084 per GB-hour stored in US East (N. Virginia), with a 100 MB minimum. |
| Local development and testing | Azure Cosmos DB emulator | Holds when developers need a local stand-in. The emulator is free for development and testing, and production runs in Azure. |
Which decision path leads to which option
The diagram starts with one question: is the data the system of record, or only a cache? A cache on AWS leads to Amazon ElastiCache, and a cache that must stay in your own data center leads to self-hosted Valkey. A system of record follows the cloud footprint. On Azure, the path asks whether writes must span regions, which leads to Azure Cosmos DB unless the data must also stay in your own data center, which leads to self-hosted FerretDB on PostgreSQL. Confirm the region setting before you choose, because a serverless Cosmos DB account runs in a single region. A system of record on AWS is not on this path, so check that case with your architects.
Path splits on data role, cloud footprint, then region and residency needs.
Azure Cosmos DB vs Amazon ElastiCache: capabilities side by side
This table compares Azure Cosmos DB and Amazon ElastiCache across category, data models, deployment, availability, backups, analytics, vector search, change feed and self-hosting. Read each row as a fit question, and where a cell names an AWS document, confirm that point with AWS before you rely on it in a review. The main takeaway is that Cosmos DB is a general-purpose operational database, while ElastiCache is an in-memory cache, so the choice often depends on whether the workload needs durable primary data.
| Capability | Azure Cosmos DB | Amazon ElastiCache |
|---|---|---|
| Primary category | Fully managed NoSQL and vector database | Managed in-memory cache service for Valkey, Redis OSS and Memcached |
| Data models and engines | Document, vector, key-value, graph and table models in one service | Valkey, Redis OSS and Memcached engines, used mainly as key/value stores |
| Deployment model | Azure-only. Provisioned, autoscale or serverless throughput billed in RUs. Serverless runs in one region. | AWS-only. Serverless or node-based deployment modes. |
| Availability and global distribution | Multi-region writes carry a 99.999% availability SLA per Microsoft Learn. | Confirm availability terms and cross-Region replication options in AWS documentation. |
| Backups | Continuous backup with point-in-time restore. | Exports .rdb files to Amazon S3 in the same Region, except node-based Memcached and data tiering clusters. |
| Analytics access | Azure Synapse Link or Fabric mirroring for analytics without ETL. | Offline processing of exported .rdb snapshots. Confirm other analytics integrations in AWS documentation. |
| Vector search | Integrated vector and hybrid similarity search using DiskANN. | Confirm vector search support for your engine and deployment in AWS documentation. |
| Change feed | Built-in change feed for downstream processing of data changes. | Confirm change notification options for your engine in AWS documentation. |
| Self-hosted option | No self-hosted edition. A local emulator exists for development and testing at no cost. | AWS-managed only. Self-hosting means running Valkey yourself, which is BSD-licensed. |
Azure Cosmos DB vs Amazon ElastiCache pricing: how each one bills
Cosmos DB bills in request units, while ElastiCache Serverless for Valkey bills stored gigabyte-hours and ECPUs, so the two invoices do not line up line by line. The ElastiCache figures below are US East (N. Virginia) list rates, and current Azure Cosmos DB rates must be confirmed on Microsoft's pricing pages before you compare totals.
Request units and throughput modes
Cosmos DB bills in request units (RUs), and the mode you choose decides how those units are charged. Provisioned throughput bills the RU/s you provision, autoscale adjusts throughput to load within limits you set, and serverless bills only for the RUs consumed plus storage. Serverless accounts run in a single Azure region and cannot add regions after creation, so check your regional and availability needs before choosing it. Measure peak and average RU consumption per operation before you pick a mode.
Serverless billing docsLifetime free tier allowance
Microsoft's documentation says the lifetime free tier provides 1000 RU/s and 25 GB of storage. That allowance can cover a development environment, a proof of concept or a small internal service, so it is worth testing against your actual query pattern. Confirm the current terms on Microsoft's pricing pages, including whether the allowance applies to the account type and region you plan to use. Do not count this allowance as a production discount, since it covers only the throughput and storage inside its limits.
Reserved Capacity commitment discount
Reserved Capacity is the commitment option on the Cosmos DB side. Microsoft's documentation says it gives up to 63% off Azure Cosmos DB prices, so the saving depends on how much steady throughput and storage you can commit to in advance. Treat 63% as an upper bound. Model the discount against the steady baseline you can commit to, and price the remaining variable load separately. Ask Microsoft which terms and meters are eligible, and ask AWS which commitment options apply to your ElastiCache mix, because this comparison does not cover them.
ElastiCache Serverless for Valkey
Amazon's ElastiCache pricing page lists ElastiCache Serverless for Valkey at $0.084 per GB-hour of data stored and $0.0023 per million ECPUs, with a 100 MB minimum. Storage and compute are metered separately, so a small cache that handles heavy request traffic is driven by ECPUs, while a large, mostly idle cache is driven by stored gigabytes. These are US East (N. Virginia) list rates, so confirm your region's rates before comparing with Azure.
ElastiCache pricing pageValkey pricing advantage
Amazon's ElastiCache pricing page states that Valkey has 33% lower pricing than other engines on Serverless and is 20% cheaper on node-based clusters. Those discounts apply to the engine choice, so the engine decision belongs in the cost model next to the billing model. Valkey is compatible with Redis OSS 7.2 and earlier, so check client libraries and commands before assuming a later Redis OSS workload moves over unchanged. Confirm both percentages on the current pricing page for your region.
Valkey websiteExtended Support premiums on Redis OSS
Amazon's pricing page charges an 80% premium on provisioned Redis OSS versions past standard support in years 1 and 2, rising to a 160% premium in year 3. For example, a cache.m5.large in US East (Ohio) goes from $0.1560 to $0.2808 per hour, then to $0.4056 per hour. These premiums are added to the base node price. Inventory each cache's engine and version now, because a move to Valkey is a separate migration project with its own testing.
What drives each bill up or down, and what running it costs in staff time
Each bill follows the unit the service meters, so measure that unit before comparing totals. On Azure Cosmos DB, the unit is the request unit (RU). Provisioned throughput bills the RU/s you provision, autoscale adjusts throughput within limits you set, and serverless bills only the RUs consumed plus storage. A workload with long quiet periods and short spikes may suit serverless or autoscale, while a steady workload may cost less on provisioned throughput, so pull several weeks of RU consumption from Azure Monitor before choosing. Check the single-region limit as well. A serverless account runs in one Azure region and cannot add regions after creation, so a later multi-region plan means a new account. Microsoft states that Reserved Capacity gives up to 63% off Azure Cosmos DB prices, so ask whether your commitment qualifies and how long it locks in.
On Amazon ElastiCache Serverless for Valkey, the meters are GB-hours of data stored and ECPUs consumed. AWS lists $0.084 per GB-hour and $0.0023 per million ECPUs, with a 100 MB minimum, in US East (N. Virginia), so your dataset size and request volume each need a figure before you estimate a month. Node-based clusters bill by node size and count for every hour they run, so a cluster sized for peak memory pays for that peak around the clock. AWS states that Valkey is 33% lower priced than other engines on Serverless and 20% cheaper on node-based clusters, which makes engine choice a cost lever. Redis OSS versions past standard support carry Extended Support charges, at an 80% premium in years 1 and 2 and a 160% premium in year 3. AWS's example takes a cache.m5.large in US East (Ohio) from $0.1560 to $0.2808, then $0.4056 per hour, so check your engine version against AWS lifecycle dates before each renewal.
Managed services move patching, failover and backup scheduling to the provider, and part of the bill pays for that work. Self-hosting Valkey moves those tasks to your team: operating system and Valkey patch cycles, failover configuration and drills, backup schedules, restore tests and capacity alarms. Valkey is compatible with Redis OSS 7.2 and earlier, so confirm that your client libraries and any newer Redis OSS features work before you commit. ElastiCache can export backups as .rdb files to an S3 bucket in the same Region for supported configurations, with the exception of node-based Memcached and clusters using data tiering, so check which of your caches qualify and how the export is run. In a quote, separate one-time items (assessment, migration, hardening, cutover testing) from recurring ones (infrastructure, support retainer, on-call coverage). Ask who operates the platform after go-live, which support hours are included, and how out-of-hours incidents are handled.
Where the data lives, how it leaves and what locks you in
Each card covers one point where data placement, export or contract terms affect a move away from Azure Cosmos DB or Amazon ElastiCache. Read them together with your own residency and recovery requirements. Contract exit terms are not covered here and must be read in the signed agreement.
Data location and serverless limits
Start by recording which Azure regions hold production data and backups today. A serverless account runs in a single Azure region and cannot add regions after creation, so a workload that later needs regional replication means a new account and a data copy. Check this against your residency commitments before choosing serverless for a system that holds regulated data. Confirm with Microsoft's current documentation which region and replication options apply to your subscription and account type.
Serverless documentationRecovery and data export paths
Azure Cosmos DB provides continuous backup with point-in-time restore, which matters for recovery planning and for any move. The change feed and Azure Synapse Link or Fabric mirroring expose data changes for downstream use, so list which of these paths your applications and analytics already rely on. Confirm whether bulk export to a self-managed store is supported for your API and data volume before you set a migration plan. Ask for the answer in writing, because it decides whether the copy step is a documented export or custom code.
Cosmos DB overviewElastiCache export to S3
ElastiCache can export backups as .rdb files to an Amazon S3 bucket in the same AWS Region, which gives you a portable copy of the dataset. Node-based Memcached clusters and clusters using data tiering cannot use this export, so check engine and cluster type before you plan around it. Serverless caches use export-serverless-cache-snapshot, and node-based clusters use the copy-snapshot CLI operation, which also seeds a new cluster or supports offline processing. Confirm that the file loads into your target Valkey version, since Valkey is compatible with Redis OSS 7.2 and earlier.
Vendor and API lock-in
Azure Cosmos DB is an Azure-only service, and its docs describe no self-hosted edition. The local emulator is meant for development and testing, so it cannot carry production workloads. ElastiCache is an AWS-managed service, and its serverless and node-based modes are tied to AWS operations and tooling. Valkey is BSD-licensed and can run outside AWS, so the engine can move even though the managed service cannot. Map which features depend on Cosmos DB SDKs or ElastiCache-specific APIs, since those dependencies keep you in place.
Valkey project siteWhat leaving involves
Leaving either service is an application project as well as a data copy. Plan application code and SDK changes first, because both services are reached through client libraries and endpoints that a self-hosted target may handle differently. Run the data copy while the source stays writable, then cut over the application in a controlled window with a documented rollback path. Test each stage in a staging copy, and confirm that the target supports your data model, persistence settings and access controls before cutover.
When a self-hosted open-source option fits better than either product
Neither product is the right answer when data must stay in your own data center or air-gapped network, when the team wants open licensing without cloud dependence, or when both Azure and AWS are unwanted. Azure Cosmos DB has no self-hosted edition. Microsoft's local emulator is meant for development and testing, so it cannot serve as a production replacement. The self-hosted route therefore depends on the role each service plays in your system, and each role maps to a different open-source platform. Confirm the role split with your architects and compliance team before you compare features.
For the ElastiCache cache role, Valkey is the open-source option to evaluate. It is BSD-licensed, backed by the Linux Foundation, and compatible with Redis OSS 7.2 and earlier. If your application uses newer Redis features, test those commands and your client library against Valkey before you commit, because compatibility is not guaranteed for them. For MongoDB-compatible document workloads, FerretDB is Apache-2.0 licensed, speaks the MongoDB 5.0+ wire protocol and stores data in PostgreSQL with the DocumentDB extension. Cosmos DB features such as the change feed and the request unit model do not carry over, so event consumers and throughput planning need redesign. Azure DocumentDB is a separate Azure service on the open-source DocumentDB engine, so check its region and residency terms before you count it as an option.
Running either option yourself moves replication, failover, backups, upgrades and monitoring onto your team. For Valkey, design primary and replica placement, failover behavior and restore tests. For FerretDB, the PostgreSQL layer needs its own replication, backup and upgrade process alongside the FerretDB service. If you need the availability Cosmos DB advertises, Microsoft's documentation states a 99.999% availability SLA for multi-region writes, so plan a second site with cross-site failover and a quorum design. Ask your team or partner to estimate the hardware, network, staff time and failover testing for that layout. Migration is a one-time project, while patching, on-call and capacity work recur for as long as you run the platform.
What a move between Cosmos DB and ElastiCache involves
A move between these services starts with knowing which data and calls the application depends on, because ElastiCache is an in-memory cache and Cosmos DB is a managed database with different behavior. The six steps below produce a tested cutover, a documented rollback path and a record of every copy that remains after the old service is retired.
Inventory data roles and API surface
The application team, with the platform team, lists every code path that reads or writes the cache or database. For each path, record the data role it serves (session store, lookup cache, derived value or system of record), the client library and the commands, operations or SDK calls it uses, and any Lua scripts, transactions, pub/sub or query features it relies on. Done when each data role has a named owner and every call is mapped to a documented access pattern, with no unexplained code paths left.
Decide whether this is a cache or data-store move
ElastiCache runs Valkey, Redis OSS or Memcached as an in-memory store, while Cosmos DB is a managed NoSQL and vector database with document, vector, key-value, graph and table models. The two are not like-for-like, so this decision shapes every later step. If a data set is only a cache and can be rebuilt from a source of truth, the work may be a cache replacement with little or no copying. If the data is authoritative, treat the move as a data-store migration with durability, consistency and backup requirements. Done when a decision record states the category of each data set and who approved it.
Plan the data copy and validation
When the source is ElastiCache, check whether your cluster type supports backup export. AWS documents .rdb export to an S3 bucket in the same Region for node-based Valkey and Redis OSS clusters and for serverless caches, but not for node-based Memcached or clusters using data tiering. The file can seed a new cluster or support offline processing, and the ElastiCache backup export documentation describes the steps. When the target is Cosmos DB, plan application dual writes during the transition, or use the change feed if Cosmos DB is the source. Confirm the copy tooling with the vendor and agree validation checks such as record counts, sampled keys or items and checksums. Done when the plan names the method, the tooling and the checks that must pass before cutover.
Change code, key design and expiry behavior
Update client libraries, connection settings, serialization and key or partition design in the application. Valkey is compatible with Redis OSS 7.2 and earlier, so confirm that your client library and command set match the version you plan to run. For Cosmos DB, map cache keys to item IDs and partition keys, and confirm how the target handles expiry, including whether it is set per item or per container, since expiry behavior often differs between the two products. Remove or replace commands that have no equivalent on the target. Done when a command-by-command mapping is signed off and the test suite passes against the target in a non-production environment.
Rehearse cutover and rollback
Run a full rehearsal in a non-production environment with data volumes and request patterns close to production. The cutover sequence should cover pausing or draining writes, applying the final delta, switching reads and writes, and watching error rates, latency and validation checks. Write the rollback plan with explicit trigger conditions, the point after which rolling back would lose writes, and how the old store stays current until the decision to retire it. Done when the rehearsal meets the thresholds agreed in advance and the rollback has been executed once successfully in the test environment.
Decommission and confirm backup retention
After the agreed observation period, stop writes to the old store, remove application connections and credentials, rotate any secrets it used, and delete the old cluster or account. Before deletion, list every backup and export that exists, including S3 exports and Cosmos DB backups, and confirm the retention window that applies to each in your account and policy. Keep only the copies your retention policy requires and delete the rest on schedule. Done when the old resources are removed and a retention record lists each remaining copy with its location and scheduled deletion.
Can Azure Cosmos DB and Amazon ElastiCache be swapped for each other?
Is Amazon ElastiCache a drop-in replacement for Azure Cosmos DB?
No. Amazon ElastiCache is an in-memory cache for Valkey, Redis OSS and Memcached, while Azure Cosmos DB is a fully managed NoSQL and vector database, so they fill different roles. A cache typically sits in front of a primary store to speed up reads and holds data that can be rebuilt from somewhere else. Cosmos DB adds document, graph and table data models, integrated vector and hybrid search, change feed, and continuous backup with point-in-time restore. Applications that run document queries, depend on those backups, or treat the store as the system of record will need code and design changes before they can move. Start with an inventory of access patterns, query types and recovery requirements, then test the candidate design with a proof of concept before committing to a swap.
Which costs less, Azure Cosmos DB or Amazon ElastiCache?
It depends on workload shape, and the published rate structures do not give a total-cost answer. Cosmos DB bills in request units: provisioned throughput charges for the RU/s you provision, autoscale adjusts that throughput, and serverless charges only for RUs consumed plus storage. Amazon's ElastiCache pricing page lists per GB-hour charges for data stored and per ECPU charges for ElastiCache Serverless, and it states that Valkey is 33% lower on Serverless and 20% cheaper on node-based clusters than other engines. The free tier, Reserved Capacity discounts of up to 63% described in Microsoft's documentation, and AWS Extended Support charges for old Redis OSS versions all change the result. Ask for a model built on your steady and peak traffic, data size, regions, backup storage and replication needs, priced from each provider's current pricing pages.
How long does it take to move from Cosmos DB to ElastiCache?
The timeline depends on the written scope, and no single duration applies to every move. The main drivers are how many data stores and access patterns are involved, how much application code must change, whether Cosmos DB queries must be redesigned as cache lookups, how data is loaded and warmed, and how the cutover and rollback are run and tested. A narrow cache use case with a clear key design is simpler to scope than a document-heavy system spread across several regions, which needs more discovery and testing. DeployOpen's engagements are fixed-scope, so scope, deliverables and timelines are agreed in writing before work starts. Ask any provider for a dated plan that lists each phase, the test gates, the rollback point and the owner of each sign-off.
What does a Cosmos DB to ElastiCache move need from our team?
Expect to supply four things before scoping can be finished. First, an inventory of every Cosmos DB account, container, data model, consuming application and access pattern, including the queries and recovery needs. Second, access to the Azure and AWS accounts in scope, with read permissions for configuration and metrics and a controlled path for changes. Third, representative test data at the volume you expect in production, with personal or regulated fields identified so they can be masked or handled under your policies. Fourth, named owners for the application, data, security and operations work, plus someone who can approve the cutover. Naming owners early matters because unresolved decisions stall the schedule, so settle them before scoping starts.
Can our own team move from Cosmos DB to ElastiCache alone?
Yes, if your team has the operations skills the move requires. A cache migration needs people who can manage cloud accounts and infrastructure as code, configure cache security and networking, build a data export and load path, set up monitoring and alerts, and run a tested rollback. Your team also owns the application changes, since that code is theirs. DeployOpen's role is whatever you agree in writing: planning, implementation, testing, documentation or handover for the parts in scope. If you bring in a partner, the scope should name each deliverable, who performs it, and what your team keeps after the work ends. Compare your team's capacity against that deliverable list before choosing between doing the work alone and buying a fixed scope.
Does DeployOpen certify compliance after a database migration?
No. DeployOpen does not issue audit reports, attestations or certifications. It prepares systems, controls and evidence for compliance assessments, such as configuration records, access controls, audit logging and backup and restore procedures, in your own infrastructure. Independent auditors and certification bodies decide whether a control meets a framework, and they issue any report. Before a migration, ask your auditor which evidence they expect for the controls in scope, including how access, encryption, logging and backup settings for the new cache will be documented. Also confirm with the auditor whether a change to the data platform affects an existing report or certification, so the scope covers every artifact they will request.
How DeployOpen helps you choose and run the option you pick
DeployOpen approaches Azure Cosmos DB vs Amazon ElastiCache by first confirming which workload you run, then planning the open-source option that fits it in your own infrastructure. The work covers planning, implementation, hardening, backups, upgrades and documentation for the platform you choose. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
How we scope
- We confirm the data model, access pattern and consistency needs before naming any open-source option.
- The written scope lists which Cosmos DB APIs, ElastiCache engines and workloads move, and which stay put.
- Deliverables, timelines and responsibilities are agreed in writing before any work starts, and quotes follow from that scope.
How we build
- We install and configure the chosen platform in your cloud account, data center or air-gapped network.
- Where the workload is a cache, we configure Valkey or Redis Open Source with memory limits, eviction and persistence to match your requirements.
- We configure access control, TLS, secrets handling and monitoring, then document the setup for your security review.
How we hand over
- Migration plans cover cutover, rollback and a parity check of your application's queries and data.
- We set up backups and confirm restores work before handover.
- Documentation covers runbooks, architecture, upgrade steps and evidence for your compliance team's own assessment.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- Upgrade planning checks Valkey's compatibility with Redis OSS 7.2 and earlier against your client libraries.
- Continuous testing can cover the application, its APIs and the cloud configuration after each change.

