Optimizing bandwidth in the Azure Cosmos DB .NET SDK

Optimizing bandwidth in the Azure Cosmos DB .NET SDK

Learn how to optimize the network bandwidth usage in your application by taking advantage of EnableContentResponseOnWrite to avoid getting unneeded content as part of your operations with the Azure Cosmos DB .NET SDK.

When we create, update, and even delete an item in our Azure Cosmos containers, the actual body of the item is always included as part of the service response along with other useful information in the headers, like the request charge. This body content consumes bandwidth, and if we think about it, we are using almost the same bandwidth to send the operation than to receive its response. When the volume of operations it high, this accounts for quite a big chunk of data over the wire, which we might not be using at all. Wouldn’t it be great if there was a way to tell the service not to include it in the response?

What is included in a normal operation response?

Write operations include create, replace, upsert, and delete item operations. In most of them (except delete), you send a payload with the item content you want to write. And in all of them, when the operation is completed successfully on the Azure Cosmos backend, you receive a response that contains the original item content you sent, a status code indicating the success, and a set of known headers (request charge, session token, etc.). The information in the headers, which tends to be more important in these operations, often uses the smallest bandwidth.

Do we really need the response content?

Most of the time, we don’t really do much with the response content, because it’s what we just defined as input when we made the operation call or we plainly don’t need it (do we really need the content of the item we just deleted?). Let’s take a look at two code examples to make it more clear.

core (sql) api tips and tricks

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Introduction to Structured Query Language SQL pdf

SQL stands for Structured Query Language. SQL is a scripting language expected to store, control, and inquiry information put away in social databases. The main manifestation of SQL showed up in 1974, when a gathering in IBM built up the principal model of a social database. The primary business social database was discharged by Relational Software later turning out to be Oracle.

jQuery Ajax CRUD in ASP.NET Core MVC with Modal Popup

In this article, we’ll discuss how to use jQuery Ajax for ASP.NET Core MVC CRUD Operations using Bootstrap Modal. With jQuery Ajax, we can make HTTP request to controller action methods without reloading the entire page, like a single page application.

Top 10 API Security Threats Every API Team Should Know

Learn what are the most important API security threats engineering leaders should be aware of and steps you can take to prevent them

Public ASX100 APIs: The Essential List

The method used for this initial research was to obtain a list of the ASX100 (as of 18 September 2020). Then work through each company looking at the following

3 Tips to Write SQL Queries That Are Easier to Read and Modify

3 practice tips to write SQL queries which are easier to read and modify even after six month and one year. Use this tips to write professional quality SQL.There is no doubt that writing code is more art than science and every coder cannot write beautiful code which is both readable and maintainable, even with the experience.