从MongoDB迁移到Firebase [英] Migrating from mongodb to firebase

查看:142
本文介绍了从MongoDB迁移到Firebase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序目前使用MongoDB,我期待将其迁移到Firebase。



有多容易,有什么需要注意的。

解决方案鉴于MongoDB和Firebase本质上都是非关系型的,大部分数据都应该干净地映射到Firebase。 Firebase REST端点支持常规的JSON,因此将数据存入(以及如果您选择退出)也应该很容易。您需要注意的主要方面是:


  1. Firebase API本质上是实时/异步的;具体来说,当客户端正在读取数据。将您的后端请求/响应代码迁移到客户端,并使用这种方法可能是最大的努力层面。

  2. MongoDB的功能集也会有所不同和Firebase提供;值得注意的地方包括Mongo对MapReduce,Cursors和自由文本查询等功能的支持(Firebase目前不支持这些地方)。



<另外要记住的是,Firebase并不是一个完全或没有的事业。应用程序绝对可以利用实时,缩放和平台功能。

My app currently uses mongodb and I'm looking forward to migrating it to firebase instead.

How easy is it to do and are there things I have to watch out for.

解决方案

Given that both MongoDB and Firebase are non-relational in nature, most of your data should map to Firebase cleanly. The Firebase REST endpoints support regular JSON, so getting your data in (and, back out if you choose) should also be easy. The main areas you need to keep watch for are:

  1. The Firebase API is realtime/asynchronous in nature; specifically, when clients are reading data. Migrating your backend request/response code to the client and using this approach will probably be the biggest area with regard to level of effort.
  2. There will also be a disparity in the feature set that MongoDB and Firebase provide; notable areas include Mongo's support for doing things like MapReduce, Cursors, and free-text queries (Firebase doesn't currently support these areas).

The other thing to keep in mind is that Firebase isn't an all-or-nothing type of undertaking. Apps can definitely take advantage of the realtime, scaling, and platform features piecemeal.

这篇关于从MongoDB迁移到Firebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆