Chapter 4: Scalable and Fault-Tolerant Applications Flashcards
Name and describe the two principle methods to scale.
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
What is the Difference between Stateless and Stateful components?
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, …
Name three possible Levels of Stateless Load Balancing.
Load balancing on IP level
Load balancing on DNS
Load balancing by distinct load balancer
(Load balancing on different levels can be combined)
How does Load balancing on IP level work?
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 does Load balancing on DNS level work?
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 does Load balancing by distinct load balancer work?
Explicitly distributes request among available machines
- Clients send requests to load balancer
Requirements for applicability
- No network bottleneck
Examples: Various websites, Amazon Elastic LB
What are the three Different strategies for the actual load balancing?
- Round robin LB
- Simple, good if all request cause roughly the same load - Feedback-based LB
- Servers report actual load back to load balancer - Client-based LB
- Choose server with smallest network latency for client
Explain the Idea of Partitioning.
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!
Name and explain three Popular Partitioning Schemes.
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
Which two Classes of Partition Functions exist and what are the pro and cons?
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
Where to Place the Replicas?
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
Who can create the copies for Replication?
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
What Happens at Replication when the Data Changes? steps 1. - 3.
- Invalidation protocols
- Inform replica servers that their replica is now invalid
- Good when many updates and few reads - Transferring the modified data among the servers
- Each server immediately receives latest version
- Good when few updates and many reads - 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
Explain Push- and Pull- based updates
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
What are Issues of Push- and Pull- based updates
State of server
Messages sent
Response time at client