Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync to server database? #170

Open
pwFoo opened this issue Mar 27, 2021 · 1 comment
Open

Sync to server database? #170

pwFoo opened this issue Mar 27, 2021 · 1 comment

Comments

@pwFoo
Copy link

pwFoo commented Mar 27, 2021

Hi,
would be nice to have a option to sync changes to server backend like mysql, postgres or a headless cms (directus)?

To keep it simple maybe there is a way to add a event listener for insert, update and delete actions of tuffydb? Event callback could be used to sync changes to the backend.

But to deal with offline clients maybe a service worker and event queue is needed to update changes during client was offline...

What do you think? Would it a possible extension or do you see problems with such a feature?

TuffyDB ist awesome! It's great to use queries for array of objects! 👍

@pwFoo
Copy link
Author

pwFoo commented Apr 5, 2021

I thank that could be done by hook localstorage store / sync feature? Is there a way to hook into that write / read to localstorage and trigger a custom function / extension?

At the moment I plan to use taffydb as client site cache of data to work offline. So just updates, deletes and inserts need to be queued and send to a server api / db.

To update cache it would be easier to replace the data... Won't work for all applications because of client and server side data changes, but with small offline working apps without much server side changes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant