Skip to content

Commit d0ac8d6

Browse files
authored
Merge pull request #119 from sqlitecloud/feat/add-offsync-doc
add offsync doc
2 parents 7d41d13 + 2a1ad8e commit d0ac8d6

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
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/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.

sqlite-cloud/platform/rls.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RLS rules only affect users who are authenticated using [Access Tokens](/docs/ac
1616

1717
RLS is a powerful feature for building secure, multi-tenant applications. When combined with [SQLite Sync](https://github.com/sqliteai/sqlite-sync), it enables you to create robust **local-first apps** where user data is stored on the device for offline availability and superior performance.
1818

19-
This architecture simplifies development by allowing your application to interact with a local database while SQLite Cloud transparently handles the synchronization with a central database. RLS ensures that each user's data is securely isolated during this process. The centralized database can then be used for powerful business analytics and reporting across all tenants, without compromising individual data privacy.
19+
This architecture simplifies development by allowing your application to interact with a local database while SQLite Cloud [OffSync](/docs/offsync) transparently handles the synchronization with a central database. RLS ensures that each user's data is securely isolated during this process. The centralized database can then be used for powerful business analytics and reporting across all tenants, without compromising individual data privacy.
2020

2121
## Policy Enforcement
2222

0 commit comments

Comments
 (0)