You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: installation/app-backend-setup.mdx
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,3 +26,7 @@ See [Authentication Setup](/installation/authentication-setup) for details.
26
26
See our [Example Projects](/resources/demo-apps-example-projects#custom-backend-examples) page for examples of custom backend implementations (e.g. Django, Node.js, etc.)
27
27
28
28
For Postgres developers, using [Supabase](/integration-guides/supabase-+-powersync) is an easy alternative to a custom backend. Several of our demo apps demonstrate how to use [Supabase](https://supabase.com/) as the Postgres backend.
29
+
30
+
### Hosted/Managed Option for MongoDB
31
+
32
+
<Tip>For users using MongoDB as a source backend database, an alternative option to running your own backend is to use CloudCode, a serverless cloud functions environment provided by us. We have a template that you can use as a turnkey starting point. See our [documentation here](/usage/tools/cloudcode).</Tip>
Copy file name to clipboardExpand all lines: installation/database-connection.mdx
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -139,8 +139,8 @@ PowerSync deploys and configures an isolated cloud environment for you, which ca
139
139
**Note**: PowerSync automatically selects the "Beta" version of the Service when adding a MongoDB connection while MongoDB support is in a beta release, as updates may be made against this version more frequently.
Copy file name to clipboardExpand all lines: installation/database-setup.mdx
+16-9Lines changed: 16 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -331,19 +331,16 @@ Notably, some "serverless Postgres" providers do not support logical replication
331
331
332
332
### Status of MongoDB support in PowerSync
333
333
334
-
In PowerSync nomenclature, Beta means the package is ready to be used for production given you have adequately tested your use case. We typically don't make any breaking API changes when moving from Beta to V1 (learn more about feature states [here](/resources/feature-status)).
334
+
#### Beta Released — December 2024
335
335
336
-
#### Alpha (Completed)
336
+
Our MongoDB connector is [in Beta](https://www.powersync.com/blog/powersync-mongodb-connector-module-now-in-beta) as of December 2024 and is supported for use in production environments. See the [full release notes](https://releases.powersync.com/announcements/mongodb-as-a-backend-database-now-in-beta).
337
337
338
-
#### Beta (Completed)
338
+
In PowerSync nomenclature, Beta means the package is ready to be used for production given you have adequately tested your use case. We typically don't make any breaking API changes when moving from Beta to V1 (learn more about feature states [here](/resources/feature-status)).
339
339
340
-
MongoDB is now supported for use in production environments.
341
340
342
-
See [https://releases.powersync.com/announcements/mongodb-as-a-backend-database-now-in-beta](https://releases.powersync.com/announcements/mongodb-as-a-backend-database-now-in-beta) for the full release notes.
341
+
#### V1 (In Progress — ETA 2025Q1)
343
342
344
-
#### V1 (In Progress — ETA 2025H1)
345
-
346
-
Our roadmap to V1 remains flexible and is strongly guided by customer feedback. Our focus includes enhancing usability, improving documentation such as migration guides, developing reference/demo applications, and exploring support for sharded MongoDB clusters and Atlas Private Endpoints. If you’d like to see any of these features, please visit our product roadmap and upvote/submit ideas. 
343
+
Our roadmap to V1 remains flexible and is strongly guided by customer feedback. Our focus includes enhancing usability, improving documentation such as migration guides, developing reference/demo applications, and exploring support for sharded MongoDB clusters. If you’d like to see any of these features, please visit our product roadmap and upvote/submit ideas.
Post-images can be configured for PowerSync Cloud instances under the connection settings in the Dashboard (right-click on your instance to edit it). For self-hosted PowerSync instances, configure post-images in the config.yaml file; see an example [here](https://github.com/powersync-ja/self-host-demo/blob/main/demos/nodejs-mongodb/config/powersync.yaml).
403
+
Post-images can be configured for PowerSync Cloud instances under the connection settings in the Dashboard (right-click on your instance to edit it). For self-hosted PowerSync instances, configure post-images in the `config.yaml` file; see an example [here](https://github.com/powersync-ja/self-host-demo/blob/main/demos/nodejs-mongodb/config/powersync.yaml).
404
+
405
+
### MongoDB Atlas private endpoints using AWS PrivateLink
406
+
407
+
If you need to use private endpoints with MongoDB Atlas, see [Private Endpoints](/installation/database-setup/private-endpoints).
408
+
409
+
410
+
### Migrating from MongoDB Atlas Device Sync
411
+
412
+
For more information on migrating from Atlas Device Sync to PowerSync, see our [migration guide](/migration-guides/mongodb-atlas) and [this post](https://www.powersync.com/blog/migrating-a-mongodb-atlas-device-sync-app-to-powersync) on our blog.
413
+
407
414
408
415
## <Icon icon="dolphin" iconType="solid" size="24" /> MySQL (Alpha)
<Info>We are currently working on a more detailed migration guide. In the meantime, the below guide provides high-level migration information.</Info>
6
+
6
7
## MongoDB Atlas deprecation
7
8
8
9
In September 2024, MongoDB [deprecated](https://www.mongodb.com/docs/atlas/app-services/deprecation/#std-label-app-services-deprecation) the following services:
@@ -18,54 +19,53 @@ If you have MongoDB Atlas Device Sync deployed today, at a high level your archi
18
19
19
20
## PowerSync beta support for MongoDB
20
21
21
-
As of December 2024, support for MongoDB as a backend database source is available in a beta release. This means that MongoDB replication is considered ready for production-use, provided that you have adequately tested your use cases.
22
+
As of December 2024, support for MongoDB as a backend database source in PowerSync is available in [a Beta release](https://www.powersync.com/blog/powersync-mongodb-connector-module-now-in-beta). This means that MongoDB replication is considered ready for production-use, provided that you have adequately tested your use cases.
22
23
23
-
It is currently available for testing in hosted or self-hosted environments:
24
+
It is currently available in [PowerSync Cloud](https://www.powersync.com/pricing) and self-hosted environments:
24
25
25
-
*Hosted by us: Refer to [Database Connection](/installation/database-connection#mongodb-beta-specifics)
26
-
* Self-hosted using Docker Compose: An end-to-end demo app is [available here](https://github.com/powersync-ja/self-host-demo/tree/main/demos/nodejs-mongodb). Please refer to its README for further instructions.
26
+
***PowerSync Cloud**: Refer to [Database Connection](/installation/database-connection#mongodb-beta-specifics)
27
+
***Self-hosted**: An end-to-end demo app using Docker Compose is [available here](https://github.com/powersync-ja/self-host-demo/tree/main/demos/nodejs-mongodb). Please refer to its README for further instructions.
27
28
28
-
Migrating to PowerSync's MongoDB module would take you to this: (new components in green)
29
+
Migrating to PowerSync would take you to this: (new components in green)
29
30
30
31
<Frame>
31
32
<imgsrc="/images/resources-2.png"/>
32
33
</Frame>
33
34
34
-
As you can see, this is not a point-and-click migration, however it does enable you to stay on MongoDB and those are the customers we are primarily interested in working with and supporting.
35
-
36
-
### Notable comments on the architecture
35
+
### Explanation of the migrated architecture
37
36
38
-
1. PowerSync handles writes differently from reads. This is because developers typically want to have some business logic running on an authoritative server before allowing a client device to change data in the backend database.
39
-
1. Reads are partitioned using [Sync Rules](/usage/sync-rules)
40
-
1. Sync Rules are more flexible than MongoDB Realm Flexible Sync, but are defined server-side and not client-side.
41
-
2.Writes are queued locally on the device and sent to the backend sequentially.
42
-
1. The backend can be a very thin API layer or can contain significant amounts of logic — [it is up to the developer](/installation/app-backend-setup/writing-client-changes)
37
+
1. PowerSync handles writes differently from reads.
38
+
***Reads:** The PowerSync Service connects to your MongoDB database and replicates data in real-time to PowerSync clients. Reads are partitioned using PowerSync's[Sync Rules](/usage/sync-rules)
39
+
* Sync Rules are more flexible than MongoDB Realm Flexible Sync, but are defined server-side and not client-side.
40
+
***Writes:** The client-side application can perform writes directly on the local SQLite database. The writes are also automatically placed into an upload queue by the PowerSync client SDK. The SDK then uses a developer-defined `uploadData()` function to manage the uploading of those writes sequentially to the backend. In the `uploadData()` function, the developer calls their backend API.
41
+
* The backend can be a very thin API layer or can contain significant amounts of logic — [it is up to the developer](/installation/app-backend-setup/writing-client-changes)
43
42
2. The PowerSync Service is generally [available](https://powersync.com/pricing) as a cloud-hosted service (PowerSync Cloud), or you can self-host using our Open Edition.
44
-
3. The PowerSync Client SDKs use SQLite under the hood. While there is nothing on a protocol level preventing us from supporting Realm as a client-side database, we are waiting to see whether Realm becomes a community project or not before investing in it, since it would be a significant amount of work for us to support Realm on the client-side.
45
-
1. The client-side will most likely be where the bulk of migration work takes place for customers migrating from Atlas Device Sync to PowerSync.
46
-
2. Client-side queries are typically written in SQL. [ORM support](https://www.powersync.com/blog/using-orms-with-powersync) is available for our JavaScript ([React Native](/client-sdk-references/javascript-web/javascript-orm/overview) and [web](/client-sdk-references/javascript-web/javascript-orm/overview)) and Flutter/[Dart](/client-sdk-references/flutter/flutter-orm-support) Client SDKs.
43
+
3. The PowerSync Client SDKs use **SQLite** under the hood. Even though MongoDB is a "NoSQL" document database, PowerSync's use of SQLite works well with MongoDB, since the [PowerSync protocol](/architecture/powersync-protocol) is schemaless (it syncs schemaless JSON data) and we dynamically apply a [client-side schema](/installation/client-side-setup/define-your-schema) to the data in SQLite using SQLite views.
44
+
* The client-side will most likely be where the bulk of migration work takes place for customers migrating from Atlas Device Sync to PowerSync. See [this post on our blog](https://www.powersync.com/blog/migrating-a-mongodb-atlas-device-sync-app-to-powersync) for a migration example.
45
+
* Client-side queries are typically written in SQL. [ORM support](https://www.powersync.com/blog/using-orms-with-powersync) is available for our JavaScript ([React Native](/client-sdk-references/javascript-web/javascript-orm/overview) and [web](/client-sdk-references/javascript-web/javascript-orm/overview)) and Flutter/[Dart](/client-sdk-references/flutter/flutter-orm-support) Client SDKs.
47
46
4. PowerSync piggybacks off your existing authentication, however, it uses JWTs. If you were using Atlas Device SDKs for authentication, you will need to implement an authentication provider.
48
47
49
48
### Migration steps
50
49
51
50
<Tip>The blog post [Migrating a MongoDB Atlas Device Sync App to PowerSync](https://www.powersync.com/blog/migrating-a-mongodb-atlas-device-sync-app-to-powersync) can serve as a handy guide through the migration process.</Tip>
52
51
53
52
1. Connect your database to an instance of the PowerSync Service:
54
-
1.Using PowerSync Cloud (hosted by us): See [Database Connection](/installation/database-connection#mongodb-alpha-specifics)
55
-
2.Using PowerSync Open Edition (self-hosted): Refer to our end-to-end demo app [available here](https://github.com/powersync-ja/self-host-demo/tree/main/demos/nodejs-mongodb)
53
+
1.**PowerSync Cloud**: See [Database Connection](/installation/database-connection#mongodb-alpha-specifics)
54
+
2.**Self-hosted**: Refer to our end-to-end demo app [available here](https://github.com/powersync-ja/self-host-demo/tree/main/demos/nodejs-mongodb)
56
55
2. Define [Sync Rules](/usage/sync-rules) in PowerSync — this enables dynamic partial replication so that you don't need to sync your entire MongoDB database to devices.
57
56
1. We recommend starting with one or two simple [Global Data](/usage/sync-rules/example-global-data) queries
58
57
3. Generate a [Development Token](/installation/authentication-setup/development-tokens)
59
58
4. Use our [Diagnostics App](https://diagnostics-app.powersync.com/) to validate that MongoDB is syncing into SQLite as expected.
60
-
5. Implement an app using one of our Client SDKs
61
-
1. You can continue using your Development Token for a start
62
-
2.Implement a "Hello World" app to get a feel, **or** jump straight into pulling the Client SDK into your existing app.
63
-
3. Verify that downloads from MongoDB are working.
59
+
5. Implement an app using one of our [Client SDKs](/client-sdk-references/introduction)
60
+
1. You can continue using your _Development Token_ for authentication as a start.
61
+
2.We recommend implementing a "Hello World" app to get a feel for how PowerSync works, _or_ you can jump straight into pulling the Client SDK into your existing app.
1. We have Node.js, Django and Rails demos available [here](/resources/demo-apps-example-projects#custom-backend-examples).
64
+
7. Implement your backend app to accept writes. There are currently two options:
65
+
1.**Custom self-hosted backend:** If you already have a backend application as part of your stack, you should use your existing backend. Alternatively, we have Node.js, Django and Rails example implementations available [here](/resources/demo-apps-example-projects#custom-backend-examples).
66
+
2.**CloudCode hosted/managed backend:** An alternative option is to use CloudCode, a serverless cloud functions environment provided by us. We provide a template that you can use as a turnkey starting point. See our [documentation here](/usage/tools/cloudcode).
67
67
68
-
### Implementation notes
68
+
### Additional notes
69
69
70
70
#### PowerSync Service
71
71
@@ -75,24 +75,28 @@ To [self-host](https://github.com/powersync-ja/powersync-service?tab=readme-ov-f
75
75
76
76
#### PowerSync Client SDKs
77
77
78
-
We are constantly adding additional PowerSync Client SDKs and some of them are under very active development. Below are the release status for each language/platform:
78
+
We are constantly adding additional [PowerSync Client SDKs](/client-sdk-references/introduction) and some of them are under very active development. Below are the release status for each language/platform:
|[Kotlin Multiplatform](/client-sdk-references/kotlin-multiplatform)| Beta | V1 ETA 2025Q1 |
86
86
|[Swift](/client-sdk-references/swift)| Beta | V1 ETA 2025Q1 |
87
87
| Node.js | PoC | Alpha ETA 2025Q1 |
88
-
| .NET |Not Started| Alpha ETA 2025Q1 |
88
+
| .NET |In Progress| Alpha ETA 2025Q1 |
89
89
90
90
<Info>
91
91
We've had customers inquire about the availability of a Rust/C++ SDK. The PowerSync core SQLite extension is implemented in Rust and we can work with customers to integrate PowerSync into their C++ applications. Please reach out to us at hello@powersync.com or [schedule a call](https://www.powersync.com/contact) with us
92
92
</Info>
93
93
94
94
#### App Backend
95
95
96
-
You will need to host a backend that can accept client writes if you do not already have one. The app backend needs to expose an API endpoint to write changes from the PowerSync client.
96
+
Your app backend needs to expose an API endpoint to write changes from the PowerSync client to the backend MongoDB database.
97
+
98
+
As noted above, there are currently two options:
99
+
1.**Custom self-hosted backend:** If you already have a backend application as part of your stack, you should use your existing backend. If you don't yet have one: We have Node.js, Django and Rails example implementations available [here](/resources/demo-apps-example-projects#custom-backend-examples).
100
+
2.**CloudCode hosted/managed backend:** An alternative option is to use CloudCode, a serverless cloud functions environment provided by us. We provide a template that you can use as a turnkey starting point. See our [documentation here](/usage/tools/cloudcode).
97
101
98
-
Additional implementation notes are available [here](/installation/app-backend-setup/writing-client-changes).
102
+
Additional backend implementation details are available here: [Writing Client Changes](/installation/app-backend-setup/writing-client-changes).
0 commit comments