DEV Community

Wriju's Blog
Wriju's Blog

Posted on

Service Level Agreement (SLA) and Composite SLA

A service level agreement (SLA) is a contract between a service provider and a customer that outlines the service to be provided, the level of performance to be expected, how performance will be measured and approved and what happens if performance levels are not met. SLAs are important for ensuring that both parties have a clear and shared understanding of the service expectations and responsibilities.

A composite SLA is the resulting SLA when combining multiple services that support an application, with differing levels of availability. The composite SLA can be higher or lower than the individual SLAs, depending on the application architecture and the logical operations (AND or OR) used to calculate it.

For example, consider an Azure App Service web app that writes to Azure SQL Database. Hypothetically, these SLAs might be:

  • App Service web apps = 99.95%
  • SQL Database = 99.99%

If either service fails, the whole application fails. The probability of each service failing is independent, so the composite SLA for this application is 99.95% × 99.99% = 99.94%. That's lower than the individual SLAs, which isn't surprising because an application that relies on multiple services has more potential failure points.

You can improve the composite SLA by creating independent fallback paths. For example, if SQL Database is unavailable, put transactions into a queue to be processed later. With this design, the application is still available even if it can't connect to the database. However, it fails if the database and the queue both fail at the same time. The expected percentage of time for a simultaneous failure is 0.0001 × 0.001, so the composite SLA for this combined path is:

  • Database or queue = 1.0 − (0.0001 × 0.001) = 99.99999%

The total composite SLA is:

  • Web app and (database or queue) = 99.95% × 99.99999% = ~99.95%

There are tradeoffs to this approach. The application logic is more complex, you are paying for the queue, and you need to consider data consistency issues.

I hope this helps you understand what SLAs and composite SLAs are and how to calculate them.

Top comments (0)