How to keep Firebase in sync with another database -
we need keep our firebase data in sync other databases full-text search (in elasticsearch) , other kinds of queries firebase doesn't support.
this needs close real-time possible, can't export nightly dump of firebase json or that, aside fact rather large.
my initial thought run node.js client listens child_changed, child_added, child_removed etc... events of main lists, bit unweildy , reliable way of syncing if client re-connects after period of time?
my next thought maintain list of "items changed" events , write every time item created/updated, similar firebase work queue example. queue contain full path data has changed , worker consumes , updates local database accordingly.
the problem here every bit of code makes updates has remember write queue otherwise 2 systems out of sync. proxy code shouldn't hard write though.
has else done similar success?
for search queries, can integrate directly elasticsearch; there no need sync secondary database. firebase has blog post integrating , lib, flashlight, make quick , painless.
Comments
Post a Comment