Is it possible to use Scalar DB on Azure Cosmos DB in a single region zone redundancy configuration? - azure

When using Scalar DB on Azure Cosmos DB, I'm considering the use of zone redundancy configuration to increase availability.
Is it possible to use Scalar DB on Azure Cosmos DB in a single region zone redundancy configuration? The consistency level of Cosmos DB is Strong.

Scalar DB can work with multiple zones as long as zone redundancy supports Strong consistency.
However, since the implementation of Cosmos DB is totally disclosed, please check with Azure technical support to see if Strong consistency works properly with multiple zones.

Related

Why doesn't Cosmos DB multiple write regions guarantee write availability during a region outage?

Cosmos DB documentation (https://learn.microsoft.com/en-us/azure/cosmos-db/high-availability#what-to-expect-during-a-cosmos-db-region-outage) says that "Given the internal Azure Cosmos DB architecture, using multiple write regions doesn't guarantee write availability during a region outage. The best configuration to achieve high availability during a region outage is single write region with service-managed failover."
Does that mean multi-region writes is just for distributing workloads with limited availability? What is the internal Azure Cosmos DB architecture and where can I get it?
In my understanding, if there is an outage in one region, all writes from that region should be re-directed to other region writes and seamlessly update the database. Is it correct?

Provision throughput on Database level using Table API in cosmos db

I have come across the requirement where I have to choose the API for Cosmos DB.
I have gone through with all API's like SQL,Graph, Mongo and Table. Since my current project structure is based on Table storage where I am storing IoT Device data.
In Current structure (Table storage) :
I have a separate Table for each Device with payload like below
{
Timestamp,
Parameter name,
value
}
Now If I plan to use Cosmos DB then I can see that I have to Provision RU/throughput against each table which I think going to be big cost. I have not found any way to assign RU on database level so that my allocated RU can be shared across all tables.
Please let me know in case we have something here.... or is it the limitation i can treat for CosmosDB with Table API?
As far as I can see SQL API and consider my use case I can create a single data base and then multiple collection (with the name of Table) and then I have both option for RU provision like on Database as well as on Device level which give me more control on cost.
You can set the throughput on the account level.
You can optionally provision throughput at the account level to be shared by all tables in this account, to reduce your bill. These settings can be changed ONLY when you don't have any tables in the account. Note, throughput provisioned at the account level is billed for, whether you have tables created or not. The estimate below is approximate and does not include any discounts you may be entitled to.
Azure Cosmos DB pricing
The throughput configured on the database is shared across all the containers of the database. You can choose to explicitly exclude certain containers from database provisioning and instead provision throughput for those containers at container level.
A Cosmos DB database maps to the following: a database while using SQL or MongoDB APIs, a keyspace while using Cassandra API or a database account while using Gremlin or Table storage APIs.
You can embed Cerebrata into the situation where the tools allow you to assign any number of throughput values post assigning the throughput type (fixed, auto-scale, or no throughput)
Disclaimer: It’s purely based on my experience

For Azure Cosmos DB, is it possible to change from single region write to multi region write?

As Cosmos DB cost extra for multi-region write, is it possible to start with single region write and upgrade to multi-region write at a later stage or will that require a database migration?
From the pricing information it looks like the multi-region write pricing kicks in even if you don't have any geo redundancy configured. So it looks like you either have to go with a high cost from the start, or choose to pay the price through a migration at a later stage. Is this a correct observation?
Multi-region write functionality can be enable after a single region account has been created. This can be done via the Azure Portal or via Powershell: Set up Azure Cosmos DB global distribution using the SQL API
This applies to the SQL(Core) API.
Powershell example: Replicate an Azure Cosmos DB database account in multiple regions and configure failover priorities using PowerShell

Azure Stream Analytics Job degrading while pushing data to cosmos DB

I Have data getting pushed from Azure IoT Hub -> Stream Analytics -> CosmosDB
I had 1 simulated device and my cosmos DB collection was of 1000 RU/s working fine .
now i have made it 10 simulated devices and my Cosmos DB collection scaled to 15000 RU/s still my stream analytics getting degraded .
Is there i need to increase number of parallel connections to collection ?
can we make it more optimal As Azure pricing of Cosmos DB , Depend on throughput and RU
Can we make it more optimal as Azure pricing of Cosmos DB, depend on
throughput and RUs?
I just want to share some thoughts with you about improving write performance of Cosmos db here.
1.Consistency Level
Based on the document:
Depending on what levels of read consistency your scenario needs
against read and write latency, you can choose a consistency level on
your database account.
You could try to set Consistency Level as Eventually. Details please refer to here.
2.Indexing:
Based on the document:
by default, Azure Cosmos DB enables synchronous indexing on each CRUD
operation to your collection. This is another useful option to control
the write/read performance in Azure Cosmos DB.
Please try to set index lazy. Also, remove useless index.
3.Partition:
Based on the document:
Azure Cosmos DB unlimited are the recommended approach for
partitioning your data, as Azure Cosmos DB automatically scales
partitions based on your workload. When writing to unlimited
containers, Stream Analytics uses as many parallel writers as previous
query step or input partitioning scheme.
Please partition your collection and pass the partition key in output to improve write performance.

What is the maximum number of collections per SQL API database in CosmosDB?

We are considering partitioning our data through multiple collections, or creating a separate collection per key.
The key range is in tens of thousands, less than 100k. My concern here is the collections limit per each SQL (DocumentDB) database.
According to Azure Cosmos DB limits, it seems that there is no limit about the count of collection.
If you have any questions about the scale Azure Cosmos DB provides, you could send email to askcosmosdb#microsoft.com.
Azure Cosmos DB is a global scale database in which throughput and storage can be scaled to handle whatever your application requires.
But I don't recommand that you create so huge number of collections, because collections are billing entities. For more information, you could refer to Azure cosmos FAQ.
Collections are also the billing entities for Azure Cosmos DB. Each collection is billed hourly, based on the provisioned throughput and used storage space

Resources