Skip to content

Commit 172d78d

Browse files
committed
add offsync doc
1 parent 7d41d13 commit 172d78d

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

sqlite-cloud/_nav.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const sidebarNav: SidebarNavStruct = [
8383
type: "inner",
8484
level: 0,
8585
},
86+
{ title: "Offsync", filePath: "offsync", type: "inner", level: 0 },
8687
{
8788
title: "Access Tokens",
8889
filePath: "access-tokens",

sqlite-cloud/platform/offsync.mdx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Offsync
3+
description: Enable local-first applications with automatic data synchronization between edge devices and SQLite Cloud.
4+
category: platform
5+
status: publish
6+
slug: offsync
7+
---
8+
9+
import Callout from "@commons-components/Information/Callout.astro";
10+
11+
Offsync is a powerful SQLite Cloud feature that enables true **local-first** data synchronization for your applications. Powered by the [SQLite Sync](https://github.com/sqliteai/sqlite-sync) extension, it allows you to build robust, offline-capable applications where data is stored and processed on edge devices and seamlessly synchronized with a central SQLite Cloud database.
12+
13+
This architecture is ideal for mobile apps, IoT devices, and any application requiring high availability and low latency, even with intermittent network connectivity. By leveraging Conflict-free Replicated Data Types (CRDTs), Offsync ensures that changes made offline are merged automatically and without conflicts when the device reconnects.
14+
15+
## How It Works
16+
17+
Offsync extends standard SQLite tables with built-in support for offline work and automatic synchronization. This allows multiple devices to operate independently and then seamlessly merge their changes.
18+
19+
- **Offline-First by Design**: Applications work seamlessly even when devices are offline. Changes are queued locally and synced automatically when connectivity is restored.
20+
- **CRDT-Based Conflict Resolution**: Merges updates deterministically and efficiently, ensuring eventual consistency across all replicas without complex merge logic.
21+
- **Seamless Integration**: The sync layer is tightly integrated with SQLite Cloud, enabling secure data sharing across devices, users, and platforms.
22+
23+
When combined with [Row-Level Security (RLS)](/docs/sqlite-cloud/platform/rls), Offsync allows you to build secure, multi-tenant applications where each user's data is safely isolated, both on the edge and in the cloud.
24+
25+
## Configuring Offsync
26+
27+
You can enable and manage Offsync for your databases directly from the SQLite Cloud dashboard.
28+
29+
1. **Navigate to the Databases Page**: From the main dashboard, go to the "Databases" page.
30+
2. **Select the Offsync Column**: In the list of your databases, click on the button in the "Offsync" column for the desired database.
31+
32+
![Dashboard Databases Page](@docs-website-assets/introduction/offsync-1.png)
33+
34+
3. **Enable Tables for Synchronization**: On the Offsync settings page, you will see a list of all tables in your database. Toggle the switch next to each table you want to enable for synchronization.
35+
36+
![Dashboard Offsync Settings Page](@docs-website-assets/introduction/offsync-2.png)
37+
38+
<Callout type="note" title="Matching Schemas and Tables">
39+
For Offsync to work correctly, the list of tables configured for synchronization—and their corresponding schemas—must be identical in both your local SQLite database and your SQLite Cloud database.
40+
</Callout>
41+
42+
Once enabled, any changes made to the selected tables via the SQLite Sync extension will be automatically synchronized with your SQLite Cloud database.

0 commit comments

Comments
 (0)