SlideShare a Scribd company logo
1 of 30
Download to read offline
Dysnomia: complementing Nix deployments with
state deployment
Sander van der Burg
October 26, 2018
Sander van der Burg Dysnomia
The Nix project: Declarative deployment
Nix – declarative specification of package build procedures
(including their dependencies)
NixOS – declarative specification of system aspects
NixOps – declarative specification of a network of machines
Disnix – declarative specifications of services, machines and
distribution of services over machines
Deployment activities are implicit – a user writes or adapts a deploy-
ment specification, and the tools will carry out the required activities,
such as building, transfering, activating, and deactivating.
Sander van der Burg Dysnomia
The Nix project: Non-functional properties
Automated deployment using declarative specifications with the
following properties:
Generic. Can be used with many programming languages,
component technologies, and operating systems.
Reproducible. (Almost) no impurities – if inputs are the same,
result should be the same regardless of its location
Reliable. Dependency completeness, (almost) atomic
upgrades and rollbacks.
Efficient. Only the required deployment activities are
executed.
Sander van der Burg Dysnomia
Deploying a NixOS configuration
{ pkgs, ... }:
{
services.mysql = {
enable = true;
package = pkgs.mysql;
};
services.httpd = {
enable = true;
documentRoot = "/var/www";
adminAddr = "admin@localhost";
enablePHP = true;
};
...
}
$ nixos-rebuild switch
Sander van der Burg Dysnomia
Deploying a NixOS configuration
{ pkgs, ... }:
{
services.mysql = {
enable = true;
package = pkgs.mysql;
};
services.httpd = {
enable = true;
documentRoot = "/var/www";
adminAddr = "admin@localhost";
enablePHP = true;
};
...
}
$ nixos-rebuild switch
Sander van der Burg Dysnomia
Deploying NixOS
With a NixOS configuration file, we can reproduce the exact
same configuration elsewhere.
Managing state
But, what about my databases?
Nix only manages the static parts of a system, not any state.
Sander van der Burg Dysnomia
Managing service-oriented systems with Disnix
Service-oriented systems may have many database components:
Sander van der Burg Dysnomia
Managing service-oriented systems with Disnix
To be flexible, we must redeploy regularly respond to events, such
as:
Load increases → distribute services over more machines
Load decreases → consolidate servers and retire obsolete
machines
A machine crashes → redistribute missing services
Sander van der Burg Dysnomia
Managing service-oriented systems with Disnix
To be able to migrate state, automation is required!
Sander van der Burg Dysnomia
Dysnomia: providing complementary state deployment
Sander van der Burg Dysnomia
Dysnomia: Concepts
Mutable component. A unit of state.
Container. An environment that can host one or more
mutable components.
Dysnomia module. An executable implementing deployment
activities for a given component type.
Sander van der Burg Dysnomia
Dysnomia: Components
Component configurations capture the (static) initial state of a
component in a container. Examples:
mysql-database: DDL instructions that set up the database
schema
tomcat-webapplication: a Java web application archive (WAR
file)
process: An executable in the bin/ sub folder that should be
launched on startup
Initial state can be generated by a Nix expression.
Sander van der Burg Dysnomia
Dysnomia: Example component configuration
˜/testdb
create table author
( AUTHOR_ID INTEGER NOT NULL,
FirstName VARCHAR(255) NOT NULL,
LastName VARCHAR(255) NOT NULL,
PRIMARY KEY(AUTHOR_ID)
);
create table books
( ISBN VARCHAR(255) NOT NULL,
Title VARCHAR(255) NOT NULL,
AUTHOR_ID INTEGER NOT NULL,
PRIMARY KEY(ISBN),
FOREIGN KEY(AUTHOR_ID) REFERENCES author(AUTHOR_ID)
ON UPDATE CASCADE ON DELETE CASCADE
);
Sander van der Burg Dysnomia
Dysnomia: Containers
A key = value pair configuration file describing the properties of a
container:
˜/mysql-prod
type=mysql-database
mysqlUsername=root
mysqlPassword=verysecret
One mandatory property: type that refers to Dysnomia
module that executes deployment activities.
Remainder of the properties are arbitrary. They are exposed as
environment variables to the Dysnomia module that executes
deployment activities.
Sander van der Burg Dysnomia
Dysnomia: Modules
An executable that takes two command-line parameters:
Activity to execute
Path to the initial state of the component
There are no restrictions imposed on what modules can do.
Modules follow conventions.
Sander van der Burg Dysnomia
Dysnomia: Modules
#!/bin/bash -e
case "$1" in
activate)
echo "Echo module: Activate service: $2"
;;
deactivate)
echo "Echo module: Deactivate service: $2"
;;
snapshot)
echo "Echo module: Snapshot state of service: $2"
;;
restore)
echo "Echo module: Restore state of service: $2"
;;
collect-garbage)
echo "Echo module: Collect garbage of service: $2"
;;
esac
Sander van der Burg Dysnomia
Dysnomia: executing deployment activities generically
Create and initialize a database:
$ dysnomia --operation activate 
--component ~/testdb 
--container ~/mysql-prod
Take a snapshot of a database’s current state:
$ dysnomia --operation snapshot 
--component ~/testdb 
--container ~/mysql-prod
Mark a database as obsolete:
$ dysnomia --operation deactivate 
--component ~/testdb 
--container ~/mysql-prod
Sander van der Burg Dysnomia
Dysnomia: executing deployment activities generically
Delete a database that has been marked as obsolete:
$ dysnomia --operation collect-garbage 
--component ~/testdb 
--container ~/mysql-prod
Create and initialize a database again:
$ dysnomia --operation activate 
--component ~/testdb 
--container ~/mysql-prod
Restore the last database snapshot:
$ dysnomia --operation restore 
--component ~/testdb 
--container ~/mysql-prod
Sander van der Burg Dysnomia
Dysnomia: managing snapshots
Dysnomia provides a snapshot store that manages multiple genera-
tions of snapshots:
$ dysnomia-snapshots --query-all
mysql-production/testdb/9b0c3562b57dafd00e480c6b3a...
mysql-production/testdb/1df326254d596dd31d9d9db30e...
mysql-production/testdb/330232eda02b77c3629a4623b4...
Each component type follows its own naming convention for
snapshots
The MySQL module computes the SHA256 hash of the
output and uses it as the snapshot name
Sander van der Burg Dysnomia
Dysnomia: managing snapshots
We can automatically delete obsolete snapshots:
$ dysnomia-snapshots --gc --keep 3
The above command keeps the last 3 snapshot generations and
removes the remainder.
Sander van der Burg Dysnomia
Deploying a NixOS configuration with state
{ pkgs, ... }:
{
services = {
mysql = {
enable = true;
package = pkgs.mysql;
};
httpd = {
enable = true;
documentRoot = "/var/www";
adminAddr = "admin@localhost";
enablePHP = true;
};
dysnomia = {
enable = true;
components.mysql-database.testdb = ./testdb;
};
};
}
$ nixos-rebuild switch
$ dysnomia-containers --deploy
Sander van der Burg Dysnomia
Enabling state deployment in Disnix
{distribution, invDistribution, pkgs, system}:
let
customPkgs = import ../top-level/all-packages.nix {
inherit pkgs system;
};
in
rec {
portaldb = {
name = "portaldb";
pkg = customPkgs.portaldb;
type = "mysql-database";
deployState = true;
};
...
}
State deployment is disabled by default
Annotate each relevant service with deployState = true;
Enable globally by providing the --deploy-state parameter
or by setting the DISNIX DEPLOY STATE environment variable
Sander van der Burg Dysnomia
Migrating databases with Disnix
{infrastructure}:
{
usersdb = [ infrastructure.test1 ];
cmsdb = [ infrastructure.test2 ];
cmsgallerydb = [ infrastructure.test1 ];
homeworkdb = [ infrastructure.test2 ];
literaturedb = [ infrastructure.test1 ];
portaldb = [ infrastructure.test2 ];
}
$ disnix-env -s services.nix -i infrastructure.nix -d distribution.nix
Updating the location of a database in the distribution model and
redeploying the system also migrates state from one machine to
another.
Sander van der Burg Dysnomia
Disnix: snapshots and restores
It is also possible to use Dysnomia as a primitive backup tool.
To take a snapshot of all deployed mutable components, run:
$ disnix-snapshot
To restore an individual database’s state:
$ disnix-restore --component portaldb
Sander van der Burg Dysnomia
Demo
Sander van der Burg Dysnomia
Is the state deployment problem solved?
Sander van der Burg Dysnomia
Drawbacks
Not all state can be managed by Dysnomia. It only works
with well separated units of state.
Impractical to e.g. manage user accounts and groups
Dysnomia relies on exporting and syncing state to the
filesystem.
May be too expensive (in terms of storage) and time
consuming for large data sets
Impractical to use on a system level in a network.
A snapshot of the entire system is taken. Difficult to manage
components individually.
Dysnomia works well for (large) collections of small data.
It is possible to manage ˜100 MongoDB databases with sizes
between several megabytes/several gigabytes
Sander van der Burg Dysnomia
Alternative approaches
Filesystem-level snapshots:
An experimental version of Nix called S-Nix has been developed
using Ext3COW (2008): http://www.cs.uu.nl/education/
scripties/scriptie.php?SID=INF/SCR-2007-053
Faster, cheaper
Difficult to guarantee portability and consistency.
Partition-level snapshots:
NixOps is capable of taking EBS snapshots
Faster, cheaper
Works on system-level. Hard to manage individual databases.
Use database replication engines:
More efficient, no additional storage required beyond the
binary log
Hard to generalize in a framework.
Sander van der Burg Dysnomia
Availability
Dysnomia can be used as an independent tool:
https://github.com/svanderburg/dysnomia
Does not require Nix or any Nix-related tools
Integrated in NixOS, by enabling the
services.dysnomia.enable = true; setting
All relevant Dysnomia modules and container configurations
are configured automatically
Integrated in Disnix
Dysnomia should be considered an advanced prototype tool!
Sander van der Burg Dysnomia
Questions
Sander van der Burg Dysnomia

More Related Content

What's hot

Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...DataStax Academy
 
High Availability with Novell Cluster Services for Novell Open Enterprise Ser...
High Availability with Novell Cluster Services for Novell Open Enterprise Ser...High Availability with Novell Cluster Services for Novell Open Enterprise Ser...
High Availability with Novell Cluster Services for Novell Open Enterprise Ser...Novell
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelOpenVZ
 
Introduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and ConsistencyIntroduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and ConsistencyBenjamin Black
 
Namespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersNamespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersKernel TLV
 
Advanced Namespaces and cgroups
Advanced Namespaces and cgroupsAdvanced Namespaces and cgroups
Advanced Namespaces and cgroupsKernel TLV
 
Linux cgroups and namespaces
Linux cgroups and namespacesLinux cgroups and namespaces
Linux cgroups and namespacesLocaweb
 
Automating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with PuppetAutomating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with Puppetbuildacloud
 
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...DataStax Academy
 
Beginning Operations: 7 Deadly Sins for Apache Cassandra Ops
Beginning Operations: 7 Deadly Sins for Apache Cassandra OpsBeginning Operations: 7 Deadly Sins for Apache Cassandra Ops
Beginning Operations: 7 Deadly Sins for Apache Cassandra OpsDataStax Academy
 
An Overview of Apache Cassandra
An Overview of Apache CassandraAn Overview of Apache Cassandra
An Overview of Apache CassandraDataStax
 
DTrace in the Non-global Zone
DTrace in the Non-global ZoneDTrace in the Non-global Zone
DTrace in the Non-global Zonebcantrill
 
Windows server 2012 failover clustering new features
Windows server 2012 failover clustering new featuresWindows server 2012 failover clustering new features
Windows server 2012 failover clustering new featuresJoseph D'Antoni
 
BACD July 2012 : The Xen Cloud Platform
BACD July 2012 : The Xen Cloud Platform BACD July 2012 : The Xen Cloud Platform
BACD July 2012 : The Xen Cloud Platform The Linux Foundation
 
Operations, Consistency, Failover for Multi-DC Clusters (Alexander Dejanovski...
Operations, Consistency, Failover for Multi-DC Clusters (Alexander Dejanovski...Operations, Consistency, Failover for Multi-DC Clusters (Alexander Dejanovski...
Operations, Consistency, Failover for Multi-DC Clusters (Alexander Dejanovski...DataStax
 
Securing your cloud with Xen's advanced security features
Securing your cloud with Xen's advanced security featuresSecuring your cloud with Xen's advanced security features
Securing your cloud with Xen's advanced security featuresThe Linux Foundation
 

What's hot (20)

DTraceCloud2012
DTraceCloud2012DTraceCloud2012
DTraceCloud2012
 
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
 
High Availability with Novell Cluster Services for Novell Open Enterprise Ser...
High Availability with Novell Cluster Services for Novell Open Enterprise Ser...High Availability with Novell Cluster Services for Novell Open Enterprise Ser...
High Availability with Novell Cluster Services for Novell Open Enterprise Ser...
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux Kernel
 
Introduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and ConsistencyIntroduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and Consistency
 
Namespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersNamespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containers
 
Advanced Namespaces and cgroups
Advanced Namespaces and cgroupsAdvanced Namespaces and cgroups
Advanced Namespaces and cgroups
 
Namespaces in Linux
Namespaces in LinuxNamespaces in Linux
Namespaces in Linux
 
Linux cgroups and namespaces
Linux cgroups and namespacesLinux cgroups and namespaces
Linux cgroups and namespaces
 
Automating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with PuppetAutomating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with Puppet
 
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
 
Presentation
PresentationPresentation
Presentation
 
Implementing dr w. hyper v clustering
Implementing dr w. hyper v clusteringImplementing dr w. hyper v clustering
Implementing dr w. hyper v clustering
 
Beginning Operations: 7 Deadly Sins for Apache Cassandra Ops
Beginning Operations: 7 Deadly Sins for Apache Cassandra OpsBeginning Operations: 7 Deadly Sins for Apache Cassandra Ops
Beginning Operations: 7 Deadly Sins for Apache Cassandra Ops
 
An Overview of Apache Cassandra
An Overview of Apache CassandraAn Overview of Apache Cassandra
An Overview of Apache Cassandra
 
DTrace in the Non-global Zone
DTrace in the Non-global ZoneDTrace in the Non-global Zone
DTrace in the Non-global Zone
 
Windows server 2012 failover clustering new features
Windows server 2012 failover clustering new featuresWindows server 2012 failover clustering new features
Windows server 2012 failover clustering new features
 
BACD July 2012 : The Xen Cloud Platform
BACD July 2012 : The Xen Cloud Platform BACD July 2012 : The Xen Cloud Platform
BACD July 2012 : The Xen Cloud Platform
 
Operations, Consistency, Failover for Multi-DC Clusters (Alexander Dejanovski...
Operations, Consistency, Failover for Multi-DC Clusters (Alexander Dejanovski...Operations, Consistency, Failover for Multi-DC Clusters (Alexander Dejanovski...
Operations, Consistency, Failover for Multi-DC Clusters (Alexander Dejanovski...
 
Securing your cloud with Xen's advanced security features
Securing your cloud with Xen's advanced security featuresSecuring your cloud with Xen's advanced security features
Securing your cloud with Xen's advanced security features
 

Similar to Dysnomia: complementing Nix deployments with state deployment

A Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software ComponentsA Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software ComponentsSander van der Burg
 
nix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic frameworknix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic frameworkSander van der Burg
 
Deploying .NET services with Disnix
Deploying .NET services with DisnixDeploying .NET services with Disnix
Deploying .NET services with DisnixSander van der Burg
 
Nagios Conference 2011 - William Leibzon - Nagios In Cloud Computing Environm...
Nagios Conference 2011 - William Leibzon - Nagios In Cloud Computing Environm...Nagios Conference 2011 - William Leibzon - Nagios In Cloud Computing Environm...
Nagios Conference 2011 - William Leibzon - Nagios In Cloud Computing Environm...Nagios
 
The NixOS project and deploying systems declaratively
The NixOS project and deploying systems declarativelyThe NixOS project and deploying systems declaratively
The NixOS project and deploying systems declarativelySander van der Burg
 
Unleash software architecture leveraging on docker
Unleash software architecture leveraging on dockerUnleash software architecture leveraging on docker
Unleash software architecture leveraging on dockerAdrien Blind
 
Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...Codemotion
 
Deploying (micro)services with Disnix
Deploying (micro)services with DisnixDeploying (micro)services with Disnix
Deploying (micro)services with DisnixSander van der Burg
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentGerald Villorente
 
Automated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented SystemAutomated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented SystemSander van der Burg
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentSander van der Burg
 
Automating Mendix application deployments with Nix
Automating Mendix application deployments with NixAutomating Mendix application deployments with Nix
Automating Mendix application deployments with NixSander van der Burg
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentSander van der Burg
 
Fully fault tolerant real time data pipeline with docker and mesos
Fully fault tolerant real time data pipeline with docker and mesos Fully fault tolerant real time data pipeline with docker and mesos
Fully fault tolerant real time data pipeline with docker and mesos Rahul Kumar
 
Deploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package managerDeploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package managerSander van der Burg
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) serverDmitry Lyfar
 
Drupalcamp es 2013 drupal with lxc docker and vagrant
Drupalcamp es 2013  drupal with lxc docker and vagrant Drupalcamp es 2013  drupal with lxc docker and vagrant
Drupalcamp es 2013 drupal with lxc docker and vagrant Ricardo Amaro
 

Similar to Dysnomia: complementing Nix deployments with state deployment (20)

The Nix project
The Nix projectThe Nix project
The Nix project
 
A Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software ComponentsA Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software Components
 
nix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic frameworknix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic framework
 
Deploying .NET services with Disnix
Deploying .NET services with DisnixDeploying .NET services with Disnix
Deploying .NET services with Disnix
 
Nagios Conference 2011 - William Leibzon - Nagios In Cloud Computing Environm...
Nagios Conference 2011 - William Leibzon - Nagios In Cloud Computing Environm...Nagios Conference 2011 - William Leibzon - Nagios In Cloud Computing Environm...
Nagios Conference 2011 - William Leibzon - Nagios In Cloud Computing Environm...
 
The NixOS project and deploying systems declaratively
The NixOS project and deploying systems declarativelyThe NixOS project and deploying systems declaratively
The NixOS project and deploying systems declaratively
 
Unleash software architecture leveraging on docker
Unleash software architecture leveraging on dockerUnleash software architecture leveraging on docker
Unleash software architecture leveraging on docker
 
Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...
 
Deploying (micro)services with Disnix
Deploying (micro)services with DisnixDeploying (micro)services with Disnix
Deploying (micro)services with Disnix
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal Deployment
 
Automated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented SystemAutomated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented System
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software Deployment
 
With one click
With one clickWith one click
With one click
 
Automating Mendix application deployments with Nix
Automating Mendix application deployments with NixAutomating Mendix application deployments with Nix
Automating Mendix application deployments with Nix
 
The Nix project
The Nix projectThe Nix project
The Nix project
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
 
Fully fault tolerant real time data pipeline with docker and mesos
Fully fault tolerant real time data pipeline with docker and mesos Fully fault tolerant real time data pipeline with docker and mesos
Fully fault tolerant real time data pipeline with docker and mesos
 
Deploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package managerDeploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package manager
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
 
Drupalcamp es 2013 drupal with lxc docker and vagrant
Drupalcamp es 2013  drupal with lxc docker and vagrant Drupalcamp es 2013  drupal with lxc docker and vagrant
Drupalcamp es 2013 drupal with lxc docker and vagrant
 

More from Sander van der Burg

Using Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsUsing Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsSander van der Burg
 
Deploying NPM packages with the Nix package manager
Deploying NPM packages with the Nix package managerDeploying NPM packages with the Nix package manager
Deploying NPM packages with the Nix package managerSander van der Burg
 
Hydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The DetailsHydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The DetailsSander van der Burg
 
Hydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The BasicsHydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The BasicsSander van der Burg
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentSander van der Burg
 
Techniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processesTechniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processesSander van der Burg
 
A Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsA Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsSander van der Burg
 
Using NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testingUsing NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testingSander van der Burg
 
Disnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentDisnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentSander van der Burg
 
Pull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and ChallengesPull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and ChallengesSander van der Burg
 
Software Deployment in a Dynamic Cloud
Software Deployment in a Dynamic CloudSoftware Deployment in a Dynamic Cloud
Software Deployment in a Dynamic CloudSander van der Burg
 
Atomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsAtomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsSander van der Burg
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentSander van der Burg
 
Model-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talkModel-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talkSander van der Burg
 

More from Sander van der Burg (16)

The Monitoring Playground
The Monitoring PlaygroundThe Monitoring Playground
The Monitoring Playground
 
Using Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsUsing Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutions
 
Deploying NPM packages with the Nix package manager
Deploying NPM packages with the Nix package managerDeploying NPM packages with the Nix package manager
Deploying NPM packages with the Nix package manager
 
Hydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The DetailsHydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The Details
 
Hydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The BasicsHydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The Basics
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
 
Techniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processesTechniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processes
 
A Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsA Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented Systems
 
Using NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testingUsing NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testing
 
Pull Deployment of Services
Pull Deployment of ServicesPull Deployment of Services
Pull Deployment of Services
 
Disnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentDisnix: A toolset for distributed deployment
Disnix: A toolset for distributed deployment
 
Pull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and ChallengesPull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and Challenges
 
Software Deployment in a Dynamic Cloud
Software Deployment in a Dynamic CloudSoftware Deployment in a Dynamic Cloud
Software Deployment in a Dynamic Cloud
 
Atomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsAtomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed Systems
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software Deployment
 
Model-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talkModel-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talk
 

Recently uploaded

一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理F
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiMonica Sydney
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样ayvbos
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样ayvbos
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...kumargunjan9515
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Roommeghakumariji156
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...meghakumariji156
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsMonica Sydney
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查ydyuyu
 

Recently uploaded (20)

一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 

Dysnomia: complementing Nix deployments with state deployment

  • 1. Dysnomia: complementing Nix deployments with state deployment Sander van der Burg October 26, 2018 Sander van der Burg Dysnomia
  • 2. The Nix project: Declarative deployment Nix – declarative specification of package build procedures (including their dependencies) NixOS – declarative specification of system aspects NixOps – declarative specification of a network of machines Disnix – declarative specifications of services, machines and distribution of services over machines Deployment activities are implicit – a user writes or adapts a deploy- ment specification, and the tools will carry out the required activities, such as building, transfering, activating, and deactivating. Sander van der Burg Dysnomia
  • 3. The Nix project: Non-functional properties Automated deployment using declarative specifications with the following properties: Generic. Can be used with many programming languages, component technologies, and operating systems. Reproducible. (Almost) no impurities – if inputs are the same, result should be the same regardless of its location Reliable. Dependency completeness, (almost) atomic upgrades and rollbacks. Efficient. Only the required deployment activities are executed. Sander van der Burg Dysnomia
  • 4. Deploying a NixOS configuration { pkgs, ... }: { services.mysql = { enable = true; package = pkgs.mysql; }; services.httpd = { enable = true; documentRoot = "/var/www"; adminAddr = "admin@localhost"; enablePHP = true; }; ... } $ nixos-rebuild switch Sander van der Burg Dysnomia
  • 5. Deploying a NixOS configuration { pkgs, ... }: { services.mysql = { enable = true; package = pkgs.mysql; }; services.httpd = { enable = true; documentRoot = "/var/www"; adminAddr = "admin@localhost"; enablePHP = true; }; ... } $ nixos-rebuild switch Sander van der Burg Dysnomia Deploying NixOS With a NixOS configuration file, we can reproduce the exact same configuration elsewhere.
  • 6. Managing state But, what about my databases? Nix only manages the static parts of a system, not any state. Sander van der Burg Dysnomia
  • 7. Managing service-oriented systems with Disnix Service-oriented systems may have many database components: Sander van der Burg Dysnomia
  • 8. Managing service-oriented systems with Disnix To be flexible, we must redeploy regularly respond to events, such as: Load increases → distribute services over more machines Load decreases → consolidate servers and retire obsolete machines A machine crashes → redistribute missing services Sander van der Burg Dysnomia
  • 9. Managing service-oriented systems with Disnix To be able to migrate state, automation is required! Sander van der Burg Dysnomia
  • 10. Dysnomia: providing complementary state deployment Sander van der Burg Dysnomia
  • 11. Dysnomia: Concepts Mutable component. A unit of state. Container. An environment that can host one or more mutable components. Dysnomia module. An executable implementing deployment activities for a given component type. Sander van der Burg Dysnomia
  • 12. Dysnomia: Components Component configurations capture the (static) initial state of a component in a container. Examples: mysql-database: DDL instructions that set up the database schema tomcat-webapplication: a Java web application archive (WAR file) process: An executable in the bin/ sub folder that should be launched on startup Initial state can be generated by a Nix expression. Sander van der Burg Dysnomia
  • 13. Dysnomia: Example component configuration ˜/testdb create table author ( AUTHOR_ID INTEGER NOT NULL, FirstName VARCHAR(255) NOT NULL, LastName VARCHAR(255) NOT NULL, PRIMARY KEY(AUTHOR_ID) ); create table books ( ISBN VARCHAR(255) NOT NULL, Title VARCHAR(255) NOT NULL, AUTHOR_ID INTEGER NOT NULL, PRIMARY KEY(ISBN), FOREIGN KEY(AUTHOR_ID) REFERENCES author(AUTHOR_ID) ON UPDATE CASCADE ON DELETE CASCADE ); Sander van der Burg Dysnomia
  • 14. Dysnomia: Containers A key = value pair configuration file describing the properties of a container: ˜/mysql-prod type=mysql-database mysqlUsername=root mysqlPassword=verysecret One mandatory property: type that refers to Dysnomia module that executes deployment activities. Remainder of the properties are arbitrary. They are exposed as environment variables to the Dysnomia module that executes deployment activities. Sander van der Burg Dysnomia
  • 15. Dysnomia: Modules An executable that takes two command-line parameters: Activity to execute Path to the initial state of the component There are no restrictions imposed on what modules can do. Modules follow conventions. Sander van der Burg Dysnomia
  • 16. Dysnomia: Modules #!/bin/bash -e case "$1" in activate) echo "Echo module: Activate service: $2" ;; deactivate) echo "Echo module: Deactivate service: $2" ;; snapshot) echo "Echo module: Snapshot state of service: $2" ;; restore) echo "Echo module: Restore state of service: $2" ;; collect-garbage) echo "Echo module: Collect garbage of service: $2" ;; esac Sander van der Burg Dysnomia
  • 17. Dysnomia: executing deployment activities generically Create and initialize a database: $ dysnomia --operation activate --component ~/testdb --container ~/mysql-prod Take a snapshot of a database’s current state: $ dysnomia --operation snapshot --component ~/testdb --container ~/mysql-prod Mark a database as obsolete: $ dysnomia --operation deactivate --component ~/testdb --container ~/mysql-prod Sander van der Burg Dysnomia
  • 18. Dysnomia: executing deployment activities generically Delete a database that has been marked as obsolete: $ dysnomia --operation collect-garbage --component ~/testdb --container ~/mysql-prod Create and initialize a database again: $ dysnomia --operation activate --component ~/testdb --container ~/mysql-prod Restore the last database snapshot: $ dysnomia --operation restore --component ~/testdb --container ~/mysql-prod Sander van der Burg Dysnomia
  • 19. Dysnomia: managing snapshots Dysnomia provides a snapshot store that manages multiple genera- tions of snapshots: $ dysnomia-snapshots --query-all mysql-production/testdb/9b0c3562b57dafd00e480c6b3a... mysql-production/testdb/1df326254d596dd31d9d9db30e... mysql-production/testdb/330232eda02b77c3629a4623b4... Each component type follows its own naming convention for snapshots The MySQL module computes the SHA256 hash of the output and uses it as the snapshot name Sander van der Burg Dysnomia
  • 20. Dysnomia: managing snapshots We can automatically delete obsolete snapshots: $ dysnomia-snapshots --gc --keep 3 The above command keeps the last 3 snapshot generations and removes the remainder. Sander van der Burg Dysnomia
  • 21. Deploying a NixOS configuration with state { pkgs, ... }: { services = { mysql = { enable = true; package = pkgs.mysql; }; httpd = { enable = true; documentRoot = "/var/www"; adminAddr = "admin@localhost"; enablePHP = true; }; dysnomia = { enable = true; components.mysql-database.testdb = ./testdb; }; }; } $ nixos-rebuild switch $ dysnomia-containers --deploy Sander van der Burg Dysnomia
  • 22. Enabling state deployment in Disnix {distribution, invDistribution, pkgs, system}: let customPkgs = import ../top-level/all-packages.nix { inherit pkgs system; }; in rec { portaldb = { name = "portaldb"; pkg = customPkgs.portaldb; type = "mysql-database"; deployState = true; }; ... } State deployment is disabled by default Annotate each relevant service with deployState = true; Enable globally by providing the --deploy-state parameter or by setting the DISNIX DEPLOY STATE environment variable Sander van der Burg Dysnomia
  • 23. Migrating databases with Disnix {infrastructure}: { usersdb = [ infrastructure.test1 ]; cmsdb = [ infrastructure.test2 ]; cmsgallerydb = [ infrastructure.test1 ]; homeworkdb = [ infrastructure.test2 ]; literaturedb = [ infrastructure.test1 ]; portaldb = [ infrastructure.test2 ]; } $ disnix-env -s services.nix -i infrastructure.nix -d distribution.nix Updating the location of a database in the distribution model and redeploying the system also migrates state from one machine to another. Sander van der Burg Dysnomia
  • 24. Disnix: snapshots and restores It is also possible to use Dysnomia as a primitive backup tool. To take a snapshot of all deployed mutable components, run: $ disnix-snapshot To restore an individual database’s state: $ disnix-restore --component portaldb Sander van der Burg Dysnomia
  • 25. Demo Sander van der Burg Dysnomia
  • 26. Is the state deployment problem solved? Sander van der Burg Dysnomia
  • 27. Drawbacks Not all state can be managed by Dysnomia. It only works with well separated units of state. Impractical to e.g. manage user accounts and groups Dysnomia relies on exporting and syncing state to the filesystem. May be too expensive (in terms of storage) and time consuming for large data sets Impractical to use on a system level in a network. A snapshot of the entire system is taken. Difficult to manage components individually. Dysnomia works well for (large) collections of small data. It is possible to manage ˜100 MongoDB databases with sizes between several megabytes/several gigabytes Sander van der Burg Dysnomia
  • 28. Alternative approaches Filesystem-level snapshots: An experimental version of Nix called S-Nix has been developed using Ext3COW (2008): http://www.cs.uu.nl/education/ scripties/scriptie.php?SID=INF/SCR-2007-053 Faster, cheaper Difficult to guarantee portability and consistency. Partition-level snapshots: NixOps is capable of taking EBS snapshots Faster, cheaper Works on system-level. Hard to manage individual databases. Use database replication engines: More efficient, no additional storage required beyond the binary log Hard to generalize in a framework. Sander van der Burg Dysnomia
  • 29. Availability Dysnomia can be used as an independent tool: https://github.com/svanderburg/dysnomia Does not require Nix or any Nix-related tools Integrated in NixOS, by enabling the services.dysnomia.enable = true; setting All relevant Dysnomia modules and container configurations are configured automatically Integrated in Disnix Dysnomia should be considered an advanced prototype tool! Sander van der Burg Dysnomia
  • 30. Questions Sander van der Burg Dysnomia