4 ms·
Out of curiosity, how do you handle deployment of databases on nixOS? I'm curious how others run stateful services on nix
by jonaf 11y ago
Out of curiosity, how do you handle deployment of databases on nixOS? I'm curious how others run stateful services on nix
- danharaj 11y agoSo at Obsidian Systems[1]*, my current shop, we deploy by building the entire system image and then transferring it to the server, and then activating the server. The NixOS master config file lets you specify global services like a PostgreSQL server and its initialization script. [1] https://obsidian.systems/ https://obsidian.systems/
- davexunit 11y agoI can't speak for NixOS specifically, but in GuixSD (a closely related project) this is handled at the service layer, an I imagine the same must be true for NixOS. The OS declaration specifies that, for example, the PostgreSQL daemon should be running with a specific configuration and the init system will run it when the system is instantiated. Your database runs as normal, and you would back up your state as normal. Functional configuration management provides an extremely clean separation of stateless from the stateful.