Current situation:
I created an application using React, NodeJS, and Electron. Most users are a kind of offline user. They use my application offline.
The following plans:
Now I plan to create a mobile application for them. I plan to create this application using React-Native.
Since their database is disabled, I planned to give them sync to firebase buttonin a desktop application. When it clicks sync to firebase button, the data in their local mongodb should synchronize with firebase.
My thoughts:
- when a new entry is added to mongodb, I will keep the new key with this entry, which will be as follows:
new: true. - When updating the record, I will save the key with the name
updated: true - similarly for deleting ...
And then, when the user clicks Sync to firebase, I will search for these entries and add / update / delete the corresponding entries in firebase, and then I will remove these keys from the mongodb database.
Problems fulfilling my thoughts:
It doesn't smell so good at first, because I think it takes a lot of time, because I will perform operations on firebase, as well as with mongodb.
Another problem with this approach is that if I think the other way around, when a user adds / updates / deletes a record from a React-Native application, firebase will have these lines of lines new / updated / deleted, and then when the user clicks sync in the desktop application, I have to do the same, but vice versa.
, , , ?
.
:
, . - , mongodb firebase ?