Databases

Azure Cosmos DB is a globally distributed multi-model database that supports the document, graph, and key-value data models. The content in this section is for creating, querying, and managing database resources using the SQL API via REST.

Each Azure Cosmos DB account supports multiple independently named databases. A database is a logical namespace for collections, users, and permissions. The database resource is represented by dbs in the Azure Cosmos DB resource model. Here’s an example of the URI: https://mydbaccount.documents.azure.com/dbs.

Here is a sample representation of a database in Azure Cosmos DB:

{  
  "id":"ContosoDB",  
  "_rid":"rnYYAA==",  
  "_ts":1408056022,  
  "_self":"dbs\/rnYYAA==\/",  
  "_etag":"00004800-0000-0000-0000-53ed3ad60000",  
  "_colls":"colls\/",  
  "_users":"users\/"
}  
  
Property Description
id Required. It is the only user settable property. It is a unique name that identifies the database, that is, no two databases share the same name in an account. The name must not exceed 255 characters.
_rid It is a system generated property. The resource ID (_rid) is a system-generated identifier.
_ts It is a system generated property. It specifies the last updated timestamp of the resource. The value is a timestamp.
_self It is a system generated property. It is the unique addressable URI for the resource.
_etag It is a system generated property that specifies the resource etag required for optimistic concurrency control.
_colls It is a system generated property that specifies the addressable path of the collections resource.
_users It is a system generated property that specifies the addressable path of the users resource.

Tasks

You can do the following tasks with databases:

See Also