· 5 min read
Introduction to Site Reliability Engineering
Ler em português →I often roam the lands of the dev bubble on “Xwitter”, and Site Reliability Engineering is a topic that comes up constantly. Surprisingly enough (or perhaps not), the term SRE was being ridiculed through dozens of comments claiming that it didn’t work in practice. The funniest part was seeing comments from people who have no idea what SRE actually is claiming that it doesn’t work. Before criticizing something and making comments about it, we first need to understand what we’re actually talking about. After all, if we’re talking about something created by Google, it certainly isn’t trivial.
What is Site Reliability Engineering?
The term, coined by Ben Treynor Sloss, is widely used today by large companies. There’s little point in building software at scale if it can’t keep itself running and we have no control over it. As Ben himself put it: “SRE is what happens when you ask a software engineer to design an operations team.”
In other words, SRE is an engineering approach to solving problems traditionally associated with system operations. Instead of relying exclusively on manual processes and human intervention, we apply software engineering principles to automate tasks, improve reliability, and make systems more resilient.
This means that SRE isn’t just about configuring dashboards, creating alerts, or keeping servers running. All of these can be part of the job, but the goal is much broader: ensuring that systems meet user expectations without compromising development speed.
How do you practice SRE?
First, we need to understand that reliability doesn’t mean keeping a system available 100% of the time at any cost. After all, that’s unfeasible, expensive, and reaaally difficult to achieve. Moreover, the cost-to-benefit ratio becomes absurdly unbalanced for very little potential gain, since users will hardly notice the difference between a system with 100% availability and one with 99% availability.
Before explaining the fundamentals of SRE, we need to understand what we’re measuring and what criteria have been defined by stakeholders. Consider that a bakery’s system certainly won’t have the same reliability target as a critical public safety communication system. Therefore, it makes no sense to establish goals and commitments without first understanding what actually needs to be guaranteed. To understand what is being measured, we consider three fundamental SRE concepts: SLI, SLO, and SLA.
- SLI (Service Level Indicator): a metric that measures some aspect of the user experience, such as latency, availability, or error rate.
- SLO (Service Level Objective): the target we establish for that metric. For example, we might want 99.9% of requests to succeed over a given period.
- SLA (Service Level Agreement): a formal agreement that establishes service commitments and the consequences of failing to meet them.
These concepts allow us to make data-driven decisions instead of simply reacting to incidents or pursuing arbitrary numbers.
Another important concept is the error budget. If our SLO establishes 99.9% availability, we have a 0.1% margin for unavailability within the period being considered. This budget helps us balance system stability with the speed at which we deliver new features.
If we’re consuming this budget rapidly, we may need to prioritize reliability improvements. If we’re within the expected limits, we may have more freedom to experiment and release changes.
Notice that this isn’t about preventing deployments or creating bureaucracy (although sometimes that’s inevitable), but rather about making conscious decisions regarding the risks we’re willing to take.
SRE best practices
There are several fundamental practices for anyone who wants to implement SRE properly:
- Automation: repetitive operational tasks should be automated whenever possible. In addition to reducing human error, this frees up time to address structural problems.
- Observability: we need to understand system behavior through metrics, logs, and traces. Collecting data isn’t enough; we need to turn it into useful information that helps us identify and investigate problems.
- Monitoring based on user experience: alerts should indicate relevant problems, preferably those related to our service level objectives, rather than simply firing because a metric has crossed an arbitrary threshold.
- Incident management: incidents require clear processes for response, communication, and recovery. Afterward, we should investigate their causes and identify opportunities for improvement.
- Blameless postmortems: when something goes wrong, the goal shouldn’t be to find someone to blame, but to understand the conditions that allowed the incident to happen and how we can prevent it from happening again.
- Toil reduction: this term, widely used in SRE literature, describes repetitive, manual, and often reactive operational work that doesn’t produce lasting value. Identifying and reducing it is essential so that the team can invest in engineering improvements.
These practices complement one another. There’s little point in having an excellent observability platform if nobody knows how to respond to an incident, just as there’s little point in automating processes without understanding whether they actually contribute to reliability.
Where should you start?
If you’ve made it this far and want to better understand how to apply these concepts, my main recommendation is the book Site Reliability Engineering book from Google, which is available for free from Google itself. Although it’s quite extensive, it’s genuinely an essential book to have on hand if you want to explore the field of SRE.
The book covers everything from SRE fundamentals to topics such as monitoring, SLOs, incident management, release engineering, and automation. The most interesting part is that it doesn’t just present abstract concepts; it also explains how these principles are applied to the operation of real-world systems.
Start by understanding the main reliability indicators for your service, establishing clear objectives, improving your alerts, and looking for opportunities to eliminate repetitive operational tasks. From there, you can evolve gradually.
Ultimately, SRE isn’t a tool, a specific job title, or a collection of best practices that you can simply copy from one company to another. It’s a way of thinking about reliability and applying engineering principles to improve it continuously.
Perhaps the problem isn’t that SRE doesn’t work in practice, but that many companies and engineers try to implement it without understanding the principles behind it, let alone knowing what they’re measuring. And, as with any engineering approach, copying practices without understanding the problems they’re intended to solve is unlikely to produce good results.