1.6 Load Balancing Flashcards
What is a load balancer?
A server that balances incoming traffic to your application and distributes that traffic across multiple servers
Improves reliability and scalability of your application and allows replication.
What does fault tolerance mean in the context of load balancers?
Enhancement of service availability by redirecting traffic away from failed or malfunctioning servers.
What is health monitoring in load balancers?
Continuous monitoring of backend server health and performance, removing unresponsive servers from the pool.
What is SSL termination?
Offloading SSL/TLS encryption and decryption from backend servers to improve performance.
What is session persistence in load balancers?
Ensuring that subsequent requests from the same client are directed to the same backend server.
What is geographic load balancing?
Distribution of traffic based on the geographical location of the client to optimize performance.
What is content-based routing in load balancers?
Routing traffic based on content-specific criteria like URL paths, HTTP headers, or query parameters.
What is Round Robin load balancing?
The simplest form of load balancing where each request is directed to the next server in a sequential list.
What is the Least Connections load balancing method?
Routing traffic to the server with the fewest active connections.
What does Least Response Time load balancing measure?
It measures the response time of each server and directs traffic to the server with the fastest response time.
What is Source IP Hash in load balancing?
Requests from the same client IP address are consistently routed to the same backend server.
What is Weighted Least Connection load balancing?
Similar to least connections, but servers are assigned a weight based on their capacity or performance.
What are Application-Based Load Balancers?
Load balancers that operate at Layer 7 of the OSI model, allowing for advanced routing decisions.
What are Network Load Balancers?
Load balancers operating at Layer 4 of the OSI model, routing traffic based on IP addresses and TCP/UDP port numbers.
What is vertical scaling?
Increasing the capacity of a single server by adding more resources such as CPU, memory, or storage.
What is horizontal scaling?
Adding more servers to distribute the load across multiple machines.
Fill in the blank: Vertical scaling is also known as _______.
[scaling up]
Fill in the blank: Horizontal scaling is also known as _______.
[scaling out]
What is a key disadvantage of vertical scaling?
Limited scalability due to the maximum capacity of a single server.
What is a key advantage of horizontal scaling?
High scalability by adding more servers as needed.
What does Layer 7 load balancing operate on?
The Application Layer of the OSI model.
What does Layer 4 load balancing use to direct traffic?
Data from network and transport layer protocols such as IP, TCP, or UDP.
What is the role of a load balancer compared to a reverse proxy?
A load balancer distributes incoming network traffic across multiple servers.
What is a reverse proxy?
A proxy server that retrieves resources on behalf of a client from one or more servers.
What is a disadvantage of using a reverse proxy?
Can become a single point of failure if not properly configured for high availability.
What is a key characteristic of a private IP?
An IP address that is reachable only between servers in the same network.
What does database replication address?
Failover and redundancy issues in database design.
What happens when a load balancer is added to a web tier?
Improved availability of the web tier and resolution of failover issues.
What is the primary role of a load balancer?
A load balancer evenly distributes incoming traffic among web servers that are defined in a load-balanced set.
How do users connect to a load balancer in a web application setup?
Users connect to the public IP of the load balancer directly. With this setup, web servers are unreachable directly by clients anymore.
What is the purpose of using private IPs in a load-balanced setup?
Private IPs are used for communication between servers to enhance security. A private IP is only reachable between servers in the same network and is not accessible over the internet.
How does a load balancer communicate with web servers in a load-balanced setup?
The load balancer communicates with web servers through private IPs to ensure better security and isolation.
What happens if server 1 goes offline in a load-balanced setup?
If server 1 goes offline, all the traffic is routed to server 2. This prevents the website from going offline.
What is the solution when a website’s traffic grows rapidly and two servers are not enough?
The load balancer can handle this issue by automatically adding more web servers to the pool. It will start sending requests to the newly added servers.
What does the web tier setup look like after adding a load balancer and additional web servers?
After adding a load balancer and a second web server, the setup solves failover issues and improves the availability of the web tier, ensuring that traffic can be rerouted in case of server failure.
What is the problem with having only one database in the current web application design?
Having only one database in the current design creates a single point of failure and does not support failover and redundancy.
How can database failover and redundancy be addressed in a web application architecture?
Database replication is a common technique to address database failover and redundancy issues, allowing the database to be replicated across multiple servers to ensure availability.
What is the primary function of load balancers?
Distributing incoming client requests to computing resources such as application servers and databases.
List three advantages of using load balancers.
- Preventing requests from going to unhealthy servers
- Preventing overloading resources
- Helping to eliminate a single point of failure
What are the two types of load balancers based on implementation?
- Hardware
- Software (e.g., HAProxy)
What does SSL termination do in the context of load balancers?
Decrypts incoming requests and encrypts server responses so backend servers do not have to perform these operations.
True or False: Load balancers remove the need to install X.509 certificates on each server.
True
What is session persistence in load balancers?
Issuing cookies and routing a specific client’s requests to the same instance.
What are the two common modes for setting up multiple load balancers?
- Active-passive
- Active-active
Name two metrics used by load balancers to route traffic.
- Random
- Least loaded
What layer do Layer 4 load balancers operate at?
Transport layer
What type of information do Layer 4 load balancers look at to distribute requests?
Source and destination IP addresses and ports in the header.
Fill in the blank: Layer 4 load balancers perform _______.
Network Address Translation (NAT)
What layer do Layer 7 load balancers operate at?
Application layer
How do Layer 7 load balancers make load-balancing decisions?
By looking at the contents of the header, message, and cookies.
What is one example of a decision a Layer 7 load balancer might make?
Directing video traffic to servers that host videos.
What is horizontal scaling?
Improving performance and availability by scaling out using commodity machines.
List two disadvantages of horizontal scaling.
- Introduces complexity
- Requires servers to be stateless
What must be done with sessions when using horizontal scaling?
Store sessions in a centralized data store.
What is a potential disadvantage of using a load balancer?
It can become a performance bottleneck if not properly resourced or configured.
True or False: A single load balancer is not a single point of failure.
False
What is one complexity introduced by configuring multiple load balancers?
Increased overall configuration complexity.
What is a reverse proxy?
A web server that centralizes internal services and provides unified interfaces to the public
How does a reverse proxy handle client requests?
Requests from clients are forwarded to a server that can fulfill it before the reverse proxy returns the server’s response to the client
List three benefits of using a reverse proxy.
- Increased security
- Increased scalability and flexibility
- SSL termination
What is one way a reverse proxy increases security?
Hides information about backend servers
What is SSL termination in the context of a reverse proxy?
Decrypting incoming requests and encrypting server responses so backend servers do not have to perform these operations
Fill in the blank: A reverse proxy removes the need to install ______ on each server.
X.509 certificates
What is one disadvantage of using a reverse proxy?
Increased complexity
What is the difference between a load balancer and a reverse proxy?
Load balancers route traffic to multiple servers serving the same function, while reverse proxies can be used with just one web server
Name two solutions that support both layer 7 reverse proxying and load balancing.
- NGINX
- HAProxy
What does separating the web layer from the application layer allow?
To scale and configure both layers independently
What principle advocates for small and autonomous services working together?
Single responsibility principle
What are microservices?
A suite of independently deployable, small, modular services that run a unique process and communicate through a well-defined mechanism
Give an example of a microservice that Pinterest might use.
User profile
What is service discovery?
A mechanism that helps services find each other by tracking registered names, addresses, and ports
Name two systems that can be used for service discovery.
- Consul
- Etcd
Fill in the blank: Microservices can add ______ in terms of deployments and operations.
Complexity
What is one way that workers in the application layer help enable asynchronism?
What are health checks used for in service discovery?
To verify service integrity
What is a disadvantage of adding an application layer with loosely coupled services?
Requires a different approach from an architectural, operations, and process viewpoint compared to a monolithic system