Azure Cosmos DB Flashcards

1
Q

What is CosmosDB?

A

A highly scalable database management system. Cosmos DB automatically allocates space in a container for your partitions, and each partition can grow up to 10 GB in size. Indexes are created and maintained automatically. There’s virtually no administrative overhead.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

CosmosDB API - Core (SQL) API

A

The native API in Cosmos DB manages data in JSON document format, and despite being a NoSQL data storage solution, uses SQL syntax to work with the data.

SQL Query:
SELECT *
FROM customers c
WHERE c.id = “joe@litware.com”

Result is JSON:
{
   "id": "joe@litware.com",
   "name": "Joe Jones",
   "address": {
        "street": "1 Main St.",
        "city": "Seattle"
    }
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

CosmosDB - MongoDB API

A

The Azure Cosmos DB MongoDB API enables developers to use MongoDB client libraries and code to work with data in Azure Cosmos DB.

MongoDB Query Language (MQL) uses a compact, object-oriented syntax in which developers use objects to call methods. For example, the following query uses the find method to query the products collection in the db object:

db.products.find({id: 123})

{
   "id": 123,
   "name": "Hammer",
   "price": 2.99
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

CosmosDB - Table API

A

The Table API is used to work with data in key-value tables, similar to Azure Table Storage. The Azure Cosmos DB Table API offers greater scalability and performance than Azure Table Storage.

https://endpoint/Customers(PartitionKey=’1’,RowKey=’124’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

CosmosDB - Cassandra API

A

The Cassandra API is compatible with Apache Cassandra, which is a popular open source database that uses a column-family storage structure. Column families are tables, similar to those in a relational database, with the exception that it’s not mandatory for every row to have the same columns.

Cassandra supports a syntax based on SQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

CosmosDB - Gremlin API

A

The Gremlin API is used with data in a graph structure;

Gremlin syntax includes functions to operate on vertices and edges, enabling you to insert, update, delete, and query data in the graph.

g. addV(‘employee’).property(‘id’, ‘3’).property(‘firstName’, ‘Alice’)
g. V(‘3’).addE(‘reports to’).to(g.V(‘1’))

The following query returns all of the employee vertices, in order of ID.

g.V().hasLabel(‘employee’).order().by(‘id’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Azure DataLake Storage Gen2

A

Azure Data Lake Storage Gen2 is a hierarchical data storage service for analytical data lakes that is integrated into Azure Storage;

take advantage of the scalability of blob storage and the cost-control of storage tiers, combined with the hierarchical file system capabilities and compatibility with major analytics systems of Azure Data Lake Store.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Azure Tables

A

Azure Table Storage is a NoSQL storage solution that makes use of tables containing key/value data items. Each item is represented by a row that contains columns for the data fields that need to be stored.

A row in a table has 3 mandatory columns.

  • row key
  • partition key
  • timestamp (automatically recorded to indicate time of modification)

The number of other columns in each row may vary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly