Skip to main content

Posts

Showing posts with the label Azure

Add a New Property in Cosmos DB (Existing millions of data) Without Downtime

  Scenario You have a Cosmos DB collection with 1 million records, and you need to introduce a new property (e.g., Discount ). Your goal is to add this new field without causing downtime , meaning that both the old and new data should work for clients during the transition period. Step 1: Understand Cosmos DB is Schema-less Cosmos DB is a NoSQL database , meaning it doesn't enforce a strict schema. Each document (record) can have a different structure. This gives you flexibility in adding or modifying fields without requiring an actual schema migration, unlike relational databases. In Cosmos DB: Old records can remain as they are (without the new field). New records can be added with the new field. Your task is to handle this evolution in the application code without downtime. Step 2: Update Your Application Model (Add the New Field) You need to modify your application’s data model (e.g., C# class) to include the new field ( Discount ). public class Product { public string ...

C# : Building Serverless Applications with Azure Functions - A Step-by-Step Guide

Serverless computing has become a popular paradigm for building scalable and cost-effective applications. Azure Functions, a serverless compute service from Microsoft Azure, enables developers to build and deploy event-driven functions without managing infrastructure. In this blog post, we will guide you through the process of creating Azure Functions in C# from development to deployment. Step 1: Install Visual Studio and Azure Development Workload Ensure you have Visual Studio installed on your machine with the "Azure Development" workload. You can download Visual Studio from here . During installation, make sure to select the "Azure Development" workload. Step 2: Create a New Azure Functions Project Open Visual Studio. Click on "Create a new project." In the "Create a new project" window, search for "Azure Functions" in the search bar. Choose the "Azure Functions" template and click "Next." Enter the project name a...