CosmosDB Flashcards

1
Q

Considerations for choosing partition key

A
  • transactions can only occur across a single partition
  • queries work fastest when not run across all partitions
  • containers can contain 1 or more partitions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the property to run a query across partitions?

A

EnableCrossPartitionQuery

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

What is the property to run a query in parallel?

A

MaxDegreeOfParallelism (client side)

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

Strong Consistency

A
  1. Guarantees no dirty reads

High latency because must wait for all slaves to update

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

Eventual Consistency

A
  1. There’s no ordering guarantee for reads. In the absence of any further writes, the replicas eventually converge.

Low latency because only one write to make

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

Bounded Staleness Consistency

A
  1. Dirty reads possible

Staleness configurable by time and updates (i.e. no stale data older than 30 seconds)

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

Session Consistency

A
  1. No dirty reads for the writer (read your own writes)

Scoped to a client session.

Dirty reads possible for the other users

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

Consistent Prefix Consistency

A
  1. Updates that are returned contain some prefix of all the updates, with no gaps.

Consistent prefix guarantees that reads never see out-of-order writes.

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

What is the _etag property?

A

GUID used for optimistic concurrency so Cosmos knows when one user is going to override changes of another user resulting in a conflict

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

Hash Index

A

Used for equality queries for strings and numbers.

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

Range Index

A

Equality range, order by for strings and numbers.

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

Spatial Index

A

Distance and intersection for geo coordinates

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

Consistent Indexing Mode

A

Indexed as soon as the document is added or updated.

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

Lazy Indexing Mode

A

Indexed when Cosmos has CPU cycles to spare and is not processing requests.

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