Avaibility & Reability & Scability

H13 tháng 6, 2024

Availability

Availability is the time a system remains operational to perform its required function in a specific period. It is a simple measure of the percentage of time that a system, service, or machine remains operational under normal conditions.

The Nine's of availability

Availability is often quantified by uptime (or downtime) as a percentage of time the service is available. It is generally measured in the number of 9s.

Availability=Uptime(Uptime+Downtime)Availability = \frac{Uptime}{(Uptime + Downtime)}

If availability is 99.00% available, it is said to have "2 nines" of availability, and if it is 99.9%, it is called "3 nines", and so on.

Availability (Percent)Downtime (Year)Downtime (Month)Downtime (Week)
90% (one nine)36.53 days72 hours16.8 hours
99% (two nines)3.65 days7.20 hours1.68 hours
99.9% (three nines)8.77 hours43.8 minutes10.1 minutes
99.99% (four nines)52.6 minutes4.32 minutes1.01 minutes
99.999% (five nines)5.25 minutes25.9 seconds6.05 seconds
99.9999% (six nines)31.56 seconds2.59 seconds604.8 milliseconds
99.99999% (seven nines)3.15 seconds263 milliseconds60.5 milliseconds
99.999999% (eight nines)315.6 milliseconds26.3 milliseconds6 milliseconds
99.9999999% (nine nines)31.6 milliseconds2.6 milliseconds0.6 milliseconds

Availability in Sequence vs Parallel

If a service consists of multiple components prone to failure, the service's overall availability depends on whether the components are in sequence or in parallel.

Sequence

Overall availability decreases when two components are in sequence.

Availability (Total)=Availability (Foo)Availability (Bar)Availability \space (Total) = Availability \space (Foo) * Availability \space (Bar)

For example, if both Foo and Bar each had 99.9% availability, their total availability in sequence would be 99.8%.

Parallel

Overall availability increases when two components are in parallel.

Availability (Total)=1(1Availability (Foo))(1Availability (Bar))Availability \space (Total) = 1 - (1 - Availability \space (Foo)) * (1 - Availability \space (Bar))

For example, if both Foo and Bar each had 99.9% availability, their total availability in parallel would be 99.9999%.

Availability vs Reliability

If a system is reliable, it is available. However, if it is available, it is not necessarily reliable. In other words, high reliability contributes to high availability, but it is possible to achieve high availability even with an unreliable system.

High availability vs Fault Tolerance

Both high availability and fault tolerance apply to methods for providing high uptime levels. However, they accomplish the objective differently.

A fault-tolerant system has no service interruption but a significantly higher cost, while a highly available system has minimal service interruption. Fault-tolerance requires full hardware redundancy as if the main system fails, with no loss in uptime, another system should take over.

Scalability

Scalability is the measure of how well a system responds to changes by adding or removing resources to meet demands.

Let's discuss different types of scaling:

Vertical scaling

Vertical scaling (also known as scaling up) expands a system's scalability by adding more power to an existing machine. In other words, vertical scaling refers to improving an application's capability via increasing hardware capacity.

Advantages

  • Simple to implement
  • Easier to manage
  • Data consistent

Disadvantages

  • Risk of high downtime
  • Harder to upgrade
  • Can be a single point of failure

Horizontal scaling

Horizontal scaling (also known as scaling out) expands a system's scale by adding more machines. It improves the performance of the server by adding more instances to the existing pool of servers, allowing the load to be distributed more evenly.

Advantages

  • Increased redundancy
  • Better fault tolerance
  • Flexible and efficient
  • Easier to upgrade

Disadvantages

  • Increased complexity
  • Data inconsistency
  • Increased load on downstream services