azure-cosmosdb

What are storage differences between Cosmosdb sql api and Cosmosdb cassandra api

自闭症网瘾萝莉.ら 提交于 2020-07-10 07:57:30
问题 It is mentioned in most of the articles that if we are using Cosmos Db and newly creating our app we should go with Cosmos db sql api . Mongo api and cassandra api can be used when u already have your app integrated with actual mongo and cassandra and we want to migrate quickly to cosmosdb and not change the ecosystem. But when we create a new cluster of cosmosdb in azure it ask for api type. That means internally there must be some storage differences and internal engine processing

Why is cosmos db creating 5 partitions for a same partition key value?

♀尐吖头ヾ 提交于 2020-07-09 15:03:24
问题 We are using Cosmos DB SQL API and here's a collection XYZ with: Size: Unlimited Throughput: 50000 RU/s PartitionKey: Hashed We are inserting 200,000 records each of size ~2.1 KB and having same value for a partition key column. Per our knowledge all the docs with same partition key value are stored in the same logical partition, and a logical partition should not exceed 10 GB limit whether we are on fixed or unlimited sized collection. Clearly our total data is not even 0.5 GB. However, in

Is there support for paging with OData in Cosmos DB?

爱⌒轻易说出口 提交于 2020-07-03 05:21:09
问题 I can see there is support for offset/limit when accessing a Cosmos DB in Azure via the SQL API - but does OData support this yet? 回答1: UPDATE You can download my demo in github. And this article and offical document can help u. Data in My Storage account Test by postman TestDataController.cs public class TestDataController : ODataController { [EnableQuery] public IHttpActionResult Get() { CloudStorageAccount account = CloudStorageAccount.Parse("DefaultEndpointsProtocol=***x=core.windows.net"

CosmosDB $sample aggregation delivers always the same result

梦想的初衷 提交于 2020-06-28 05:30:42
问题 i'm a newbie in Mongo and Cosmos DB. I'm trying to get some random values from one collection with the following aggregation query, but it delivers repeatedly same result: db.jokes.aggregate( [ { $sample: { size: 1 } } ] ) Operation consumed 2.39 RUs { "_id" : ObjectId("5b1526501e39b24ccc50d369"), "joke" : "Giraffes are born or created when Chuck Norris uppercuts a Horse!", "language" : "en" } db.jokes.aggregate( [ { $sample: { size: 1 } } ] ) Operation consumed 2.39 RUs { "_id" : ObjectId(

Implications of using /id for the partition key in CosmosDb

眉间皱痕 提交于 2020-06-25 07:54:59
问题 In the scenario where we have 1000 entries (unique keys) entering cosmos per minute, is it safe to use /id as the partition key? In particular, there is the concept of Logical Partitions https://docs.microsoft.com/en-us/azure/cosmos-db/partition-data The graphic here scares me a little bit, showing that the logical partitions are actual entities (Ex. "city": "London"). If I have an 8 hour TTL and 1000 entries per minute, I don't necessarily want 480,000 logical partitions that cosmos needs to

Implications of using /id for the partition key in CosmosDb

不想你离开。 提交于 2020-06-25 07:54:36
问题 In the scenario where we have 1000 entries (unique keys) entering cosmos per minute, is it safe to use /id as the partition key? In particular, there is the concept of Logical Partitions https://docs.microsoft.com/en-us/azure/cosmos-db/partition-data The graphic here scares me a little bit, showing that the logical partitions are actual entities (Ex. "city": "London"). If I have an 8 hour TTL and 1000 entries per minute, I don't necessarily want 480,000 logical partitions that cosmos needs to

How to “merge” or “transform” JSON documents in Azure Cosmos DB

白昼怎懂夜的黑 提交于 2020-06-17 12:40:52
问题 I'm setting up a Chatbot with the Microsoft Bot Framework and Azure. I want to save my "UserState" in a database in order to easily analyze the user data. I managed to save my userState in form of JSON documents in Azure Cosmos DB. The problem is that each interaction with the bot creates a new "document" in a "collection" in Cosmos DB. How can I easily merge the data (data structure is consistent) and in the best case have the data in some kind of table? The tool I want to use for analyzing

How to “merge” or “transform” JSON documents in Azure Cosmos DB

爷,独闯天下 提交于 2020-06-17 12:40:29
问题 I'm setting up a Chatbot with the Microsoft Bot Framework and Azure. I want to save my "UserState" in a database in order to easily analyze the user data. I managed to save my userState in form of JSON documents in Azure Cosmos DB. The problem is that each interaction with the bot creates a new "document" in a "collection" in Cosmos DB. How can I easily merge the data (data structure is consistent) and in the best case have the data in some kind of table? The tool I want to use for analyzing

How does CosmosDb charge RUs for write operations in a multi-master enironment?

廉价感情. 提交于 2020-06-17 01:52:31
问题 Multi-Master Database with single region: SDK reports ~10 RU to perform a write operation Multi-Master Database with 5 regions: : SDK reports ~46.86 RU for the same operation (~5x to incorporate replication to all regions. Makes sense) If you have a collection provisioned at 10k RU, does cosmos provision 10k RU for every region? The microsoft docs would suggest so but then the SDK reports all region cost when writing to the local region as above which seems a bit odd / confusing? Additionally

How upload file to blob storage and reference it from cosmosdb document in attachment

我怕爱的太早我们不能终老 提交于 2020-06-13 09:41:41
问题 I'm new to CosmosDb and azure blob storage, as a requirement I need to reference a file uploaded to azure blob storage from a document in CosmosDb and use it in the attachment section to save the metadata. I know the json metadata stucture should be like this: { "id":"image13d65101-90c4-4c2a-a423-fbf221c73233", "contentType":"image/jpg", "media":"www.bing.com", "_rid":"rnYYAMVFUAUBAAAAAAAAAEC+LNM=", "_ts":1408056025, "_self":"dbs\/rnYYAA==\/colls\/rnYYAMVFUAU=\/docs\/rnYYAMVFUAUBAAAAAAAAAA==\