In this lesson,
we will learn about availability considerations.
Availability considerations ensure
that users can access systems, applications, and services
even in the face of failures, high demand,
or other disruptions.
Availability considerations
result in the implementation of load balancing,
using persistent and non-persistent affinity,
as well as interoperability.
Let's learn more about load balancing, persistence,
non-persistence, and interoperability.
First, we have load balancing.
Load balancing is a technique used in web services
to distribute incoming traffic
across multiple backend servers.
Load balancing ensures
that no single server becomes overwhelmed
and that servers remain available even during peak demand.
Think of it like a host at a restaurant
with several waiters.
Each waiter can service a handful of tables at a time.
When new customers come in,
the host distributes them evenly
across the available waiters
to ensure that no waiter gets overburdened
and everyone is served efficiently.
Similarly, load balancing helps maintain
the availability of a service
by spreading requests across servers
so that no one server gets too busy.
Load balancers use different algorithms
to determine how to distribute that incoming traffic.
One common approach is called Round Robin.
Using Round Robin,
requests are sent to servers in a rotating order.
In Round Robin,
there is no consideration for server load.
Requests are simply forwarded to the next server in line.
Another method is least connections.
Using least connections,
a load balancer directs traffic
to the server with the fewest active connections.
Some load balancers use an IP hashing method
to distribute load.
The IP hashing method hashes the client's IP address
and maps that client IP address to an available server.
In this way, IP hashing ensures a specific user
is always sent back to the same server.
Load balancing can also act
as a defensive mechanism against certain types of attack,
particularly distributed denial of service, or DDoS attacks.
In a DDoS attack, an attacker floods a server
with an overwhelming amount of requests,
crashing the system by exhausting its resources.
With load balancing in place,
traffic can be distributed across multiple servers,
preventing a single server from being overwhelmed.
If the servers start to become overwhelmed,
the load balancer can simply drop
additional incoming requests, preventing the DDoS attack.
Second, let's talk about persistence and non-persistence.
Persistence and non-persistence
relate to how user requests are handled by the servers.
Let's start with persistence.
In simple terms, persistence means that once a user
connects to a specific server,
they stay connected to that same server
for the duration of their session.
This is often referred to as session affinity.
Session affinity is important
for maintaining data integrity,
especially in situations
where the server stores session-specific information
like shopping carts or user preferences.
For example, if you are shopping online
and adding items to your cart,
you want all your requests to be handled by the same server
so that your cart data stays intact.
Session affinity guarantees a continuous connection,
making sure that any session-specific data
remains accurate and available.
Non-persistence, on the other hand,
means each request a user makes
may be handled by a different server.
This is more efficient for systems
where each request is independent
and there's no need to maintain a connection
to the same server.
For example, if you are browsing a news website
where each article you read is separate
and doesn't need to be connected to your previous actions,
non-persistence works just fine.
In this case, the load balancer can distribute your request
to whichever server is the least busy,
maximizing efficiency
and keeping the system response fast during heavy traffic.
Third, and finally, let's talk about interoperability.
Interoperability is the ability
of different systems, applications, or devices
to work together seamlessly,
exchanging and using information without any barriers.
It's like making sure different types of equipment, tools,
or even teams can all cooperate effectively
even if they were originally built separately.
So interoperability ensures
that various systems can communicate
and function smoothly even in complex environments.
For example, imagine you are using an app
that pulls data from different sources,
like a fitness app
that gathers information from your phone's GPS,
your smartwatch, and a cloud-based health database.
Interoperability ensures
that these different sources can work together
so your app runs smoothly.
Without interoperability, one part of the system
might not be able to communicate with another,
causing errors or making the service unavailable
when you need it.
From an availability standpoint,
interoperability helps systems stay online
and function properly.
When different systems can work together,
they can handle user requests more efficiently
and share resources,
which means less downtime and fewer bottlenecks.
For example, in the financial industry,
interoperability between different banking systems
allows customers to seamlessly transfer money
between accounts at different banks, use various ATMs,
and make transactions online
regardless of which institution they belong to.
So remember, availability considerations ensure
that systems and services remain accessible and operational
even during high demand, failures, or disruptions.
To achieve this, techniques like load balancing,
session persistence, and interoperability are used.
Load balancing helps distribute traffic
across multiple servers to prevent overload.
Persistence ensures that users remain connected
to the same server for the duration of their session.
Non-persistence allows requests
to be handled by different servers, increasing efficiency
and optimizing resource use across the system.
And finally, interoperability ensures that different systems
and applications work together,
enabling both availability and functionality.