Design decisions

Operations and tooling

Decisions about the watcher, zero-flag first start, service installation and fatal-error reports (D41, D44, D45, D53).

D41 A separate watcher restarts and cleans up only what is basic and safe, and reports everything#

It was requested that the database be monitored, issues reported and basic ones such as a restart fixed. The watcher is its own binary so a server bug cannot take it down. Each round it logs in, pings, writes, reads and deletes a canary row, reads the server state, checks disk space and pings other nodes. A problem must last several rounds before it is an incident; then it is reported, a fix is tried if one applies, the result is verified, and the incident is resolved after two good rounds. Safety rules: only configured commands run, with a time limit; restarts are limited per window with a cooldown, after which it says a person is needed; a rejected login or warning never causes a restart; data is never touched. Rejected: restarting on any failed check, deleting data to fix things, built-in e-mail or chat clients (a command hook covers every channel).

D44 Zero-flag first run, profiles and one settings file#

A basic database for one server should not need many options. The server started with no arguments is a secure single server: loopback only, data in the standard folder if it exists (else a local folder), shards from the cores, and, when no token or user is given, an admin account whose random password is written once to a file with restricted permissions and read back at every start. Every setting has one name used as a flag, an environment variable and a line in the settings file, with a fixed order of precedence, and profiles bundle common choices.

D45 install-service#

install-service and uninstall-service finish the zero-configuration plan. On Linux the command creates a system user with no login, the data folder, a settings file only when it is missing (an existing file is never changed), copies the binary, writes a systemd unit, checks the settings, enables and starts the service, waits until the port answers and prints the address. A replica or cluster file that still has placeholders is installed but not started, and the command says what to edit.

D53 Fatal-error reporting#

A std-only crate installs a panic hook and an explicit fatal-error call in the server, the watcher and the MySQL front-end. Reports always go to a local directory and go to a remote endpoint only if one is configured; the default is off, because an operator's data server must not phone home unasked. Reports carry no data (a cleaned message, function names, file and line, a random instance id), are rate limited and de-duplicated, and unsent ones are retried at the next start.