Your default choice for new Azure Cosmos DB accounts should be Core (SQL). However, it would help if you also considered the following situations:
If your data is better represented in a graph, the Gremlin (graph) API might be a good choice.
If you already have an existing application or database using one of the other APIs, then the current API might be a better choice for your specific scenario. Using the current API might make it easier to:
- Migrate your application or database to Azure Cosmos DB
- Reuse your existing code with minimal changes
- Leverage the existing knowledge and experience of your development team.
You should only use the Azure Table API if you migrate from Azure Table Storage, as Core (SQL) offers far more features and flexibility.
Some of the concepts in Azure Cosmos DB:
- Database account is a container for one or more Azure Cosmos DB databases.
- Database is a container for one or more collections
- Collections are like tables in relational databases without a schema. A collection contains documents.
- Documents are an unstructured set of key/value pairs, read and written in JSON format. They are the logical unit and which is roughly equivalent to a relational row. Documents of similar types are organized into collections.
- Partitioning is the distribution and grouping of your data across the underlying resources.
- Index is a catalog of document properties and their values.
- Request Units (RUs) measures the throughput at which rate data is processed. RU is the amount of CPU, disk I/O, and memory required to read 1 KB of data in 1 second.
Additional insights can be found at How To Design And Query Data In Cosmos DB (c-sharpcorner.com)
Azure IoT Hub now supports the ability to setup an Azure Cosmos DB account as a custom routing endpoint. This will help route device data from IoT Hub to Azure Cosmos DB directly. The feature also allows the configuration of Synthetic Partition Keys for writing data into Azure Cosmos DB which helps in optimized querying when working with large-scale data.
Many IoT solutions require extensive downstream data analysis and pushing data into hyperscale databases. For example, IoT implementations in manufacturing and intelligent transport systems require hyperscale databases with extremely high throughput to process the continuous stream of data. Traditional SQL based relational databases cannot scale optimally and also become expensive once data scale increases. Azure Cosmos DB is best suited for such cases where the data needs to be analyzed while it is being written.
Source: Public preview: Add an Azure Cosmos DB custom endpoint in IoT Hub
Materialized view provides the ability to create Apache Cassandra tables with different primary/partition keys. This reduces write latency for your source table since the service handles populating the materialized views automatically and asynchronously. Benefit from low latency point reads directly from the views and overall greater compatibility with native Apache Cassandra.
Source: Public Preview: Materialized view for Azure Cosmos DB for Apache Cassandra
Comments