Choose a Database: Cloud Firestore or Realtime Database
Stay organized with collections Save and categorize content based on your preferences.
Firebase offers two cloud-based, client-accessible document databases. We recommend new customers start with Cloud Firestore:
Cloud Firestore is the recommended enterprise-grade JSON-compatible document database, trusted by more than 250,000 developers. It's suitable for applications with rich data models requiring queryability, scalability, and high availability. It also offers low latency client synchronization and offline data access.
Realtime Database is the classic Firebase JSON database. It's suitable for applications with simple data models requiring simple lookups and low-latency synchronization with limited scalability.
What are some other important things to consider?
After thinking about the previous key considerations, you might be ready to choose a database. If you're still weighing advantages and disadvantages, this section covers other differences between Cloud Firestore and Realtime Database.
Data model
Both Realtime Database and Cloud Firestore are NoSQL Databases.
Cloud Firestore
[ PREFERRED ]
Realtime Database
Stores data as collections of documents.
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.
Both have mobile-first, realtime SDKs and both support local data storage for offline-ready apps.
Cloud Firestore
[ PREFERRED ]
Realtime Database
Offline support for Apple, Android, and web clients.
Offline support for Apple and Android clients.
Presence
It can be useful to know when a client is online or offline. Firebase Realtime Database can record client connection status and provide updates every time the client's connection state changes.
Cloud Firestore
[ PREFERRED ]
Realtime Database
Not supported natively. You can build on Realtime Database's support for presence by syncing Cloud Firestore and Realtime Database using Cloud Functions See Build presence in Cloud Firestore.
Presence supported.
Querying
Retrieve, sort, and filter data from either database through queries.
Available in regional configurations. Databases are limited to zonal availability within a region.
Extremely low latency, with typical response times no greater than 10 ms. An ideal option for frequent state-syncing.
Read more about Realtime Database performance and reliability characteristics in the Service Level Agreement.
Uptime
Cloud Firestore
[ PREFERRED ]
Realtime Database
Extremely high uptime performance.
Typical uptime performance of 99.999%.
If availability is of the utmost importance, for example in ecommerce apps, use Cloud Firestore.
High uptime performance.
Typical uptime performance of 99.95%.
Scalability
Cloud Firestore
[ PREFERRED ]
Realtime Database
Scaling is automatic.
Scales completely automatically. Scaling limits are around 1 million concurrent connections and 10,000 writes/second. We plan to increase these limits in the future.
Has limits on write rates to individual documents or indexes.
Scaling requires sharding.
Scale to around 200,000 concurrent connections and 1,000 writes/second in a single database. Scaling beyond that requires sharding your data across multiple databases.
No local limits on write rates to individual pieces of data.
Security
Cloud Firestore
[ PREFERRED ]
Realtime Database
Non-cascading rules that combine authorization and validation.
You can use both databases within the same Firebase app or project. Both NoSQL databases can store the same types of data and the client libraries work in a similar manner. Keep in mind the differences outlined previously if you decide to use both databases in your app.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-07 UTC."],[],[]]