Offline Capabilities? #107
Replies: 15 comments 15 replies
-
Hi @AgarwalPragy , absolutely - this is a definite intention for SurrealDB. And that's the whole reason why SurrealDB is designed to run embedded in the browser, as well as in a server environment... We're not fully set on the implementation details of this at the moment. We've looked at Operational Transformation, and CRDTs, and we would ideally like to find a middle ground between them (in terms of offline support / speed / being able to operate as a full database), which is an area of research which is seeing more interest at the moment! |
Beta Was this translation helpful? Give feedback.
-
Offline-first and multi-user data online sync would make me dump my [p|c]ouchDB stack and jump on surrealDB immediately. |
Beta Was this translation helpful? Give feedback.
-
With tight integration with Cloudflare, the database on the edge will/can act as distributed endpoint for lower latency |
Beta Was this translation helpful? Give feedback.
-
Any update @tobiemh ? |
Beta Was this translation helpful? Give feedback.
-
Would be create to use crdt because tikv uses raft and a network partition or network lag means your view of the data is potentially old. It’s such an age old problem :) crdt is best of both worlds in that it embraces the reality that the data you have might be old. It’s a global solution for the reality that the server is in a way offline or shall we say “ lagging “. Along with this same problem domain is schema evolution. So you may have 100 versions of data type x , but the shape of those 100 versions of X could be different too. I heard that the kv store needs to support range queries ? |
Beta Was this translation helpful? Give feedback.
-
I was looking something like that. |
Beta Was this translation helpful? Give feedback.
-
Well the tikv requires an always on system. the nats kv can work when offline. That’s why I suggested ( I think ) to use NATS in leaf mode . Marmot uses NATS to do the same thing for SQLite . https://github.com/maxpert/marmot I am considering doing the same with Surreal db but can’t find an API to write to . The docs don’t explain it . I heard that range queries are needed which sounds very s3 ish . |
Beta Was this translation helpful? Give feedback.
-
@tobiemh is this on back-burner? |
Beta Was this translation helpful? Give feedback.
-
I arrived here after discovering SurrealDB. I am also looking for an "offline-first" data sync solution that syncs between server and local. SurrealDB looks amazing but I can't find anything on synchronisation between embedded and server. |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? @tobiemh |
Beta Was this translation helpful? Give feedback.
-
Implementing fallback (offline) support would be a valuable feature for SurrealDB. For example, if the main db responds too slowly when writing log entries, sensor data, or any kind of data that doesn't have to be synced in realtime then embedded / local database could store these entries and once the main database is back online or functioning properly, the local db could be synced with the main one. This would enhance reliability and ensure continuous operation. |
Beta Was this translation helpful? Give feedback.
-
As far as I can tell it can be quite easily done with live queries.. As I have thought of it, while there is no such replication native support, one can share schema for server and db and simply subscribe to live queries for all tables that put all the data to local replica respecting user's permissions. However the tricky part would be diffs syncs... For this obviously Change Feeds will be suitable, but again - then you need to import this manually and idk how permissions are handled with CF. In any case looks doable, but with some manual work |
Beta Was this translation helpful? Give feedback.
-
Offline capability along with a synch mechanism would be a gamechanger. I tried to achieve this using tikv by running a pd/tikv cluster on multiple nodes, each containing a surreal db instance as well. One of them was "simulating" an onprem machine that at some time could go offline, local db updates can be done and after it gets connected again it snychs with the rest of the cluster. Turns out tikv doesnt work that way and whenever my pd instance got disconnected from the rest of the cluster it failed, and with it the surreal db instance. Bummer. :-/ But would have been to easy I guess. Any idea of how to achieve this (without being to hacky) using tikv? |
Beta Was this translation helpful? Give feedback.
-
We just saw the release of 2.0 are there anything on the horizon for offline support? Specifically for my usecase it would be
|
Beta Was this translation helpful? Give feedback.
-
I think powersyn will be the bes https://www.powersync.com/
|
Beta Was this translation helpful? Give feedback.
-
Offline first apps deliver a better experience when the user goes offline. They also offer a snappier experience in general thanks to the client-side cache.
Are there any plans for supporting offline-first capabilities to surreal db, especially the features highlighted in these essays
Beta Was this translation helpful? Give feedback.
All reactions