# Best Practices

## **Stability vs. Productivity**

* **Goal:** Balance system **stability** with developer **productivity**.
* **Exploratory coding:** Temporary code for problem exploration; not meant for production.
* **Production systems:** Prioritize stability, but reliable processes should also **enhance productivity**.
  * **Faster bug detection and fixes** in reliable systems.
  * Focus on system **performance** and **functionality**.

***

## **Boring = Good**

* In software, "boring" systems are **predictable** and stable.
* **Essential complexity:** Unavoidable complexity inherent to a problem.
* **Accidental complexity:** Extra complexity introduced by poor design choices (e.g., Java's garbage collection in a web server).
* **SRE's job:** Minimize accidental complexity.

***

## **Eliminate Dead Code**

* **Unused code = Liability**
  * Creates confusion and increases the risk of bugs.
  * **Negative lines of code:** Removing unnecessary code can be more valuable than adding features.
  * Smaller codebase = **Easier to maintain and understand**.

***

## **Minimal APIs**

* **Fewer methods and arguments = Easier to use and maintain.**
* Simplicity in API design improves focus on core functionality.
* **Antoine de Saint-Exupery quote:** "Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away."

***

## **Modularity**

* **Loose coupling = Flexibility and scalability.**
  * Independent updates to system components minimize disruption.
  * Apply to distributed systems and APIs.
* **Versioning APIs** allows for smooth upgrades without breaking dependencies.
* Modular systems help manage growing complexity.

***

## **Simple Releases**

* **Releases should be incremental**—small batches, not big ones.
  * Easier to test and troubleshoot.
  * If many changes are released together, it’s harder to track down the cause of any issues.
* Incremental releases = more control, faster progress.

***

## **Key Points to Remember**

* **Simplicity = Reliability**: Keeping things simple helps ensure systems are more reliable.
* **Boring is good**: Predictable, stable systems are the goal.
* **Focus on clarity**: Eliminate unnecessary code and complexity.
* **Minimalism in design**: Smaller APIs and modular systems are easier to maintain and scale.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.mikaelsamvelian.com/devops-knowledge/sre/best-practices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
