Skip to content

feat: Object stores and database-aware backups - #199

Merged
nfebe merged 9 commits into
mainfrom
feat/object-stores-and-db-backups
Aug 3, 2026
Merged

feat: Object stores and database-aware backups#199
nfebe merged 9 commits into
mainfrom
feat/object-stores-and-db-backups

Conversation

@nfebe

@nfebe nfebe commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Adds self-hosted object stores and reworks how backups capture databases.

Object stores. Deploy a self-hosted S3 store (MinIO) from a template and FlatRun connects it automatically (reads its issued credentials, creates the bucket, registers it as a backup target), or connect an already-running deployment as an external store. A connected store supports:

  • Browsing its buckets, then a bucket's objects, with upload, download, delete, and inline previews.
  • Attaching to another deployment, injecting the connection details into that app's environment.
  • Replicating its contents to another store.

Two design points a reviewer should know:

  • The agent runs on the host, so it reaches a managed store by the container's address on a shared network, resolved live because the container IP changes across recreates. Stores join a configurable network, defaulting to the database network.
  • The store's own bucket is the backup target, so browsing refuses to delete objects there; other buckets are fully editable.

Backups. A backup used to copy a deployment's data directory, which is unsafe for a running database: the live files can be read mid-write and restored inconsistent. Backups now detect database servers from the compose and dump them logically instead:

  • A database-server deployment (including the shared infrastructure database) is dumped in full (pg_dumpall / mysqldump --all-databases) with its root credentials.
  • An app on the shared database also dumps just its own database, so its more frequent backups stay self-contained.
  • The database's live data directory is dropped from the file copy, since the dump replaces it.

Dashboard side: flatrun/ui#99.

Follow-up: the MySQL/MariaDB dump path mirrors Postgres and is not yet run against a live MySQL server.

nfebe added 9 commits August 3, 2026 10:49
…tion

Object stores are now a first-class resource. A self-hosted, S3-compatible
store (MinIO) can be deployed straight from the Object Stores page and connected
automatically: FlatRun issues the store's credentials, creates its bucket, and
registers it as a backup target. An already-running deployment can instead be
connected as a store by supplying its S3 details.

Self-hosted stores run as the host user so their data stays manageable without
root, and they join a shared storage network (the database network by default,
or a dedicated one) so the agent and apps can reach them by address. Deploying
an app from the marketplace now hands off to the standard deployment flow rather
than a separate one-field install.
A connected store's full contents can now be listed and managed directly: every
object in the store is shown (not just backup archives), and individual objects
can be uploaded, downloaded, and deleted.
A store can now be attached to another deployment: its endpoint, bucket, region,
credentials, and path-style flag are written into that deployment's environment
under a chosen prefix, and the service is wired to load them. A self-hosted store
is addressed by its in-cluster name and the app is joined to its network; an
external store uses its public URL. The deployment is restarted to pick it up.
A store's contents can now be copied to another store, for an offsite copy of a
self-hosted store or a local cache of a remote one. Replication is incremental:
objects already present at the same size in the target are skipped, so re-running
only moves what changed.
A store's server can host many buckets, so a store is no longer limited to its
one configured bucket: its buckets can be listed and created, and objects can be
browsed and uploaded within any of them. Deleting objects in the store's backup
bucket is refused so browsing cannot destroy backups; other buckets stay fully
editable.
The bucket list now reports each bucket's object count and total size (bounded so
large buckets stay responsive), and objects are listed a page at a time so a
bucket of any size can be browsed. An empty, non-backup bucket can be deleted.
A deployment whose service is a database server (including the shared
infrastructure database) is now detected and backed up with a full logical dump
of every database it holds, using its root credentials, instead of only copying
its live data directory. This makes database backups consistent and complete
with no per-deployment configuration; a shared database captures all app data in
one dump, and a standalone or sidecar database captures its own.
An app that uses the shared database now also dumps just its own database into
its own archive, resolved automatically from the app's recorded database usage.
This keeps an app's (often more frequent) backups self-contained rather than
depending on the shared database's own, possibly less frequent, full backup.
When a deployment's database is dumped, its live data directory is no longer also
copied into the archive: that copy duplicates the dump and, taken from a running
database, can be inconsistent. Other files such as app data and config are still
included. Backups also gain honoured exclude patterns, which were previously
declared but ignored.
@nfebe
nfebe merged commit d884184 into main Aug 3, 2026
6 checks passed
@nfebe
nfebe deleted the feat/object-stores-and-db-backups branch August 3, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant