mySQL authoritative database - combined with Firebase

放肆的年华 提交于 2019-12-04 06:59:39

The entire topic is incredibly broad, definitely too broad to provide a simple answer to.

I'll stick to the use-case you provided in the comments:

Imagine that you have a checklist stored in mySQL, comprised of some attributes and a set of steps. The steps are stored in another table. When someone updates this checklist on Firebase - how would I sync mySQL as well?

If you insist on combining Firebase and mySQL for this use-case, I would:

  1. Set up your Firebase as a work queue: var ref = new Firebase('https://my.firebaseio.com/workqueue')

  2. have the client push a work item into Firebase: ref.push({ task: 'id-of-state', newState: 'newstate'})

  3. set up a (nodejs) server that:

    1. monitors the work queue (ref.on('child_added')
    2. updates the item in the mySQL database
    3. removes the task from the queue

See this github project for an example of a work queue on top of Firebase: https://github.com/firebase/firebase-work-queue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!