Cosmos DB Flashcards

1
Q

atom-record-sequence

A

Core type system for CDB engine. CDB translates your data models into ARS

  • atom - primitive types
  • record - structs
  • sequences - arrays
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the consistency levels of CosmosDB?

A
  • Strong
  • Bounded Staleness
  • Session
  • Consistent Prefix
  • Graph-based data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What do the different CosmosDB APIs allow you to do?

A

Use your existing API calls with CosmosDB. For example, CQL code to access Apache Cassandra DB can be simply ported over for use against CosmosDB

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

Difference between Azure Table storage and CosmosDB?

A

Azure Table storage is the predecessor of CosmosDB

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

Use cases for CosmosDB

A

Web, mobile, gaming, IoT apps that handle massive amounts of reads and writes at a global scale

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

Graph database

A
  • Persist relationships in the storage layer
  • Both entities(Nodes, AKA vertices) and their relationships(Edges, AKA Labels) to other entities are stored together using Properties(Somewhat like tags)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When Product A. is purchased, products C and D are usually purchased with it. You want to use these to make recommendations to your customers. What is the CosmosDB database/API type that should be used?

A

Graph

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

What does “multi-model” database service mean?

A

There are more than one data access methods (APIs) to access your data. (E;G., CosmosDB is multi-model)

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

How does the charging structure work for a CosmosDB table and why?

A

Charging is done by current capacity specified, regardless of the amount of data stored. This is because the capacity is reserved.

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

What are the 2 methods of migrating data to CosmosDB?

A
  • CosmosDB Data Migration Tool

* AzCopy

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

Graph Database

A

One of the models supported by Cosmos DB.
Non-tabular format
Relationships are treated as data rather than schema structure

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

What is a Graph?

A

The essential structure of a graph database.
Comprised of

  • Vertices/Nodes - represent objects
  • Edges/Relationships - Relationships between vertices
  • Properties - descriptors of vertices and edges
  • Vertice Properties - description of the object
  • Edge Properties - description of the relationship
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the general way to define your Nodes and Edges in a graph database?

A

Nodes = nouns

  • Customer
  • Employee
  • Product
    Relationships = verbs
  • Likes
  • Places
  • Belongs To
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

BCDR

A

Business Continuity and Disaster Recovery

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

Multi-master support

A
  • AKA multiple write regions
  • Every region defined as a write region is considered a master
  • data changes are automatically propagated with single digit latency
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Multi-master conflict resolution modes

A
  • Last-Writer-Wins(LWW) - User defined integer value
  • Custom (User Defined Function) - User defined stored proc
  • Custom (Async) - Conflicts logged and handled at the app level
17
Q

Multi-region failover

A
  • Only applies to single write regions
  • Read region outages take that region offline and redirect traffic
  • Write region outages mark the master offline and promote another region to master
18
Q

Types of data consistency offered

A
  1. Strong
  2. Bounded staleness (set interval lag)
  3. Session Scoped to client session most widely used
  4. Consistent Prefix - reads see writes in order
  5. Eventual Session to eventual 2x less expensive
19
Q

Key metrics of Cosmos DB to take into consideration

A
  • Total Requests
  • Total Throughput
  • Total Storage
20
Q

R/U

A
  • Request Unit.

* The amount of CPU, disk I/O and memory required to read 1KB of data in 1 second

21
Q

An Cosmos DB ____ is a container for one or more databases. A Cosmos DB ____ is a container for one or more collections. A ____ contains documents. A ____ is an unstructured set of key/value pairs read and written in a JSON format

A

Account
database
collection
document

22
Q

Partitioning

A

Distributing data across underlying resources based on a predefined partition key (E;G., combination of property keys in a document like person and category)

23
Q

Given the following requirement, what is the R/U requirement

  • 25 docs/second
  • 20 RUs/doc
A

500 R/Us (25 x 20)

24
Q

Once a partition is defined, how are documents placed into a particular partition?

A

Automatically by Cosmos DB

25
Q

A partition key is a ____ ____. Documents with the same partition key are always…

A
  1. document property

2. stored on the same logical partition

26
Q

What is a partition hot-spot and what is the risk of having one?

A
  • A partition key that does not evenly divide data across partitions
  • Hot partitions can overload the R/Us assigned to that partition and cause throttling
27
Q

CosmosDB Indexing Modes

A
  • Consistent - updated with every new doc
  • Lazy - reads/writes take priority over updating the index
  • None