可以备份Firebase DB吗? [英] Is it possible to backup Firebase DB?

查看:106
本文介绍了可以备份Firebase DB吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想知道是否有任何常见的做法备份Firebase数据库。我关心的是一些程序意外地抹掉了我们的数据库。
$ b

谢谢!

解决方案

截至这个问题的时候,Firebase每天都会备份所有的实例。因此,尽管保留自己的备份可能仍然有用,但这不是必需的。



要创建自己的备份,只需简单地调整数据即可:

  curl https://< instance> .firebaseio.com / .json?format = export 
pre>

请注意,对于多个千兆字节的数据,这会减慢速度并锁定短时间的读取访问。在这种情况下,更好的办法是将备份分块并使用较小的部分。通过提供密钥列表,浅参数可以帮助您对于Firebase中的任何给定路径,无需首先获取数据。

  curl https://< instance> .firebaseio .com / .json?shallow = true 

如前所述,还有几个GitHub库可供这和增量备份是实用的一些创造力和一个工作人员的线程在实时的SDK。


Was wondering if there are any common practices in backup up a firebase DB. My concern is some process accidentally wiping out our Database.

Thanks!

解决方案

As of the time of this question, Firebase backs up all instances daily. So while keeping your own backups may still be useful, it's not essential.

To create your own backups, you can simply curl the data:

curl https://<instance>.firebaseio.com/.json?format=export

Note that for multiple gigabytes of data, this will slow things down and lock read access for a short period. It would be better in this case to chunk the backups and work with smaller portions. The shallow parameter can help here by providing a list of keys for any given path in Firebase, without having to fetch the data first.

curl https://<instance>.firebaseio.com/.json?shallow=true

As previously mentioned, there are also several GitHub libs available for this, and incremental backups are practical with some creativity and a worker thread on the real-time SDK.

这篇关于可以备份Firebase DB吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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