diff --git a/blueprints/deno-kv-litefs.mdx b/blueprints/deno-kv-litefs.mdx index ecfe040516..3126414840 100644 --- a/blueprints/deno-kv-litefs.mdx +++ b/blueprints/deno-kv-litefs.mdx @@ -5,8 +5,12 @@ source_url: https://fly.io/docs/blueprints/deno-kv-litefs/ --- import LitefsSunsetSnippet from '/snippets/docs/litefs-sunset.mdx'; +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; +import LitefsAutostopSnippet from '/snippets/docs/litefs-autostop.mdx'; + + ## Problem diff --git a/laravel/advanced-guides/global-sqlite-litefs.mdx b/laravel/advanced-guides/global-sqlite-litefs.mdx index 446b8121dd..95a45ee454 100644 --- a/laravel/advanced-guides/global-sqlite-litefs.mdx +++ b/laravel/advanced-guides/global-sqlite-litefs.mdx @@ -4,6 +4,12 @@ description: "Replicate a Laravel app's SQLite database across Fly.io Machines w source_url: https://fly.io/docs/laravel/advanced-guides/global-sqlite-litefs/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; +import LitefsAutostopSnippet from '/snippets/docs/litefs-autostop.mdx'; + + + + This is a technology preview. ["LiteFS"](/litefs) is a `distributed file system` that enables you to sync SQLite data across instances of your application. Read further on the official [LiteFS documentation](/litefs/getting-started-fly) and follow along a LiteFS-configured [sample Laravel repository here](https://github.com/fly-apps/fly-laravel-litefs). diff --git a/litefs/backup.mdx b/litefs/backup.mdx index b7193cda17..df9a4ce100 100644 --- a/litefs/backup.mdx +++ b/litefs/backup.mdx @@ -4,6 +4,10 @@ sidebarTitle: Backing up your cluster source_url: https://fly.io/docs/litefs/backup/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + While LiteFS replicates data between nodes and supports failover, it does not currently have a disaster recovery system in place in the event you lose your entire cluster. These are some strategies you can use to reduce your risk of diff --git a/litefs/cloud-backups.mdx b/litefs/cloud-backups.mdx index f273dde50f..5259030c28 100644 --- a/litefs/cloud-backups.mdx +++ b/litefs/cloud-backups.mdx @@ -5,8 +5,10 @@ source_url: https://fly.io/docs/litefs/cloud-backups/ --- import LitefsSunsetSnippet from '/snippets/docs/litefs-sunset.mdx'; +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + The simplest way to implement disaster recovery for your LiteFS cluster is to use Fly.io's LiteFS Cloud for backups. LiteFS Cloud provides reliable backup diff --git a/litefs/cloud-restore.mdx b/litefs/cloud-restore.mdx index 22cfd1ba8e..cc13d883a7 100644 --- a/litefs/cloud-restore.mdx +++ b/litefs/cloud-restore.mdx @@ -5,8 +5,10 @@ source_url: https://fly.io/docs/litefs/cloud-restore/ --- import LitefsSunsetSnippet from '/snippets/docs/litefs-sunset.mdx'; +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + ## Overview diff --git a/litefs/config.mdx b/litefs/config.mdx index 1c5d2cec7d..21be90f89f 100644 --- a/litefs/config.mdx +++ b/litefs/config.mdx @@ -4,6 +4,10 @@ title: LiteFS Config Reference source_url: https://fly.io/docs/litefs/config/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + Most of the configuration options for LiteFS are set via a `litefs.yml` config file. You can find a fully-commented version of [`litefs.yml`](https://github.com/superfly/litefs/blob/main/cmd/litefs/etc/litefs.yml) in the LiteFS repository. diff --git a/litefs/disaster-recovery.mdx b/litefs/disaster-recovery.mdx index db713eaa20..5fa24f50bf 100644 --- a/litefs/disaster-recovery.mdx +++ b/litefs/disaster-recovery.mdx @@ -5,8 +5,12 @@ source_url: https://fly.io/docs/litefs/disaster-recovery/ --- import LitefsSunsetSnippet from '/snippets/docs/litefs-sunset.mdx'; +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; +import LitefsAutostopSnippet from '/snippets/docs/litefs-autostop.mdx'; + + The biggest advantage of using LiteFS Cloud is that you have backups to restore from in case of an unfortunate situation where you lose diff --git a/litefs/events.mdx b/litefs/events.mdx index 91f771f222..886e985245 100644 --- a/litefs/events.mdx +++ b/litefs/events.mdx @@ -4,6 +4,10 @@ sidebarTitle: Reading the event stream source_url: https://fly.io/docs/litefs/events/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + LiteFS provides mechanisms for reading the [replication position](/litefs/position) and [current primary status](/litefs/primary) through the FUSE file system mount. However, this involves polling the file system which has overhead and some delay. diff --git a/litefs/export.mdx b/litefs/export.mdx index 9c624c1772..4a5e443406 100644 --- a/litefs/export.mdx +++ b/litefs/export.mdx @@ -4,6 +4,10 @@ title: LiteFS Export Command source_url: https://fly.io/docs/litefs/export/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + ## Overview The `export` command will download a SQLite database from a LiteFS cluster. If diff --git a/litefs/faq.mdx b/litefs/faq.mdx index 8f7857837d..71ae6d6a52 100644 --- a/litefs/faq.mdx +++ b/litefs/faq.mdx @@ -4,6 +4,10 @@ title: LiteFS FAQ source_url: https://fly.io/docs/litefs/faq/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + LiteFS aims to work like running a single-server SQLite application as much as possible. However, since it is a distributed system, some things may work differently than you expect. This page is meant to provide answers for commonly diff --git a/litefs/getting-started-docker.mdx b/litefs/getting-started-docker.mdx index 8143488a53..4b7bfeec88 100644 --- a/litefs/getting-started-docker.mdx +++ b/litefs/getting-started-docker.mdx @@ -3,6 +3,10 @@ title: Getting Started with LiteFS in Docker source_url: https://fly.io/docs/litefs/getting-started-docker/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + ## Overview This guide will walk you through the steps of getting a LiteFS cluster up and diff --git a/litefs/getting-started-fly.mdx b/litefs/getting-started-fly.mdx index 7317141a1b..81fbdb983b 100644 --- a/litefs/getting-started-fly.mdx +++ b/litefs/getting-started-fly.mdx @@ -4,6 +4,11 @@ description: "Set up a LiteFS cluster on Fly.io: install litefs, configure litef source_url: https://fly.io/docs/litefs/getting-started-fly/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; +import LitefsAutostopSnippet from '/snippets/docs/litefs-autostop.mdx'; + + + ## Overview This guide will walk you through the steps of getting a LiteFS cluster up and @@ -243,6 +248,7 @@ Refer to the [`litefs import`](/litefs/import) documentation for more details. You should only interact with SQLite databases on LiteFS through a SQLite client or through the `litefs` tooling.

+ Do not use `cp` to copy a database into place. diff --git a/litefs/how-it-works.mdx b/litefs/how-it-works.mdx index 7b587775b8..b95df6a419 100644 --- a/litefs/how-it-works.mdx +++ b/litefs/how-it-works.mdx @@ -3,6 +3,10 @@ title: How LiteFS Works source_url: https://fly.io/docs/litefs/how-it-works/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + LiteFS is a distributed file system specifically built for replicating SQLite databases. This allows each application node to have a full, local copy of the database and respond to requests with minimal latency. LiteFS is built for high diff --git a/litefs/import.mdx b/litefs/import.mdx index 6716c1a453..1b79d7626f 100644 --- a/litefs/import.mdx +++ b/litefs/import.mdx @@ -4,6 +4,10 @@ title: LiteFS Import Command source_url: https://fly.io/docs/litefs/import/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + ## Overview The `import` command will upload a SQLite database to a LiteFS cluster. If the diff --git a/litefs/index.mdx b/litefs/index.mdx index 607c4694f2..8250eab730 100644 --- a/litefs/index.mdx +++ b/litefs/index.mdx @@ -4,9 +4,11 @@ description: "Replicate SQLite across nodes with LiteFS, a distributed file syst source_url: https://fly.io/docs/litefs/ --- - -**Important:** We are not able to provide support or guidance for this product. Use with caution. Do not combine LiteFS with autostop/autostart on Fly Machines. The Fly Proxy’s autoscaler can shut down or restart Machines without any awareness of LiteFS lease ownership or data freshness, which can result in a stale machine winning the lease and LiteFS discarding newer changes and LTX file data—risking rollback and data loss. - +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; +import LitefsAutostopSnippet from '/snippets/docs/litefs-autostop.mdx'; + + + LiteFS is a distributed file system that transparently replicates SQLite databases. You can run your application like it's running against a local diff --git a/litefs/migrations.mdx b/litefs/migrations.mdx index e0486e181b..d63acca2a8 100644 --- a/litefs/migrations.mdx +++ b/litefs/migrations.mdx @@ -3,6 +3,10 @@ title: Running database migrations source_url: https://fly.io/docs/litefs/migrations/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + ## Overview LiteFS is a single-writer system so only the primary node can write to the diff --git a/litefs/mount.mdx b/litefs/mount.mdx index 56481b6026..4514a82018 100644 --- a/litefs/mount.mdx +++ b/litefs/mount.mdx @@ -4,6 +4,10 @@ title: LiteFS Mount Command source_url: https://fly.io/docs/litefs/mount/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + ## Overview The `mount` command will mount a LiteFS directory via FUSE and begin communicating diff --git a/litefs/position.mdx b/litefs/position.mdx index 60df36b920..10ab2d89f0 100644 --- a/litefs/position.mdx +++ b/litefs/position.mdx @@ -4,6 +4,10 @@ title: Tracking LiteFS replication position source_url: https://fly.io/docs/litefs/position/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + Each database created in LiteFS maintains a position in their replication log. The position is a combination of a monotonically incrementing transaction ID (TXID) and a rolling checksum of the database contents. diff --git a/litefs/primary.mdx b/litefs/primary.mdx index 0e5a3ea28f..f96e22184c 100644 --- a/litefs/primary.mdx +++ b/litefs/primary.mdx @@ -4,6 +4,10 @@ sidebarTitle: Determining the primary source_url: https://fly.io/docs/litefs/primary/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + The LiteFS directory (typically `/litefs`) provides a `.primary` file that applications can read to determine the current primary node. This file only exists if the node is currently a replica _and_ it is connected to the primary diff --git a/litefs/proxy.mdx b/litefs/proxy.mdx index 850ea83e8f..be0a429d6b 100644 --- a/litefs/proxy.mdx +++ b/litefs/proxy.mdx @@ -3,6 +3,12 @@ title: Built-in HTTP Proxy source_url: https://fly.io/docs/litefs/proxy/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; +import LitefsAutostopSnippet from '/snippets/docs/litefs-autostop.mdx'; + + + + ## Overview diff --git a/litefs/releases.mdx b/litefs/releases.mdx index ca2f079097..45d9a17ab0 100644 --- a/litefs/releases.mdx +++ b/litefs/releases.mdx @@ -4,6 +4,10 @@ sidebarTitle: Releases source_url: https://fly.io/docs/litefs/releases/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + If you're running on a Linux VPS without Docker, or as an alternative to installing from LiteFS Docker builds, you can download the latest version from our [LiteFS releases page](https://github.com/superfly/litefs/releases). diff --git a/litefs/run.mdx b/litefs/run.mdx index 0a0868a84e..340ceb99c5 100644 --- a/litefs/run.mdx +++ b/litefs/run.mdx @@ -4,6 +4,10 @@ sidebarTitle: Run Command source_url: https://fly.io/docs/litefs/run/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; + + + ## Overview The `run` command will execute the program listed after the double dash. It diff --git a/litefs/speedrun.mdx b/litefs/speedrun.mdx index d3e6901ce4..f2bf26264d 100644 --- a/litefs/speedrun.mdx +++ b/litefs/speedrun.mdx @@ -3,6 +3,12 @@ title: 'Speedrun: Add LiteFS to your app' source_url: https://fly.io/docs/litefs/speedrun/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; +import LitefsAutostopSnippet from '/snippets/docs/litefs-autostop.mdx'; + + + + This guide will get your app up and running with LiteFS on Fly.io as fast as possible. If you run into any issues with this guide, or you'd like some more details or a slower pace, check out the [Getting Started doc][] instead. diff --git a/rails/advanced-guides/litefs.mdx b/rails/advanced-guides/litefs.mdx index c04e8f746c..e3484748ff 100644 --- a/rails/advanced-guides/litefs.mdx +++ b/rails/advanced-guides/litefs.mdx @@ -4,6 +4,12 @@ description: "Replicate a Rails app's SQLite database across regions with LiteFS source_url: https://fly.io/docs/rails/advanced-guides/litefs/ --- +import LitefsUnsupportedSnippet from '/snippets/docs/litefs-unsupported.mdx'; +import LitefsAutostopSnippet from '/snippets/docs/litefs-autostop.mdx'; + + + + This is a technology preview. It shows how to do multi-region deployments using Sqlite3 and Litefs. See [LiteFS - Distributed SQLite](/litefs) for background. diff --git a/snippets/docs/litefs-autostop.mdx b/snippets/docs/litefs-autostop.mdx new file mode 100644 index 0000000000..e1e983bf98 --- /dev/null +++ b/snippets/docs/litefs-autostop.mdx @@ -0,0 +1,5 @@ + +**Don't use LiteFS with autostop/autostart on Fly Machines.** + +The Fly Proxy can stop and restart Machines without knowing which Machine holds the LiteFS lease or has the latest data. This can allow a Machine with stale data to acquire the lease, causing LiteFS to discard newer changes and LTX files. The result can be a database rollback and permanent data loss. + diff --git a/snippets/docs/litefs-unsupported.mdx b/snippets/docs/litefs-unsupported.mdx new file mode 100644 index 0000000000..4671beb14b --- /dev/null +++ b/snippets/docs/litefs-unsupported.mdx @@ -0,0 +1,3 @@ + +**Important:** LiteFS is outside our [scope of support](/about/support#scope-of-support). We are not able to provide support or guidance for it. Use with caution. +