On Tue, Aug 14, 2018 at 6:13 PM Alek Paunov <a...@declera.com> wrote:

> I am curious, Did you considered adapting writing in your use-case to
> Bedrock? AFAIK, you can read from Bedrock instance DBs safely without
> further adaptation.
>

Right, Bedrock is amazing, but in this particular use-case the only
available communication channel is the filesystem.

For the interested:

In NixOS (http://nixos.org), a very interesting Linux distribution, the
entire OS (libraries, binaries, shared files, up to and including
configuration files) is composed out of "build products" that are addressed
by "input hash".

The input hash is calculated on everything that is used to generate the
build product from scratch. For a text file, this is simply the content
hash of the text. For a binary, it is the input hash of the compiler,
libraries, build scripts, and all the build flags, plus the content hash of
the source, all hashed together.

A build product (whether file or directory) is stored in /nix/store/<input
hash>-human-readable-name.

If you assume that a given input hash will always result in the same build
product, you can just check if what you want exists at /nix/store/... and
if so, use that. NixOS uses a sqlite db to manage metadata.

The entire OS image is simply a build product consisting of all the
composing packages symlinked together, with an activation script that sets
up the filesystem and runs daemons. This image is symlinked to
/run/current-system.

Upgrading, downgrading, patching, configuring etc are all done by building
a new image from scratch and replacing that symlink. All these actions are
therefore atomic (this is the mindblowing part about NixOS).

Furthermore, since input hashes stay mostly the same, building a new image
happens in a matter of seconds most of the time since everything besides
what you changed gets reused (more mind blowing).

And so the problem I was idly musing about, is that of running Linux
Vagrant VMs on OS X, while sharing my /nix/store over NFS. That way the VMs
can stay small, plus their build products are retained between launches.
Since the OS type is part of the input hash, there is no problem sharing
the store between OS X and Linux.

And that would Just Work, were it not for the sqlite-over-NFS-exploding
hiccup :)

That said, from what Rowan wrote, I should just try it, and simply avoid
concurrent builds (and make backups).
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to