Ways to persist, a reminder
I already wrote about persistence, now some diagrams to be more specific about some of them:
External
external
+------+
.......| /etc |.......
: +------+ :
: :
+--------------+ +--------------+
| | | |
| layer-1 | | layer-2 |
| | | |
+--------------+ +--------------+
The most easy approach to persist data residing in /etc
, is to keep
/etc
on a separate volume is shared between layers. etc
will be kept
external of the layers.
Copy
copy
...........................
: :
: :
+------+ +------+
+-------+ /etc + +-------+ /etc +
| +------+ | +------+
| | | |
| layer-1 | | layer-2 |
| | | |
+--------------+ +--------------+
Another way is to copy the state from layer-1
to the next layer,
possibly applying some logic to update the configuration files if
necessary.
Merge
3-way-merge
...........................
(1) : :
: ................... : .......
: : `:´ :
: : (2) : : (3)
+------+ : +------+ :
+-------+ /etc + : +-------+ /etc + :
| +------+ : | +------+ :
| |... | |....
| layer-1 | | layer-2 |
| | | |
+--------------+ +--------------+
3-way merging is actually a specialization of the copy method. The
reason is that a way merge can be seen as copying the existing
configurtaion and applying the changes, which were also done to the
changes applied to layer-1
.
All of the previous approaches were context-free, in the sense that they could be applied to all configuration as long as it was plaintext.
Individual
individual
............. a ...............
: ........... b ............. :
: : ......... c ........... : :
: : : : : :
+------+ +------+
+-------+ /etc + +-------+ /etc +
| +------+ | +------+
| | | |
| layer-1 | | layer-2 |
| | | |
+--------------+ +--------------+
With individual I am referring to a method, were some service is
deciding how a specific configuration file should be migrated from
layer-1
to layer-2
. That service can for sure use the simple copy
or merge approach, but it could also apply some advanced logic to
evenm migrate binary files.
::: {#footer} [ December 2nd, 2014 10:57pm ]{#timestamp} [node]{.tag} [persist]{.tag} [3way]{.tag} [merge]{.tag} [reminder]{.tag} [imgbase]{.tag} [imgbased]{.tag} :::