I just released my first MVP app on the iOS app store, and its doing really well. The app is essentially a chat application that uses Firebase.
Since I'm using Firebase, it's really hard to do complex queries. And in order for me to add cool features to my app. I need to be able to do that.
I decided to use NodeJs and MongoDB to run my app. However I don't want to kill what I have going right now. Is there any way, to migrate the data I have in Firebase to MongoDB and keep it in sync real time?
I was considering doing an
observeSingleEvent to download all the data. and then using
childremoved to keep everything in sync realtime.
Is this going to be an issue if you have a lot of active users on the app?
Also, is there a service that offers to do that?
Congratulations on the app. The problem you are facing is a classic database migration problem. My usual recommendation is the approach you outline: make a copy of the data into the new system, then keep them in sync while you move over functions to read from the new database, then finally turn off the old database completely.
This has a number of advantages: - Access to full MongoDB functionality & scalability - No lock-in for which cloud provider you use, or services you make use of - Powerful, fine-grained access controls, which you control
I see this is an old post, I hope your migration was a success!
I would like to take the opportunity to point others that want to migrate away from Firebase to a new open source alternative called AceBase, which is inspired by Firebase and has powerful indexing and querying options. AceBase uses the same syntax as Firebase, so it's actually possible to keep most of your existing Firebase code and it should work with AceBase.
On top of that, AceBase is able to cache your data in the browser (IndexedDB) so your app can be used offline. Any changes made while offline are automatically synchronised with the server upon reconnect.
AceBase also has a unique feature called "live data proxies" that allows you to code against an in-memory object that contains your data. All local changes to the object are automatically stored in the database and synced with the server, and remote changes are reflected in your local object in realtime.
Check out AceBase at npm: https://www.npmjs.com/package/acebase