firestore vs firebase database

2022-04-08 00:00:00 专区 订阅 付费 交易 评论

Choose a Database: Cloud Firestore or Realtime Database

Firebase offers two cloud-based, client-accessible database solutions that support realtime data syncing:

  • Realtime Database is Firebase's original database. It's an efficient, low-latency solution for mobile apps that require synced states across clients in realtime.
  • Cloud Firestore is Firebase's new flagship database for mobile app development. It improves on the successes of the Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales better than the Realtime Database.

Which database is right for your project?

If you're comfortable with a product in beta, use Cloud Firestore for your new projects. Cloud Firestore offers additional functionality, performance, and scalability on an infrastructure designed to support more powerful features in future releases. Expect to see new query *, more robust security rules, and improvements to performance among the advanced features planned for Cloud Firestore.

As you're choosing between database solutions, consider the following differences between Cloud Firestore and the Realtime Database.

Data model

Both Realtime Database and Cloud Firestore are NoSQL Databases.

Realtime DatabaseCloud Firestore
Stores data as one large JSON tree.
  • Simple data is very easy to store.
  • Complex, hierarchical data is harder to organize at scale.

Learn more about the Realtime Database data model.

Stores data in documents organized in collections.
  • Simple data is easy to store in documents, which are very similar to JSON.
  • Complex, hierarchical data is easier to organize at scale, using subcollections within documents.
  • Requires less denormalization and data flattening.

Learn more about the Cloud Firestore data model.

相关文章