DevOps and Site Reliability Engineering
100 flashcards by MentisLibrary
How software reaches production and stays up: DORA metrics and trunk-based CI, deployment strategies and GitOps, Terraform and immutable infrastructure, Docker and Kubernetes, metrics, logs and traces, SLOs and error budgets, and pipeline security.
- What does the CALMS acronym stand for?
- Culture, Automation, Lean, Measurement and Sharing: the five dimensions used to assess how far an organisation has actually adopted DevOps rather than just renamed a team.
- What are the Three Ways of DevOps?
- The First Way is flow, optimising the whole system from development to operations. The Second Way is feedback, creating fast feedback loops from right to left. The Third Way is continual learning and experimentation.
- What are the four DORA metrics?
- Deployment frequency, lead time for changes, change failure rate, and time to restore service. Later research added a fifth measure of operational reliability.
- Why do speed and stability rise together rather than trade off?
- Because small, frequent changes are easier to review, test and reverse. Large batches concentrate risk, make the cause of a failure ambiguous, and lengthen recovery.
- What is Conway's law, and what is the inverse manoeuvre?
- Conway's law says a system's architecture mirrors the communication structure of the organisation that built it. The inverse manoeuvre deliberately restructures teams to produce the architecture you want.
- What does "you build it, you run it" change in practice?
- The team that writes a service also operates it, carries its pager and owns its reliability. The feedback from operating it flows directly into design choices.
- What does shift left mean, and where does it stop being useful?
- Moving verification earlier: tests, security scanning, performance checks and reviews running at commit rather than before release. It stops being useful when the earlier check cannot see what it needs, such as real production traffic patterns.
- Blameless postmortem
- A written incident review that assumes everyone acted reasonably given the information they had, and looks for the system conditions that made the failure possible instead of the person who triggered it.
- Trunk-based development
- All developers integrate small changes into one shared trunk at least daily, with short-lived branches measured in hours. Incomplete work is hidden behind feature flags rather than in a long-running branch.
- What actually makes a pipeline continuous integration rather than a build server?
- Every developer merges to the mainline at least daily, each merge triggers an automated build and test run against the integrated code, and a broken build is fixed immediately in preference to any other work.
- What is a merge queue and what problem does it solve?
- A queue that tests each pull request against the tip of the trunk plus the changes ahead of it, merging only if that combination passes. It prevents two individually green changes from breaking the trunk together.
- What is a feature flag, and what are the main kinds?
- A runtime switch that decouples deploying code from releasing behaviour. Release flags hide unfinished work, experiment flags split traffic for testing, operational flags disable expensive features under load, and permission flags gate access by user.
- What does semantic versioning encode?
- A version MAJOR.MINOR.PATCH where MAJOR increments on an incompatible API change, MINOR on backwards-compatible new functionality, and PATCH on backwards-compatible bug fixes. Pre-release and build metadata may be appended.
- What is the test pyramid, and what is the ice cream cone anti-pattern?
- The pyramid puts many fast unit tests at the base, fewer integration tests above, and a small number of end-to-end tests at the top. The ice cream cone inverts it: mostly slow, flaky end-to-end tests over a thin unit layer.
- What is a build artifact, and why must it be immutable?
- The single packaged output of a build, such as a container image or a signed bundle, promoted unchanged through every environment. Rebuilding per environment means the thing you tested is not the thing you shipped.
- What is a hermetic or reproducible build?
- A build whose output depends only on declared, pinned inputs, with no network fetches of unpinned dependencies and no dependence on the machine's local state. The same inputs produce a bit-identical output.
- How do continuous delivery and continuous deployment differ?
- Continuous delivery means every change that passes the pipeline is in a releasable state and could be deployed with a button press. Continuous deployment removes the button: every passing change goes to production automatically.
- Compare rolling, blue-green and canary deployments.
- A rolling deployment replaces instances in batches, so both versions serve traffic during the roll. Blue-green stands up a full second environment and switches all traffic at once, giving an instant rollback. Canary sends a small share of traffic to the new version, watches metrics, then widens.
- Why is decoupling deployment from release important?
- Deployment puts code on the infrastructure; release exposes behaviour to users. Separating them lets you deploy at any time with no user-visible effect, then choose the release moment independently, and reverse it without a redeploy.
- What is the expand and contract pattern for database migrations?
- A three-phase change: expand the schema additively so old and new code both work, migrate the code and backfill the data, then contract by removing the old column or table once nothing reads it.
- Progressive delivery
- Rolling a change out in stages defined by audience and automatically driven by health signals: internal users, then a percentage of traffic, then geographies, with automated rollback when a metric breaches its threshold.
- GitOps
- An operating model in which the declared desired state of the system lives in version control, and an in-cluster agent continuously reconciles the running state toward it, correcting any drift.
- Pull-based versus push-based deployment
- In a push model the CI system holds production credentials and applies changes outward. In a pull model an agent inside the target environment reads the desired state and applies it, so no external system needs write access.
- Declarative versus imperative infrastructure
- Declarative code states the desired end state and lets the tool compute the changes needed. Imperative code specifies the steps to take. Declarative definitions are idempotent and can be diffed against reality.
- What does a Terraform plan do, and why review it?
- It compares the configuration against recorded state and the real provider, then prints the exact create, update, replace and destroy actions it intends to take, without changing anything.
- Why does infrastructure state need locking and a remote backend?
- State records the mapping from configuration to real resources. Two concurrent applies against one state can corrupt it or duplicate resources, so the backend takes a lock. A remote backend also keeps state off individual laptops.
- What is infrastructure drift, and how is it handled?
- Divergence between the declared configuration and the real environment, usually caused by a manual console change. It is detected by a plan or a scheduled drift check, and resolved by either re-applying the code or importing the change into it.
- Immutable infrastructure
- Servers are never modified in place. A change produces a new image or container which replaces the old instance entirely, so every running instance came from a known build.
- How does configuration management differ from provisioning?
- Provisioning creates the resources: networks, virtual machines, managed services. Configuration management installs and configures software on machines that already exist, converging them toward a described state.
- Why does idempotence matter in automation?
- An idempotent operation produces the same end state whether it runs once or many times, so a partially failed run can simply be re-run. Without it, retrying is dangerous and every failure needs manual inspection.