Skip to content

Commit 1a86187

Browse files
authored
Merge pull request #1925 from appwrite/add-rxdb-to-docs
Add rxdb to docs
2 parents f97b1c4 + 5ef0426 commit 1a86187

File tree

6 files changed

+65
-0
lines changed

6 files changed

+65
-0
lines changed

src/routes/blog/post/offline-first-journal/+page.markdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,4 +874,5 @@ You can find the source code for this application in our [GitHub repo](https://g
874874
Learn more about RxDB and Appwrite:
875875

876876
- [RxDB docs for Appwrite](https://rxdb.info/replication-appwrite.html#do-other-things-with-the-replication-state)
877+
- [Appwrite offline sync docs](/docs/products/databases/offline)
877878
- [RxDB in the Integrations catalog](/integrations/replication-rxdb)

src/routes/docs/products/databases/+layout.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
label: 'Permissions',
4141
href: '/docs/products/databases/permissions'
4242
},
43+
{
44+
label: 'Offline Sync',
45+
href: '/docs/products/databases/offline'
46+
},
4347
{
4448
label: 'Relationships',
4549
href: '/docs/products/databases/relationships'
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
layout: article
3+
title: Offline Sync
4+
description: Enable offline synchronization of data between your apps and Appwrite Databases.
5+
---
6+
7+
Offline synchronization (or offline sync) is a mechanism that allows apps to store and update data locally when a user is offline (i.e., loses internet connectivity), and then synchronize that data with an Appwrite database once the user is back online.
8+
9+
This capability is crucial for building resilient and responsive applications, especially in environments with unreliable or intermittent internet connectivity. Some real-world scenarios where offline sync is useful are:
10+
11+
- Journaling and note-taking apps
12+
- Warehouse inventory management systems
13+
- Medical data entry tools
14+
- Airline check-in management apps
15+
- GPS navigation software
16+
17+
# Integrate offline sync in your apps
18+
19+
{% only_light %}
20+
{% cards %}
21+
22+
{% cards_item href="/integrations/replication-rxdb" title="RxDB" image="/images/docs/databases/offline/logos/rxdb.svg" %}
23+
{% /cards_item %}
24+
25+
{% /cards %}
26+
{% /only_light %}
27+
28+
{% only_dark %}
29+
{% cards %}
30+
31+
{% cards_item href="/integrations/replication-rxdb" title="RxDB" image="/images/docs/databases/offline/logos/dark/rxdb.svg" %}
32+
{% /cards_item %}
33+
34+
{% /cards %}
35+
{% /only_dark %}
36+
37+
# How does offline sync work?
38+
39+
The process of implementing offline sync in Appwrite-powered apps (and in general) is as follows:
40+
41+
1. **Local data storage:** When a user opens your app, the app downloads relevant data from the server and saves it locally on their device via local-first data stores like IndexedDB, LocalStorage, SQLite, or RxDB.
42+
43+
2. **Working offline**: While offline, users can either read previously synced data or make changes (create, update, or delete data) in the local data store.
44+
45+
3. **Detecting connectivity**: The app monitors network status. As soon as connectivity is restored, a sync operation is triggered between the local data store and the Appwrite database.
46+
47+
5. **Two-way synchronization**: Local changes are *"pushed"* to the Appwrite database and new changes from the database are *"pulled"* into the local store. This process is called **push-pull replication**.
48+
49+
6. **Conflict resolution**: If the same data was changed both locally and on the server, the system must prioritise one of the two operations. Various strategies can be implemented to mitigate this issue, such as *last write wins* or *manual user conflict resolution*.

src/routes/integrations/replication-rxdb/+page.markdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,6 @@ With that, your RxDB integration is configured and you can use other relevant Rx
172172
If you would like to learn more about RxDB and Appwrite Databases, we have some resources that you should visit:
173173

174174
- [RxDB docs for Appwrite](https://rxdb.info/replication-appwrite.html)
175+
- [Appwrite offline sync docs](/docs/products/databases/offline)
175176
- [Build an offline-first journal app with RxDB and Appwrite](/blog/post/offline-first-journal)
176177
- [Offline-first journal demo app on GitHub](https://github.com/appwrite-community/offline-journal)
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)