Chapter 4: Scalable and Fault-Tolerant Applications Flashcards

1
Q

Name and describe the two principle methods to scale.

A

Vertical Scalability (Scaling Up)
Idea: Increase performance of a single node (more CPUs, memory, …)
Pro: Good speed-up up to a particular point
Con: Beyond that point, speed-up becomes very expensive
Horizontal Scalability (Scaling Out)
Idea: Increase number of nodes
Pro: Cheap to grow total amount of resources
Con: Standard software is often not able to leverage resources, special software needed

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

What is the Difference between Stateless and Stateful components?

A

a stateless component maintains no internal state beyond a request e.g DNS server, web server with static pages, …
a stateful component maintains state beyond request required to process next request
e.g SMTP server, stateful WS, DBMS, …

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

Name three possible Levels of Stateless Load Balancing.

A

Load balancing on IP level
Load balancing on DNS
Load balancing by distinct load balancer
(Load balancing on different levels can be combined)

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

How does Load balancing on IP level work?

A

Balancing is implemented by IP routers
- Multiple devices share one IP address (IP anycast)
- Routers route packet to different locations
Requirements for applicability
- Request must fit in one IP packet
- Control over routers
Examples: DNS root server (mostly for reliability)

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

How does Load balancing on DNS level work?

A

Balancing is implemented by DNS servers
- DNS servers resolve DNS name to different IP addresses
Requirements for applicability
- Control over DNS server
- Stable load characteristics (think of DNS caching)
Examples: Various big websites, e.g. www.google.com

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

How does Load balancing by distinct load balancer work?

A

Explicitly distributes request among available machines
- Clients send requests to load balancer
Requirements for applicability
- No network bottleneck
Examples: Various websites, Amazon Elastic LB

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

What are the three Different strategies for the actual load balancing?

A
  1. Round robin LB
    - Simple, good if all request cause roughly the same load
  2. Feedback-based LB
    - Servers report actual load back to load balancer
  3. Client-based LB
    - Choose server with smallest network latency for client
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain the Idea of Partitioning.

A

Divide data into distinct independent parts
- Each server is responsible of one or more parts
Pure partitioning improve scalability but not availability
- Each data item is only stored in one partition!

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

Name and explain three Popular Partitioning Schemes.

A

Partitioning per tenant
- Put different tenant on different machines
- Pro: In PaaS clouds, tenants are expected to be isolated No network traffic between machines, good scalability Con: Tenant cannot scale beyond one machine
Horizontal partitioning (relational databases)
- Split table by rows
- Put different rows on different machines
- Reduced number of rows, reduced indices
- Done by Google BigTable, MongoDB
Vertical partitioning (relational databases)
- Split table by columns
- Not very common to improve scalability
-> Just mentioned here for the sake of completeness

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

Which two Classes of Partition Functions exist and what are the pro and cons?

A

Hash partitioning

  • Desired property: Uniform distribution
  • Pro: Good load balancing characteristics
  • Con: Inefficient for range queries, typically requires data reorganization when number of partitions changes

Range partitioning

  • Pro: Efficient for range queries and partition scaling
  • Con: Poor load balancing properties
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
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
12
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
13
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
14
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
15
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
16
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

17
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

18
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
19
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
20
Q

Characteristics of Monotonic Reads (Client-Centric)

A

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

21
Q

Characteristics of Monotonic Writes (Client-Centric)

A

The client can only write on servers where his previous writes have been completed.

22
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.

23
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.

24
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

25
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

26
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!

27
Q

Characteristics of Strict Consistency (Data-Centric)

A

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

28
Q

Characteristics of Sequential Consistency (Data-Centric)

A

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

29
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.

30
Q

Fundamental Cloud Architectures.

A
  • Workload distribution
  • Resource pooling
  • Dynamic scaling and elastic capacities
31
Q

Goal of every partitioning scheme.

A

Reduce network communication.

32
Q

Consistency Models impact on Scalability.

A

The stricter the CL, the less scalability is possible.