Alex Fernández
Physicist by education
Software engineer by trade
Reversibility and Irreversibility
Software Development
Software Architecture
DevOps
Decision Making
Not reversible computing
Not reverse engineering
Not thermodynamics
nor information theory
Not hard-core science
heat
energy
chaos
disorder
irreversibility
uncertainty
degradation
complexity
Want to know what "entropy" is?
Who cares, just worry about reversibility!
A reversible system:
Is the most efficient process
Can be reversed in time
using no extra energy
Can work in either direction
Takes the system back to its initial state
with no side effects
The process must be infinitely slow
Cannot have side effects:
no way to know it has happened
Oh and by the way:
it is impossible in the real world
Efficiency
Stability
Predictability
Slowness
Is inefficient (but necessary)
Can be reversed in time
(at least for our system)
Can work in either direction
Takes the system back to its initial state
with some side effects
Uses an efficient process
CRUD:
Create ↔ Delete
Update
Read
Self-contained test: leaves the system intact
But the tests have side effects
Speed
Turbulence
Chaos
Complexity
Works in cycles
Each cycle costs some effort
Each cycle can be reversed
at a small cost
Small cycles are better than big cycles
CVS stores changes in a log file
SVN stores revisions as diffs
Git stores history in deltas
Easy to go back to any previous HEAD
Easy to revert a previous commit
Easy to truncate history and reset
GUI application with commands
Each command can be undone
... and redone
Much easier to try out changes
Small cycles of write-compile-link-run
Bigger cycles of write-test-debug-fix
Large cycles of write-integrate-deploy
The smaller the cycle, the most efficient the process
Every request is self-contained
No context is stored in the server
The client maintains the state of the client
Can be parallelized
Does not hold any state in memory
(except for cached data)
Can be reset at will
All information is dumped on external systems
(and in log files)
Pile your heat onto an exhaust!
Information is not “negative entropy”
Entropy is the same as information!
Pile your information onto an “exhaust”
Information exhausts:
Avoid breaking existing APIs
Please don't
Keep backwards compatibility
... and forwards compatibility!
Warn about deprecated functions
OK to remove if there are no users
More compatibility shims
Forwards-backwards compatibility
Example: Python 2.x → 3.x migration
and 3.x → 2.x migration!
The reversible process is always at equilibrium
System is stable when it passes the tests
Don't let your system stray from equilibrium
It is much harder to get it back on track
Do your development in small steps
Pass your test suites often
After integration should go back to its initial state
Should be repeatable
Ideal environment: created ad hoc
and then destroyed
like Travis-CI
Disk snapshots
OS snapshots
Cloud: ubiquitous snapshots
Allow immediate rollbacks to previous states
Differential snapshots
Roll back one feature while keeping another
E.g.: rollback OS, keep applications
Version control for configuration files
Put your code in production
Deploy in small increments
Immediate rollbacks
Automatic rollbacks
Make it easier to go to a previous time
and then to go forward again!
Automatic rollbacks should be easier
and ubiquitous
Cycle is made of two parts
First deploy inactive code
Then activate feature
Both parts are reversible
... are irreversible by nature
A repeatable process can approach reversibility
Lots of irreversible steps
Closed tasks are not revisited
Features are released only when ready
Tasks can be reopened if needed
and it is not a failure!
Features can be perfected
Releases focus on improvements
Small releases better than big changes
E.g.: Linux 2.4.x -> 2.6.x: big ugly change
Linux 2.6.x -> 3.x: continuous improvement
Avoid releases if at all possible
Rolling releases are the best!
Thus the key to avoiding big decisions becomes to just avoiding to do things that can’t be undone. Don’t get ushered into a corner from which you cannot escape. A cornered rat may be dangerous - a cornered manager is just pitiful.
https://slid.es/alexfernandez/reversible-engineering
All pictures from Wikimedia Foundation
published under CC license