Firebase存储和Cloud Firestore/实时数据库之间有什么区别?

问题描述:

我一直在使用Google Firebase的实时数据库,但希望能够存储更复杂的用户生成的数据,例如图像,视频等.根据Firebase文档,它们还提供其他两项服​​务:"Firebase存储"和云"Firestore".有人可以总结一下类似的存储"和存储"之间的区别吗.

I have been using Google Firebase's Realtime Database, but want to be able to store more complex user-generated data like images, videos etc. As per the Firebase docs, they provide two other services: 'Firebase Storage' and 'Cloud Firestore'. Can someone please summarise what the difference is between the similarly named 'Storage' and 'Firestore'.

这些产品并没有真正的可比性.它们几乎没有什么共同之处,只是从Firebase客户端的角度来看,这些应用程序是由安全规则控制的.

The products are not really comparable. They have almost nothing in common, except from the perspective of the Firebase client, apps which are gated by security rules.

云存储仅用于使用类似于文件系统路径的路径存储二进制数据.它不是数据库,您无法真正像一个数据库一样查询它.它通常用于图片,视频,PDF,备份/导出以及其他非常大的原始数据.可以将单个对象中存储的数据大小限制为5GB.它非常便宜,并且针对下载速度进行了优化,并且可以由CDN提供.

Cloud Storage is just for storing binary data using paths that look like filesystem paths. It's not a database, and you can't really query it like one. It's typically used for things like pictures, videos, PDFs, backups/exports, and other raw data which can be very large in size. There is a 5GB limit to the size of data you can store in a single object. It's dirt cheap and optimized for download speed, and can be served by CDN.

Firestore 是用于查询数据的数据库,几乎从未用于存储二进制数据.您可以使用它来存储要查询的实际值,例如名称,时间和其他元数据.由于Firestore文件的大小限制为1MB,因此也极大地削弱了其存储大量数据(如Cloud Storage)的能力.与Cloud Storage相比,存储和传输数据通常也更昂贵,因为您为很多付出的不仅仅是基本的存储功能.

Firestore is a database used for querying data and is almost never used for storing binary data. You use it to store actual values that you intend to query, such as names, times, and other metadata. Since a Firestore document is limited to 1MB in size, that also drastically cripples its ability to hold very large amounts of data like Cloud Storage. It's also generally more expensive to store and transfer data compared to Cloud Storage, as you're paying for much more than just basic storage capabilities.

我建议阅读文档以获取有关这些产品的更多详细说明.应该清楚他们正在尝试解决哪些具体问题,因为它们在功能上基本上没有重叠.

I suggest reading the documentation for more detailed descriptions of these products. It should be clear what specific problems they are trying to solve, as they have essentially no overlap in functionality.