DataStore is a persistent on-device storage from AWS. Under the hood it uses IndexDB on the web and SQLite on mobile. Its compelling feature is the ability to model data with the graphql syntax. You can then interact with the data models online or offline. DataStore, then, takes care of syncing the data to dynamoDB. https://aws.amazon.com/blogs/aws/amplify-datastore-simplify-development-of-offline-apps-with-graphql/
My initial plan using Yjs with Datastore was:
- creating an updates tables
- on a remote update commit the update to Yjs
- on a local update write the update to the updates table. With the syncing mechanism. the update will end up in dynamoDB then dispatched to whoever listens to it. then run step 2
Then I stumbled upon @dmonad comment on why it’s better/cheaper to use a custom webSocket server as writing granular updates to db is expensive/slow. https://github.com/yjs/yjs/issues/189#issuecomment-707703284
I went out to build a custom Websocket server to later find out that I would anyway have to write updates to DynamoDb in order to persist Data. see “bindState” in: https://github.com/yjs/yjs/issues/170#issuecomment-536464934
Can anyone please help me clear out this confusion? Is piggybacking on DataStore syncing engine to forward updates, even a good idea?