(/docs/projects/learn-more)
  * [ Supported platforms & frameworks  ](/docs/libraries)
  * [ Use Emulator Suite  ](/docs/emulator-suite)
  * [ AI assistance with Gemini in Firebase  ](/docs/gemini-in-firebase)

  * [ Emulator Suite  ](/docs/emulator-suite)
  * [ Authentication  ](/docs/auth)
  * [ Realtime Database  ](/docs/database)
  * [ Firestore  ](/docs/firestore)
  * [ Storage  ](/docs/storage)
  * [ ML  ](/docs/ml)
  * [ Hosting  ](/docs/hosting)
  * [ Cloud Functions  ](/docs/functions)
  * [ Security Rules  ](/docs/rules)
  * [ App Check  ](/docs/app-check)
  * [ Extensions  ](/docs/extensions)

  * [ Crashlytics  ](/docs/crashlytics)
  * [ Performance Monitoring  ](/docs/perf-mon)
  * [ Test Lab  ](/docs/test-lab)
  * [ App Distribution  ](/docs/app-distribution)

  * [ Analytics  ](/docs/analytics)
  * [ Remote Config  ](/docs/remote-config)
  * [ A/B Testing  ](/docs/ab-testing)
  * [ Cloud Messaging  ](/docs/cloud-messaging)
  * [ In-App Messaging  ](/docs/in-app-messaging)
  * [ Dynamic Links  ](/docs/dynamic-links)
  * [ Google AdMob  ](/docs/admob)
  * [ Google Ads  ](/docs/ads)
  * [ App Indexing  ](/docs/app-indexing)

Firebase is back at Google I/O on May 14! [ Register now.
](https://io.google/2024/?utm_source=firebase&utm_medium=embedded_marketing&utm_campaign=&utm_content=)

  * [ Firebase ](https://firebase.google.com/)
  * [ Documentation ](https://firebase.google.com/docs)
  * [ Firestore ](https://firebase.google.com/docs/firestore)
  * [ Build ](https://firebase.google.com/docs/build)

Send feedback

#  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. 

Learn more about the [ Cloud Firestore data model ](/docs/firestore/data-model) .  |  **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
](/docs/database/web/structure-data) .  
  
###  Realtime and offline support

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   
---|---  
**N