Skip to content

Commit 6298ed0

Browse files
Merge pull request #210281 from gahl-levy/compression-savings-doc
Write new doc
2 parents 2ce96a8 + 41f32c2 commit 6298ed0

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

articles/cosmos-db/mongodb/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@
413413
href: diagnostic-queries-mongodb.md
414414
- name: Prevent rate-limiting errors
415415
href: prevent-rate-limiting-errors.md
416+
- name: Optimize query and storage costs when upgrading
417+
href: compression-cost-savings.md
416418
- name: Analytics and BI with Azure Synapse Link
417419
items:
418420
- name: Configure Azure Synapse Link
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Improve performance and optimize costs when upgrading to Azure Cosmos DB API for MongoDB 4.0+
3+
description: Learn how upgrading your API for MongoDB account to versions 4.0+ saves you money on queries and storage.
4+
author: gahl-levy
5+
ms.service: cosmos-db
6+
ms.topic: how-to
7+
ms.date: 09/06/2022
8+
ms.author: gahllevy
9+
---
10+
11+
# Improve performance and optimize costs when upgrading to Azure Cosmos DB API for MongoDB 4.0+
12+
[!INCLUDE[appliesto-mongodb-api](../includes/appliesto-mongodb-api.md)]
13+
14+
Azure Cosmos DB API for MongoDB introduced a new data compression algorithm in versions 4.0+ that saves up to 90% on RU and storage costs. Upgrading your database account to versions 4.0+ and following this guide will help you realize the maximum performance and cost improvements.
15+
16+
## How it works
17+
The API for MongoDB charges users based on how many [request units](../request-units.md) (RUs) are consumed for each operation. With the new compression format, a reduction in storage size and query size directly results in a reduction in RU usage, saving you money. Performance and costs are coupled in Cosmos DB.
18+
19+
When [upgrading](upgrade-mongodb-version.md) from an API for MongoDB database account versions 3.6 or 3.2 to version 4.0 or greater, all new documents (data) written to that account will be stored in the improved compression format. Older documents, written before the account was upgraded, remain fully backwards compatible, but will remain stored in the older compression format.
20+
21+
## Upgrading older documents
22+
When upgrading your database account to versions 4.0+, it's good idea to consider upgrading your older documents as well. Doing so will provide you with efficiency improvements on your older data as well as new data that gets written to the account after the upgrade. The following steps upgrade your older documents to the new compression format:
23+
24+
1. [Upgrade](upgrade-mongodb-version.md) your database account to 4.0 or higher. Any new data that's written to any collection in the account will be written in the new format. All formats are backwards compatible.
25+
2. Update at least one field in each old document (from before the upgrade) to a new value or change the document in a different way- such as adding a new field. Don't rewrite the exact same document since the Cosmos DB optimizer will ignore it.
26+
3. Repeat step two for each document. When a document is updated, it will be written in the new format.
27+
28+
29+
## Next steps
30+
Learn more about upgrading and the API for MongoDB versions:
31+
* [Introduction to the API for MongoDB](mongodb-introduction.md)
32+
* [Upgrade guide](upgrade-mongodb-version.md)
33+
* [Version 4.2](feature-support-42.md)

0 commit comments

Comments
 (0)