What is New in Azure Cosmos DB Javascript SDK v4 (GA)

What is New in Azure Cosmos DB Javascript SDK v4 (GA)

I'm Sajee

www.sajeetharan.dev

const profile = {
  role: "Principal Product Manager",
  experience: { total: 13, dev: 9, pm: 4 },
  passion: ["developer tools", "DX", "databases","Web"],
  community: {
    stackOverflow: { countryRank: 1, globalTop10: ["Azure", "Javascript", "AzureCosmosDB"] },
    titles: ["Google Developer Expert", "Microsoft MVP"],
    contributions: ["open-source", "conference speaking"]
  },
  connect: () => console.log("Interested in web or cloud? Let's talk! 🚀")
};

console.log(`🚀 ${profile.role} | ${profile.experience.total}y experience | Dev ❤️ PM`);
profile.connect();

I'm Aman Rao

const profile = {
  role: "Software Engineer",
  passion: ["developer tools", "DX", "databases","Web"],
   connect: () => console.log("Interested in Javascript/Web ? Let's talk! 🚀")
};

console.log(`🚀 ${profile.role} | ${profile.experience.total}y experience | Dev`);
profile.connect();

https://www.linkedin.com/in/aman-rao

Today's Goals

👍Explore Azure Cosmos DB JavaScript SDK

 

👍What's new with Azure Cosmos DB JS SDK V4

 

👍 Let's see in Action

 

👍Be ready to ask questions

 

 

The Developer’s Struggle  

We' all Have been there!

Slow Setup: Staring at a database that takes

forever to set up.

 

Performance Issues: Struggling with inconsistent

query performance.

 

Complex SDKs: Wrestling with SDKs that require

a PhD to understand.

Meet Your Sidekick, Azure Cosmos DB AND the JavaScript SDK

Azure Cosmos DB Javascript SDK

Fluent API Design

Advanced features

 Enhanced Developer Experience

Fully Opensource

"Build blazing-fast, planet-scale apps with familiar Node.js / Javascript experience"

  • Feedback driven development
  • OSS Development practices
  • Project management via Github
  • Fast and Async
  • Simplified syntax and async iterators
  • New samples
  • Easy setup
  • User friendly Methods
  • Highlights benefits of Typescripts
  • User centric design changes (ex. Diagnostics, Bulk API etc)

Azure Cosmos DB JS SDK powers!

Internal tools :

 

  • Azure Cosmos DB Explorer,
  • Emulator Data Explorer,
  • VS Code Extension for Azure databases

 

Community packages (OSS):  

  • Nestjs - Azure-databases
  • NOSQL studio
  • Hasura GraphQL connector
  • Cosmox

                        

                    

JavaScript SDK Evolution

basic CRUD, Support consistency levels, query metrics etc

documentdb (v1)  

multi-region support, improved performance

@azure/cosmos (v4)

azure-cosmos-js (v2)  

@azure/cosmos (v3)  

improved client constructor, simplified syntax, async iterators, Transition from callback to promises

Request diagnostics, Changefeed , AI (vector search, Full text search), new Bulk API etc

Key features of V4 (GA)

Efficient Bulk Operations   

         - Support migration scenarios, bulk ingestion

AI enhanced capabilities

         -  Hybrid search, Full text search, Vector search

Changefeed Support

          - Listen to document updates 

Client Side Encryption

          - Define a protected data encryption key and apply encryption policies directly in container operations.   

Diagnostics Support   

           - Enhanced insights into your client operations,

                    

Let's see in Action

Prerequisites ✅

  • Node.js (LTS version) installed
  • Azure Cosmos DB account (NoSQL API) / Azure Cosmos DB emulator
  • VS Code (or any code editor)

Demo walk through!

https://aka.ms/cosmos-js-v4-sample

Best Practices to Remember

 

👍Make sure to have the app in same region as azure cosmosdb account

 

👍Always use the latest version of SDK

 

👍Use single instance of Cosmos Client /Singleton

 

👍Enable diagnostic logging in case of failures/latency

Next steps

 

Build apps with latest Javascript SDK and report issues with the tag cosmos

 

We value your feedback : https://aka.ms/azurecosmos-js

 

Join the next episode in this series to learn about Best practices with Javascript SDK

 

Feedback or Questions  , reach out  cosmosdb-js-sdk@microsoft.com

What's new in azure cosmosdb js sdk

By Sajeetharan Sinnathurai

What's new in azure cosmosdb js sdk

Azure Cosmos DB javascript SDK

  • 71