可以备份Firebase DB吗? [英] Is it possible to backup Firebase DB?
问题描述
$ 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屋!