Azure Cosmos DB

Azure Cosmos DB is a globally distributed database service designed to enable you to elastically and independently scale throughput and storage across any number of geographical regions with comprehensive SLAs. You can develop document, key/value, or graph databases with Cosmos DB using a series of popular APIs and programming models.

SQL API:
With the SQL API, Azure Cosmos DB provides rich and familiar SQL query capabilities with consistent low latencies over schema-less JSON data. In this article, we provide an overview of the Azure Cosmos DB’s SQL API, and how to best use the API.

Gremlin API:
Azure Cosmos DB provides the Gremlin API for graph modeling and traversal, along with turn-key global distribution, elastic scaling of storage and throughput, and low latency.

Cassandra API
Azure Cosmos DB supports the Cassandra API. This means that by using existing drivers, your application written for Cassandra can now communicate with Azure Cosmos DB instead of Apache Cassandra/Datastax Enterprise databases, and gain benefits like global distribution and elastic scale.

MongoDB API:
Azure Cosmos DB supports the MongoDB API. This means that by using existing drivers, your application written for MongoDB can now communicate with Cosmos DB instead of MongoDB databases, and gain benefits like global distribution & elastic scale.

Table API:
Azure Cosmos DB provides the Table API for key-value workloads. This provides a premium experience for Azure Table storage with secondary indexes, global distribution, low latency, and dedicated throughput.

How can we improve Azure Cosmos DB?

You've used all your votes and won't be able to post a new idea, but you can still search and comment on existing ideas.

There are two ways to get more votes:

  • When an admin closes an idea you've voted on, you'll get your votes back from that idea.
  • You can remove your votes from an open idea you support.
  • To see ideas you have already voted on, select the "My feedback" filter and select "My open ideas".
(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. Add provider for Entity Framework 7

    Its very important to have ORM (ODM) support for DDD(Domain Driven Design)-style architectures. DDD is what makes DocumentDB most useful IMHO. Since EF7 was refactored to be extensible and support non-relational databases, I think its important to provide DocumentDB support for EF. This also should make migration of existing EF-based applications to DocumentDB much easier and will attract much more developers to this product.

    93 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  2. Mongo DB API - cursor.sort() does not return sorted result

    When I use find() with sort(), the results are not sorted correctly. The order of the returned items do change, but in a strange order. (MongoDB returns correctly sorted result with the same query). Is this a CosmosDB bug?

    Here are the queries and results. The queries are executed with a Mongo DB shell connected to a Cosmos DB instance. You can see that the header_timestamp order are incorrect.

    > db.datastore.find({}, {_id: 1, header_timestamp: 1})

    { "_id" : "object-bbfg0pritvunrk0bi170", "header_timestamp" : NumberLong(1) }
    { "_id" : "object-bbfg0rjitvunrk0bi180", "header_timestamp" : NumberLong(3) }
    { "_id" : "object-bbfg0s3itvunrk0bi18g", "header_timestamp" : NumberLong(4) }
    {…

    91 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    4 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  3. Support documents up to 16mb

    It's not possible to migrate documents greater than 2mb, please consider increase document size up to 16mb

    91 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Flag idea as inappropriate…  ·  Admin →
  4. Make triggers automatic

    Right now, triggers are not automatic meaning that they must be specified on each database operation where you want them to be triggered. This means that there is no way to ensure that business rules and other constraints are maintained. I have resorted to telling other developers never to hit the database directly but instead use the set of sprocs established to maintain constraints. It seems to work for us because we're small, but I can imagine that in a larger development team, someone will hit the database directly bypassing your sprocs and risk violating your desired constraints.

    Triggers provide…

    86 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →

    This is not on our roadmap. As you correctly pointed out there are or can be issues making these automatic that could impact performance. Our recommendation is these should be explicit in your app.

    Thank you for your suggestion. We will revisit this again sometime in the future.

  5. Add support for "Search text" ($text Operator)

    Support for "Mongo Search Text" (https://docs.mongodb.com/manual/text-search/). Example of use:

    db.stores.find( { $text: { $search: "java coffee shop" } } )

    77 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  6. Needs documentation about limits when MongoDb API is used

    Seems that information about limitations with MongoDb API is missing,
    or impossible to find. For example mongo has max doc size 16Mb but
    Azure docDb 2Mb, which is correct for CosmosDbWithMongoAPI.
    (Even that documentDb limits documentation which is referred in this site seems to be removed)

    -Maximum document size ?
    -Maximum query payload size ?
    -Maximum query result size ?
    -Maximum size of partition of partitioned collection ?
    -Maximum count of documents in the partition of partitioned collection ?
    -Maximum count of documents in single-partition collection ?
    -MongoDb needs manual creation of indexes, docDb indexes automatically all properties, how about…

    77 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  7. Support multiple collections in stored procedures

    Currently CosmosDB Stored procedures only allow access to a SINGLE collection (because they seem to be scoped to collections rather than to the database), via getContext() :

    var collection = getContext().getCollection();

    But any "useful" / "real-life" application using ComosDB will typically have to interact with more than one collection. For example, it is currently IMPOSSIBLE to insert documents into two distinct collections within a database using a single stored procedure -- a VERY SERIOUS drawback / limitation.

    I would propose that stored procedures be scoped to the database level and then we would be allowed to do something like:

    var…

    75 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
  8. Execute a procedure when TTL expires

    I would like to execute a procedure when TTL expires. For example, when TTL expires I would like to also delete some related records from Azure table storage.

    75 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    6 comments  ·  Flag idea as inappropriate…  ·  Admin →

    We plan to introduce support for tracking deletes in the change feed. Using this capability, you can integrate with Azure Functions or another event processing system to perform operations like execute procedure or call other services programmatically.

  9. Increase 10GB limit on non partitioned collection

    Give there is a hard 10GB limit on a non-partitioned collection, and partition collections are much more expensive, with no auto-upgrade and code changes required to migrate to partitions, a larger size limit on non partitioned collection is much needed.

    74 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Flag idea as inappropriate…  ·  Admin →
  10. Deploy Stored Procedures from Source Control

    It would be great if we could deploy sprocs from visualstudio.com as we can with Azure Functions or Azure Web Sites.

    69 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    4 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
  11. Compound indexes

    Compound indexes are required for efficiently sorting on multiple fields. See https://docs.mongodb.com/manual/tutorial/sort-results-with-indexes/.

    68 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  12. Order By Null Handling

    Currently if you do an order by on a nullable value, the documents are not returned at all. Please add functionality similiar to Application Insights where you can specify if the documents with the null value appear at the beginning or end of the sort.

    63 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
  13. Unique indexes on Graph vertex/edge properties

    I need to ensure global uniqueness for things like username/email/mobile number/etc. Since we no longer have traditional SQL, this capability is lacking. Allow me to define unique indexes so the write region has only one occurrence of a distinct value.

    Ideally, this should also make FILTERED unique indexes possible.

    61 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    5 comments  ·  Gremlin API  ·  Flag idea as inappropriate…  ·  Admin →
  14. Pin the Graphs from the Metrics Page to Azure Portal Dashboards

    I would love to be able to pin the graphs on the Metrics tab of the Azure Portal blade for Cosmos DB to my Azure Dashboard. Many other services allow this and it's great to get an overview of health, status and usage. Also great for Ops dashboards, sharing, etc.

    Right now the work around is to manually point the diagnostic logs to an OMS workspace and recreate the query in Log Analytics, and then pin it. It kinda sucks and your graphs are way better.

    61 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Other  ·  Flag idea as inappropriate…  ·  Admin →
  15. Add built-in cast function for SQL queries

    Need built-in function for casting string datatypes to INT, NUMBER, DOUBLE, etc. in SQL queries as our data loader is converting the number to string during document creation. We have a requirement to filter on numeric values in our application.

    60 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →

    This is on our roadmap and work has started on implementing this feature. We do not have an ETA on when this will be released but it should be within the next 2-3 months. Will update with an ETA when this feature gets closer to completion.

    Thank you for your suggestion.

  16. MongoDB API : aggregation operation is too slow

    the aggregation operation is too slow ...

    57 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    9 comments  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →

    We are currently working on this feature and have made it available in Preview in the Azure Portal.

    Please feel free to test Aggregation Pipeline support for your MongoDB API accounts in Cosmos DB by opening your MongoDB API account, then clicking on “Preview” tab on left hand side and then Enable for Aggregation Pipeline.

    While there please feel free to test support for MongoDB 3.4 support as well as Per-Document TTL support.

    Thank you for your request and votes.

  17. Compress query results

    Compress query results if requested by the client. This could significantly improve network throughput for large queries.

    52 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  18. Support OrderBy and OrderByDescending in Nested Arrays

    For example in a document structure such as:

    {
    "id": "some id",
    "things": [
    { "value": "5" },
    { "value": "2" },
    { "value: "7" }
    ]
    }

    It would be great to be able to do something like:

    queryable.Select(x => x.Things.OrderByDescending(y => y.Value)).AsEnumerable.FirstOrDefault();

    50 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  Flag idea as inappropriate…  ·  Admin →

    This is something we have on our backlog and eventually plan to implement this but it is not on our short-term plan. Will mark this as under review for now as we will continue to review the comments and votes on this issue as we revisit feedback.

    Thanks for your request.

  19. The ability to reference JavaScript libraries (e.g. underscore) within server-side scripting

    It'd be nice to be able to reference javascript libraries within server-side scripting. Something like an AMD or RequireJS loader.

    For example:
    var _ = require('lodash');

    50 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    4 comments  ·  SQL API  ·  Flag idea as inappropriate…  ·  Admin →
  20. Support for document validation, using JSON Schema

    Similar to MongoDB v3.6 https://docs.mongodb.com/manual/reference/operator/query/jsonSchema/ Would be useful for both MongoDB API and DocumentDB API

    50 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  MongoDB API  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Azure Cosmos DB

Feedback and Knowledge Base