This article was adapted from a Google Tech on the Toilet (TotT) episode. You can download a printer-friendly version of this TotT episode and post it in your office.

By Nimit Khandelwal and Chris Kennelly

On large software projects, even seemingly trivial choices can set assumptions that the codebase naturally evolves around, making them incredibly expensive to fix later.

To help achieve decision velocity without accumulating technical debt, leverage the “one-way vs. two-way doors” mental model:

- One-way doors: Decisions that are rare, highly consequential, and hard to reverse (e.g., picking a database backend).

- Two-way doors: Decisions that are low-risk and easy to walk back (e.g., choosing a local variable name).

Unless designing for flexibility, even trivial choices can quickly harden into painful one-way doors. To maintain high decision velocity safely, use deliberate architectural patterns to engineer reversibility into your code. Instead of coding yourself into a corner, actively design your code with built-in escape hatches. By consciously building flexibility into your systems up front, you can eliminate analysis paralysis and keep your team executing both fast and safely.

Here are some patterns you can use to build two-way-doors into your code:

This content was adapted from a Google Performance Tip of the Week: abseil.io/fast/87.