Hosting and configuration
Vox isn't a hosted service: it runs inside your own .NET application, against your own databases. An installation consists of:
- The application's hosts, which serve the API and the admin UI, run Vox's background work, or both, see hosts.
- The Vox database, which holds the entities and the work each change causes, and the Nexus database, which holds the queues and jobs of imports and projection publications. On SQL Server and PostgreSQL they're one database unless you give Nexus its own, see infrastructure.
- Optional parts, each added for a need: Redis for transient entities such as carts, Elasticsearch for search, RabbitMQ, Redis streams or webhooks for subscriptions, and a projection store for Vox Serve.
The pages follow the path to production:
- Hosts: from one host to several, and serve hosts for customer traffic.
- Background work: what the processing hosts do, what a failure costs, and how to monitor and tune them.
- Deployments: a new release next to the old one, activated by the pipeline.
- Infrastructure: databases, Redis, migrating in production and resetting a development database.
- Security: secrets, database rights, authentication and API clients.
- Configuration: the hosting options and their defaults.
On Azure App Service, follow Azure App Service: Always On, graceful shutdown on Linux, scale-out and releases with deployment slots.
Production checklist
Each of these breaks a production installation when it's missed:
- Every host runs with
app.RunVoxAsync(args), which migrates or checks the model at startup, see one host. In production, migrate withvox migratein the pipeline and setRequireAppliedModel, see migrating in production. - Hosts share and persist their Data Protection keys, also a single container that restarts, see Data Protection keys.
- Hosts on more than one machine use a cross-machine instance event broker, see a cross-machine broker.
- Hosts on one machine have their own worker ids, see worker ids.
- Processing hosts' clocks are synchronized, see synced clocks.
- Each release has a new deployment id written into its package, and the pipeline has the deployment key, see deployments.
- The application does its part of a deployment: stops its own background work on retirement, keeps side effects idempotent and deploys with downtime when releases must not overlap, see what the application must do.
- The old release's hosts are stopped once the new release took the traffic, eg the
stagingslot after an App Service swap, see one release, step by step. - Hosts stay loaded and stop gracefully: the platform doesn't unload an idle host, which stops its background
work, and sends the application the stop signal, so a restart hands the work over at once. On Azure App Service,
turn on Always On and start a Linux app with
exec dotnet, see Azure App Service. - Redis runs with
maxmemory-policy noeviction, see Redis for transient entities. - SQLite, if used, keeps
Pooling=Falsefor the Vox database, whichAddSqliteStorage()adds, see databases. - Responses are compressed, see compress responses.
- Secrets and connection strings come from a secret store, and the database user has only the rights it needs, see security.