Comparison
Copy-on-writevsImmutable infrastructure
Copy-on-write
the copy was free until somebody wrote to it, and only then did the data actually get duplicated.
Sharing one underlying representation between a value and its copies until one of them is modified, at which point that one is duplicated. It gives value semantics at reference-semantics cost for the common read-only case, and it is how several standard library collections and most process forks work. Its performance cliff is the write nobody expected to be expensive, which is the same shape as every other lazy optimisation.
Full entry →Immutable infrastructure
you never patch a running server; you build a new image and replace the instance entirely.
Treating deployed artefacts as read-only and replacing rather than modifying them. It eliminates configuration drift and makes environments reproducible from source. It requires the build and replace cycle to be fast, and it makes stateful nodes the special case that needs a real plan.
Full entry →