@@ -339,9 +339,56 @@ Logger.e("Some error");
339
339
340
340
See [ Usage Examples] ( /client-sdk-references/kotlin-multiplatform/usage-examples ) for further examples of the SDK.
341
341
342
+ ## Developer Notes
343
+
344
+ ### Client implementation
345
+
346
+ The PowerSync service sends encoded instructions about data to sync to connected clients.
347
+ These instructions are decoded by our SDKs, and on Kotlin there are two implementations available for this:
348
+
349
+ 1 . ** Kotlin (default)**
350
+ - This is the original implementation method, mostly implemented in Kotlin.
351
+ - Most upcoming features will not be ported to this implementation, and we intend to remove it eventually.
352
+ 2 . ** Rust (currently experimental)**
353
+ - This is a newer implementation, mostly implemented in Rust but still using Kotlin for networking.
354
+ - Apart from newer features, this implementation is also more performant.
355
+ - We [ encourage interested users to try it out] ( https://releases.powersync.com/announcements/improved-sync-performance-in-our-client-sdks )
356
+ and report feedback, as we intend to make it the default after a stabilization period.
357
+
358
+ To enable the Rust client, pass ` SyncOptions(newClientImplementation = true) ` as a second parameter when
359
+ [ connecting] ( https://powersync-ja.github.io/powersync-kotlin/core/com.powersync/-power-sync-database/connect.html ) .
360
+
361
+ ### Connection Methods
362
+
363
+ This SDK supports two methods for streaming sync commands:
364
+
365
+ 1 . ** WebSocket (currently experimental)**
366
+ - The implementation leverages RSocket for handling reactive socket streams.
367
+ - Back-pressure is effectively managed through client-controlled command requests.
368
+ - Sync commands are transmitted efficiently as BSON (binary) documents.
369
+ - Enabling websocket support requires the new client implementation.
370
+ 2 . ** HTTP Streaming (default)**
371
+ - This is the original implementation method.
372
+ - This method sends data as text (JSON) instead of BSON.
373
+
374
+ By default, the ` PowerSyncDatabase.connect() ` method uses HTTP streams.
375
+ You can optionally specify the ` connectionMethod ` to override this:
376
+
377
+ ``` Kotlin
378
+ // HTTP streaming (default)
379
+ powerSync.connect(connector)
380
+
381
+ // WebSockets (experimental)
382
+ powerSync.connect(connector, SyncOptions (
383
+ newClientImplementation = true ,
384
+ method = ConnectionMethod .WebSocket (),
385
+ ))
386
+ ```
387
+
342
388
## ORM Support
343
389
344
- ORM support is not yet available, we are still investigating options. Please [ let us know] ( /resources/contact-us ) what your needs around ORMs are.
390
+ ORM support is not yet available, we are still investigating options to integrate the SDK with Room and SQLDelight.
391
+ Please [ let us know] ( /resources/contact-us ) what your needs around ORMs are.
345
392
346
393
## Troubleshooting
347
394
0 commit comments