Chapter 3: Replication, CAP Flashcards

1
Q

Where to Place the Replicas?

A

Within a cloud data center, replica placement is often done with respect to the network hierarchy
- One replica on another machine
- Guards against individual node failures
- One replica on another rack
- Guards against outages of the rack switch
On a global scale, replicas are often distributed with regard to the client locations

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

Who can create the copies for Replication?

A

Server-initiated replication
- Copies are created by server when popularity of data
item increases
- Mainly used to reduce server load
- Server decides among a set of replica servers
Client-initiated replication
- Also known as client caches
- Replica is created as result of client‘s response
- Server has no control of cached copy anymore
- Stale replicas handled by expiration date
- Traditional examples: Web proxies

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

What Happens at Replication when the Data Changes? steps 1. - 3.

A
  1. Invalidation protocols
    - Inform replica servers that their replica is now invalid
    - Good when many updates and few reads
  2. Transferring the modified data among the servers
    - Each server immediately receives latest version
    - Good when few updates and many reads
  3. Don‘t send modified data, but modification commands
    - Good when commands substantially smaller than data
    - Assumes that servers are able to apply commands
    - Beneficial when network bandwidth the scarce
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain Push- and Pull- based updates

A

Push-based updates (server-based protocols)
- Server pushes updates to replica servers
- Mostly used in server-initiated replica setups
- Used when high degree of consistency is needed
Pull-based updates (client-based protocols)
- Clients request updates from server
- Often used by client caches
- Good when read-to-update ratio is low

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

What are Issues of Push- and Pull- based updates

A

State of server
Messages sent
Response time at client

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

Which two Views On Consistency exist?

A

Data-centric consistency models
- Talk about consistency from a global perspective
- Provides guarantees how a sequence of read/write operations are perceived by multiple clients
Client-centric consistency models
- Talk about consistency from the client‘s perspective
- Provides guarantees how a single client perceives the state of a replicated data item

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

Two groups of Data-Centric Consistency Models

A

Strong consistency models
- Operations on shared data is synchronized
- Strict consistency (related to time)
- Sequential consistency (what we are used to)
- Causal consistency (maintains only causal relations)
Weak consistency models
- Synchronization only when data is locked/unlocked
- General weak consistency
- Release consistency
- Entry consistency

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

5 Client-Centric Consistency Models (Client-Centric)

A
  1. Eventual Consistency
  2. Monotonic Reads
  3. Monotonic Writes
  4. Read Your Writes
  5. Writes Follow Reads
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Characteristics of Eventual Consistency (Client-Centric)

A
  • all replicas will reach the most recent state at some point of time
  • client can read from everywhere
  • most common used by big cloud providers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Characteristics of Monotonic Reads (Client-Centric)

A

Teh client reads always from the servers which has all writes that the cllient previously read.

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

Characteristics of Monotonic Writes (Client-Centric)

A

the client can only write on servers where he his previous writes have been completed

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

Characteristics of Read Your Writes (Client-Centric)

A

All write operations of a client will always be seen by a successive read operation of the same client.

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

Characteristics of Writes Follow Reads (Client-Centric)

A

A write operation after a read operation can only be performed after all preceding writes have been performed.

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

General Remark on Consistency

A

In general, the stricter the consistency model, the more it impacts the scalability of a system
- More consistency requires more synchronization
- While the data is synchronized, some client requests
may be answered
- Databases of the 80s and 90s put strong emphasis on consistency, lived with limited scalability/availability
- Today‘s cloud databases often sacrifice consistency in favor of scalability and availability

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

Explain the Brewer’s CAP Theorem

A

In a distributed system, it is impossible to provide all three of the following guarantees at the same time:
- Consistency: Write to one node, read from another node will return something no older than what was written
- Availability: Non-failing node will send proper response (no error or timeout)
- Partition tolerance: Keep promise of either consistency
or availability in case of network partition

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

What stats the ACID properties in the context of databases for?

A

Atomicity - Atomarität (Abgeschlossenheit)
Consistency - Konsistenzerhaltung
Isolation - Isolation (Abgrenzung)
Durability - Dauerhaftigkeit

17
Q

Why Replication and not only Partitioning?

A

Partitioning helps with scalability but not availability
- Data is only stored in one location
- If machine goes down, data is gone
Replication can improve both scalability and availability!

18
Q

Characteristics of Strict Consistency (Data-Centric)

A

Any read operation returns the value stored by the most recent write operation.

19
Q

Characteristics of Sequential Consistency (Data-Centric)

A

Any reads in a sequence return the last writes in sequence.

20
Q

Characteristics of Causal Consistency (Data-Centric)

A

as long as the writes were not potentially depending, a different read order of concurrent writes is ok.