- from Zero to Hero series
- from Zero to Hero series
- Episode 1
- Episode 1
@kokkisajee
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();
👨🎨 Front-End developers ?
👨💻 Back-End developers ?
🦸♂️ Something else ? something in between ?
☁️ Cloud developers ?
👍Explore Azure Cosmos DB JavaScript SDK
👍Master the fundamentals & get started
👍 Build your first app with the SDK
👍Be ready to ask questions
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.
Guranteed Performance
Flexibility && Security
Elastic scale out of
Storage & Throughput
Operational + Analytical
Fully Managed
Developer friendly
Automation
24/7 uptime
Native AI capability
Advanced features
"Build blazing-fast, planet-scale apps with familiar Node.js / Javascript experience"
Internal tools :
Community packages (OSS):
basic CRUD, Support consistency levels, query metrics etc
REST
API
Gateway
R
R
R
R
Replicas
HTTP
TCP
https://aka.ms/SDK-Connectivity-modes
Flexible CRUD Operations
- Works seamlessly in Node.js and browser environments
Efficient Bulk Operations
- Support migration scenarios, bulk ingestion
Changefeed Support
- Listen to document updates
Advanced Security
- Supports authentication via MI, RBAC
Seamless Integrations
- Works with Azure functions, Logic apps, other frameworks
Diagnostics Support
- Enhanced insights into your client operations,
1️⃣ Install the SDK:
npm install @azure/cosmos
2️⃣ Initialize Cosmos Client:
const { CosmosClient } = require("@azure/cosmos");
const client = new CosmosClient("YOUR_CONNECTION_STRING");
2️⃣ Initialize Cosmos Client:
const { CosmosClient } = require("@azure/cosmos");
const client = new CosmosClient("YOUR_CONNECTION_STRING");
3️⃣ Create a Database & Container:
const { database } = await client.databases.createIfNotExists({ id: "MyDatabase" });
const { container } = await database.containers.createIfNotExists({ id: "MyContainer" });
4️⃣ Insert Data:
await container.items.create({ id: "1", name: "Azure Rocks!" });
👍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
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