All persistent data must be written to the
/data directory. If the node you are working on utilizes a database (like Postgres) to store data reliably, ensure this is configured to save information to this directory (and in a manner that would not corrupt any data stored by the core node process or other necessary services). It must be possible to stop all services defined in the Dockerfile and restart them (without corruption) using only the state stored in this
Easy Single Volume Mounting
One major perk of having all data in
/data is that mounting storage is trivial. If data was spread out across multiple folders, it would be necessary to mount multiple volumes (with each implementation likely using different volumes).
Straightforward Data Migrations
If the format of stored data on a node changes, it can require running a series of scripts to update a variety of files at different paths. Because all useful data is in
/data and at locations determined by the asset issuer, it is much easier to write and test migration scripts.
Was this helpful?