Engineering problem

Self-Hosted Database Guide for Small Teams

Choose embedded, self-managed, or managed database hosting by workload boundaries, staffing, and a measured recovery point and recovery time.

Editorial update

Decision in brief

Self-host a client-server database when application requirements justify it and someone can own updates, backup integrity, and restores. Start with SQLite for a compatible single-application deployment where write concurrency and local storage fit. Use a managed database if it covers operational work you cannot staff, then verify exactly how backups, credentials, restore, and maintenance work under your plan.

Choose database ownership: SQLite — Local app. Self-hosted — Own recovery. Managed — Check terms.
Check direct access, write concurrency and the exact backup and restore responsibilities.

Choose the failure and ownership boundary

Begin with the engine that fits the application, then choose its hosting model. A Docker volume preserves state across container replacement when mounted correctly. Keep a separate engine-aware backup and restore it to a clean host to cover the loss of the original machine.

For PostgreSQL, logical dumps support object transfer and can be useful for restoration to a different major version within documented compatibility limits. Base backups plus archived WAL support point-in-time recovery. A managed service can offer its own point-in-time recovery procedure. For example, Amazon RDS restores into a new DB instance, so the drill must include connection configuration and traffic cutover.

Application needFirst design to testDecision gate
One process family and modest concurrent writesSQLite with an engine-aware backup procedureMeasure busy time and recover the app from an off-host copy
Several network clients or server database featuresSelf-managed PostgreSQL on an owned VM or managed equivalentMeasure write latency, connection recovery, and upgrade ownership
Short acceptable recovery pointTest a backup and transaction-log recovery designRestore before a seeded mistake and check which writes survived
Strict uptime with limited staffingManaged database or explicitly staffed replicated designRehearse recovery and check division of responsibilities during failover

What HN discussions distinguish about database ownership

In a self-hosting PostgreSQL thread, ZeroConcerns described expectations for usable disaster recovery copies and multi-datacenter failover when buying a managed database. Ask the provider to point to those behaviors in your plan, and verify separately whether you can restore or export to a destination outside the service.

In the Portabase launch discussion, killian_larcher described building an agent-based tool for scheduling database backups and restores across multiple networks. Examine the backup system as its own dependency. The person leading recovery should be able to retrieve the encrypted copy and its keys even when both the original host and management endpoint are unavailable.

Restore through the real application path

  1. Load anonymized fixtures into a test server. Document engine and extension versions, roles, backup locations, retention, and the accepted time and data loss after failure.
  2. Take the intended backup, create several timestamped transactions, and introduce a synthetic erroneous update. Verify that the backup and any required transaction logs reach a separate storage destination.
  3. Recover to a fresh host or managed instance, reconnect the test application, and check identities, migrations, read/write behavior, and the data before and after the recovery point.
  4. Accept only if observed service recovery time and data loss fit the declared objectives and a second operator can perform the restore using the runbook. Stop if any required restore key, dependency, or backup is reachable only through the failed host.

Related articles