If you're looking for a scalable and robust database solution for your mobile or web app, Firebase has two different options: the Realtime Database and Cloud Firestore.

In this blog post, we'll look at some differences between the two and assist you in choosing which one might be best for your project.

Realtime Database: Real-time synchronization protocol

The Firebase Realtime Database is a cloud-hosted NoSQL database that uses a real-time synchronization protocol to keep data updated across connected devices.

Cloud Firestore: Structured data and advanced querying capabilities

Cloud Firestore is also a cloud-hosted NoSQL database, and while both are designed to be scalable, reliable, and provide real-time data synchronization across devices, Cloud Firestore offers more advanced querying capabilities, a more flexible data model, and a different pricing model compared to the Firebase Realtime Database.

Both the Realtime Database and Cloud Firestore are part of the Firebase platform and offer SDKs for various programming languages to help developers easily integrate them into their apps.

Additionally, they both come with offline support and allow for easy integration with other Firebase services, such as Firebase Authentication and Cloud Functions.

There are numerous aspects to consider when developing an application. And all of them are primarily focused on the client side of the project. When it comes to the server for your application, things can get difficult, with challenges like security, scalability, and data storage to consider.

Let's say you're building a productivity app for a team of people who work remotely. The app needs to have a centralized place to store information about tasks, deadlines, and project progress. You could save this information on individual team member's computers, but that would make it difficult for everyone to stay on the same page and coordinate their efforts efficiently.

Instead, you could use a cloud database to store all the information in a central location that's accessible to everyone on the team, no matter where they are located. This way, each team member can log in to the app from their own device and see the same up-to-date information. And if someone updates a task or deadline, that change will be immediately visible to everyone else on the team, regardless of where they are located.

This is known as the cloud. Consider the cloud to be someone else's computer or an entire infrastructure that you've rented for numerous services.

This is where Firebase comes in - a platform that makes it easier to store and manage data on the server. It offers an easy-to-use database solution that is scalable, secure, and can be used across multiple platforms.

Launch, Scale, and Simplify your applications

Both databases are fully managed, which means that Firebase handles infrastructure, scaling, and maintenance, leaving developers free to focus on building their applications.

They also provide strong security features to safeguard the data saved in the databases.

The following are some benefits of using Firebase cloud databases:

Launch applications and features faster

Firebase databases provide an excellent developer experience, with capabilities such as live synchronization and offline support that make it easy to create real-time apps.

Direct database access also speeds up the creation of web, IoT and mobile apps by eliminating the need for a server in the middle.

They also come with customizable security and data validation rules to ensure that the data is always protected.

All of these features are available through a strong set of client and server-side libraries, making it simple for developers to integrate Firebase into their apps.

Furthermore, Firebase integrates seamlessly with other Google Cloud services such as Cloud Functions and BigQuery, adding even more capabilities to your applications.

Effortlessly scale to meet unpredictable demand

These databases are serverless and can effortlessly scale up and down based on demand without any maintenance. This way you don't need to worry about the database's capacity when there's a sudden influx of users.

With highly available, strongly consistent data replication, Firebase databases guarantee 99.99–99.999% uptime, so your data is always accessible when you need it. This eliminates the need for additional infrastructure, allowing you to focus on your app development and providing a seamless user experience.

Simple and flexible pricing with pay as you go

Firebase databases offer a flexible and cost-effective solution for businesses of all sizes. With a no-ops database, you can pay for only what you use and avoid any up-front expenditures or wasted resources. This means that you can focus on building your application and not have to worry about maintaining a database infrastructure.

The Firebase Realtime Database is an ideal solution for developers who need to store and sync data across multiple clients in real time.

With this NoSQL cloud database, data is stored in JSON format and is available to all connected clients, and remains available when your app goes offline, as the Realtime Database persists your data to disk and synchronizes it with the current server state once the device regains connectivity.

Whether you're developing for iOS, Android, or the web, your clients will share one Realtime Database instance, which ensures that they all receive updates with the newest data in real time.

Realtime updates

Collaborative experiences without networking code

With data synchronization, any change made to data is reflected across all connected devices within milliseconds, ensuring that everyone has access to the latest version of the data. This feature allows for seamless collaboration and provides an immersive experience to the users.

The use of subscriber mechanisms, instead of typical HTTP requests, means that the app can easily provide real-time updates with minimal effort and without worrying about networking code, making the process of building flexible real-time apps a breeze. This capability enhances user experience, a game-changer for modern apps.

Offline support

To be honest, the offline support feature of Realtime Database makes it stand out among other cloud-hosted databases.

In the event of network connectivity issues, the Firebase Realtime Database persists data locally to disk. With an internal cache of all data queried, the app remains responsive even when there is no internet connection, as the app uses the data from the cache.

Once the device connects back to the internet, the Realtime Database synchronizes the local data changes with the remote updates that occurred while the client was offline, resolving any conflicts automatically.

This feature ensures that your users have access to the latest data even if they lose network connectivity.

Serverless

Accessible directly from client devices

This is one of the key advantages of the Firebase Realtime Database as there’s no need for an application server, which means that developers can access the database directly from a mobile device or web browser.

This allows for greater flexibility and convenience in accessing and managing data.

Additionally, Firebase Realtime Database Security Rules ensure that data is kept secure and confidential, as developers can define who has access to what data and how they can access it.

These expression-based rules are executed when data is read or written, providing a robust security framework for the database.

Scale across multiple databases

If you're planning to develop a large-scale app that will demand massive volumes of data storage, Firebase Realtime Database has you covered. You can partition your data among many database instances in the same Firebase project with the Blaze price plan, making it simple to accommodate your app's data demands at scale.

You may also restrict data access in each database by configuring specific Firebase Realtime Database Security Rules for each instance.

It's important to remember that Firebase Realtime Database isn't entirely free, with fees based on the amount of connections, disk utilization, and network usage. Visit the Firebase pricing page to learn more about the pricing plans for Firebase Realtime Database.

Enabling collaborative experiences with realtime updates

The Firebase Realtime Database offers a range of features that allow developers to build rich and collaborative applications while providing secure access to the database directly from client-side code. This is achieved by persisting data locally and firing real time events even while offline, ensuring that users can always have a responsive experience.

When integrated with Firebase Authentication, developers can easily authenticate users and control access to the database.

As a NoSQL database, the Realtime Database offers different optimizations and functionality compared to relational databases. It stores the data in JSON format, and the entire database is a big JSON tree with multiple nodes.

This enables developers to build great real-time experiences that can serve millions of users without compromising on responsiveness.
However, you need to plan your database structure to optimize how users access the data.

The Firebase Realtime Database stores data in the JSON format. This format has only a few value types: strings, numbers, booleans, lists, objects, and null. It is simple for humans to read and write, and for computers to parse and generate.

This is a sample JSON object:

{
  "name": "John",
  "age": 30,
  "city": "New York",
  "interests": ["reading", "traveling", "cooking"],
  "isMarried": true,
  "address": {
    "street": "123 Main St",
    "city": "New York",
    "state": "NY",
    "zip": "10001"
  }
}

As previously stated, the entire database is a large JSON tree with many nodes. When you add new data to the database, you either add a new node with a new key or update an existing one. While it is possible to nest data up to 32 levels deep, it is advisable to avoid creating a deeply nested structure.

Keep in mind that Firebase Realtime database has some sorting and filtering limitations compared with what you can typically do with relational databases.

When planning your data structure, consider how it will be consumed and make saving and retrieving data as easy as possible. This will ensure that your data is optimized and your application remains responsive.

Firebase Cloud Firestore is a fully managed, serverless document database that can easily scale to meet any demand without the need for maintenance. It enables developers to create web, IoT and mobile apps with direct database connectivity, as well as built-in live synchronization and offline mode to aid in the development of real-time applications.

Cloud Firestore also offers fully customized security and data validation rules to ensure that data is always protected.

It also integrates seamlessly with other Firebase and Google Cloud services like Cloud Functions and BigQuery, making it simple to create flexible, scalable NoSQL cloud databases for client and server-side development.

Data flexibility

Cloud Firestore allows for data modeling flexibility.

The database supports hierarchical data structures, allowing you to store data in collections and documents, with documents including complicated nested objects and subcollections.

This adaptability allows developers to construct more efficient and organized data structures that can be queried and accessed more easily. You can design a more comprehensible data structure that mimics the real-world relationships between your data objects by employing a hierarchical model.

This is particularly useful for applications with complicated data structures, such as e-commerce sites, social networking platforms, and messaging apps.

With Cloud Firestore, you can organize your data in whatever way that best matches the requirements of your application.

Expressive data querying

To get data from your database, Cloud Firestore provides powerful querying features.

You can run a one-time fetch query or get all the pages in a collection that meet your query parameters. You can mix several filters, combine them with sorting, and utilize the powerful query engine to perform sophisticated ACID transactions on your document data with Firestore.

Furthermore, Firestore automatically indexes your data, ensuring that query performance scales with the size of your result set rather than the size of your data set.

Live synchronization and offline mode

Cloud Firestore is designed to make simple, one-time fetch queries efficiently, in addition to using data synchronization like Realtime Database. This function is critical for use cases including real-time analytics, activity tracking, communication, and gaming leaderboards.

In addition, Cloud Firestore caches data that the app is actively using, allowing it to read, write, listen, and query data even if the device is offline. When the device reconnects to the internet, Cloud Firestore automatically synchronizes any local changes back to the database, ensuring data consistency across all devices.

Designed to scale

Thanks to Google Cloud's powerful infrastructure, Cloud Firestore can achieve high scalability and reliability.
It offers automatic multi-region replication, meaning that your data is always safe and available, even in the event of a disaster.

Additionally, Cloud Firestore has a 99.999% availability guarantee while providing atomic batch operations, and real transaction support, making it suitable for even the toughest database workloads from the world's biggest apps.

By using Cloud Firestore, you can rest assured that your data is in good hands and will be able to handle any scale of traffic or usage.

Serverless

Cloud Firestore is a fully managed, serverless document database that allows you to focus on developing your application, without worrying about database maintenance.

This means that you don't need to worry about scaling up or down to meet demand, as it's done automatically for you. With no maintenance windows or downtime, you can be confident that your app will be available to your users when they need it.

Security

Cloud Firestore integrates seamlessly with Firebase Authentication and Identity Platform, allowing developers to implement customisable identity-based security access controls to their data.
This integration protects sensitive data by limiting access to only authorized individuals.

Furthermore, Cloud Firestore provides data validation using a configuration language, allowing developers to validate the data being written to the database and guarantee that it matches particular requirements.
This integration ensures that data is always secure, and validation rules can be tailored to your application's particular needs.

Libraries for popular languages

Firestore provides client-side development libraries for a range of platforms, including web, iOS, Android, Flutter, C++, and Unity.
This makes it easy for developers to build applications on their platform of choice.

Additionally, Firestore supports traditional server-side development libraries for Node.js, Java, Go, and Python through the Firebase Admin SDK. This SDK allows developers to perform server-side operations, such as authenticating users, sending notifications, and accessing the different Firebase database products, using a single library.

Cloud Firestore is a powerful document-oriented NoSQL database that stores data in documents rather than rows and tables like traditional SQL databases. Each document contains fields that map to specific values, which are then stored in collections that are used to organize data and facilitate easy querying.

Firestore data structure illustration

Documents support a wide range of data types, from simple strings and numbers to complex, nested objects. Cloud Firestore also allows developers to create sub collections within documents to build hierarchical data structures that can scale as the database grows.
The Cloud Firestore data model supports whatever data structure works best for your app.

Cloud Firestore also has querying capabilities that are efficient, expressive, and flexible. Shallow queries allow developers to access data at the document level without having to retrieve the complete collection or any nested subcollections.

They can paginate results using cursors or add sorting, filtering, and limits to queries.

Developers can also add real-time listeners that notify them with a data snapshot anytime the data changes, fetching only the new changes, keeping data in apps up to date.

Access to data in Cloud Firestore is protected using Firebase Authentication and Cloud Firestore Security Rules for mobile and web apps, or Identity and Access Management (IAM) for server-side languages.

With these tools, developers can ensure that their data is secure and protected from unauthorized access.

If you are unclear about when you would choose one over another, let me guide you through the main differences between Realtime Database and Cloud Firestore and help you decide.

Cloud Firestore, unlike the Firebase Realtime Database giant JSON tree where anything goes, is a document-model database, where all data is stored in key-value pairs in objects called documents, and these documents are grouped into collections.

Firestore collection illustration

This structured data model provides several advantages, including better querying capabilities and the ability to store data hierarchically without fetching unnecessary data.

Firestore data structure illustration

All queries are shallow, and you can fetch a document without fetching all the data contained in the linked subcollections.

For example, it's possible to retrieve the document located at the top without fetching any of the documents in the subcollections below.

Firestore data structure illustration

Better querying

Additionally, with Cloud Firestore you no longer need to create explicit fields or denormalize data to create queries across multiple fields.

Imagine you had a list of cities, and you wanted to find a list of all cities in California with a population greater than 500k.

Firestore data example

In the Realtime Database, you'd need to conduct this search by creating an explicit "states plus population" field just for those queries and sort the query on that field.

Firebase complex query - Realtime Database
citiesRef.orderByChild('state_and_pop')
  .startAt('California_00500000')
  .endAt('California_99999999');

In some cases, Cloud Firestore can automatically search across multiple fields or guide you towards automatically building an index to make these types of queries possible.

Firebase complex query - Cloud Firestore index

... and then you can simply search across multiple fields.

Firebase complex query - Cloud Firestore
citiesRef
  .where('state', '==', 'California')
  .where('population', '>', 500000);

The index is automatically maintained throughout the lifetime of your app, making it easy to search across multiple fields.

Why is it a better choice for large-scale apps

The Realtime Database can handle scaling pretty well for many apps, but it can become difficult when an app becomes extremely popular or when the dataset gets too large.

In contrast, Cloud Firestore is built on top of the Google Cloud infrastructure, making it highly scalable to a much greater capacity than the Realtime Database.

For example, the Realtime Database can only accept up to 100,000 concurrent connections, while Cloud Firestore can handle up to 1,000,000 concurrent client connections per database.

Additionally, Cloud Firestore offers a more robust Service Level Agreement with 99.999% uptime in multi-region instances and 99.99% uptime in regional instances. Realtime Database, by contrast, guarantees 99.95% uptime.

Furthermore, with the new querying structure, all Cloud Firestore queries scale to the size of the result set rather than the data size, making it impossible to write a sluggish query in Cloud Firestore regardless of database size.

Let's say you have an e-commerce app that sells clothing and you want to display a list of the top-selling items for the month.

With the Realtime Database, you would need to denormalize your data and create a separate field that keeps track of the number of times each item has been purchased. Then, you would need to sort your data by this field to retrieve the top-selling items.
As your data set grows, this becomes increasingly difficult and time-consuming.

With Cloud Firestore, however, you can simply query your data and sort it by the number of purchases to retrieve the top-selling items.
And because Cloud Firestore queries scale to the size of your result set, the amount of time it takes to retrieve this information remains the same, regardless of the size of your data set.

From real-time to one-time queries

Many developers used the Firebase Realtime Database for its real-time nature, especially for chat and collaborative features.

However, some developers only wanted to use it as a traditional data fetching service.

While the Realtime Database does support one-time fetch queries with once() calls, they can feel unnatural and play second-fiddle to streaming methods.

With Cloud Firestore, one-time fetch queries are a primary use case and more natural to make.

You can still add support for listeners to receive updates when data changes in the database, but now you have the flexibility to retrieve data in any way you want.

Cloud Firestore provides multi-region locations, which means that your data is replicated across multiple geographies.

This ensures that your data is served even if a data center or an entire region goes down. There are currently two multi-region locations, one in North America and one in Europe. Furthermore, Cloud Firestore offers regional instances in locations around the world for a lesser cost.

The Realtime Database, on the other hand, is exclusively available in North America.

Cloud Firestore and Realtime Database have different pricing models.

The cost of the Realtime Database is determined by the amount of data downloaded and stored on the database, whereas the cost of the Cloud Firestore is determined mostly by the number of reads or writes.

This makes Cloud Firestore more favorable for mobile apps that occasionally request larger chunks of data, such as news or dating apps, or turn-based games.

However, if an app is making a large number of reads and writes per second, such as a group whiteboarding app, Cloud Firestore will likely be more expensive.

Nonetheless, you can use both databases together. For more detailed information, check out the Pricing section of the documentation.

While Cloud Firestore has various advantages over Realtime Database, there are certain scenarios where the latter may be preferable.

Detecting presence

One area where the Realtime Database still has an edge over Cloud Firestore is its native support for detecting user presence. With the Realtime Database, you can easily determine when a user goes online or offline, making it ideal for chat applications and other real-time collaborative tools.

Although Cloud Firestore also has a solution for detecting presence, it's not as straightforward or elegant as the Realtime Database's implementation.

Better latency

Cloud Firestore is known for its efficient querying and scalability, but when it comes to latency, the Realtime Database still has a slight edge. While the difference may not be noticeable in most use cases, it's worth considering if your app requires very low-latency operations.

That being said, Cloud Firestore still provides fast read and write times and is optimized for high concurrency, so it's unlikely that latency would be a major issue for most apps.

Pricing model

The cost for the Realtime Database is determined primarily by the amount of data that's downloaded and stored on the database, while Cloud Firestore's cost is based on the number of reads and writes performed.

Cloud Firestore's pricing can be more cost-effective for apps that require less frequent, but larger data transfers.

On the other hand, Realtime Database may be better suited in terms of cost-effectiveness for smaller apps that do not require the advanced querying capabilities or multi-region support of Cloud Firestore.

Ultimately, the choice between Cloud Firestore and the Realtime Database depends on your app's specific needs and requirements.

Firebase Remote Config allows developers to change the behavior and appearance of their app without the need for users to download a new update. By storing and managing key-value pairs, you can remotely configure the behavior and appearance of your app in real-time.

This feature can be particularly useful for testing and rolling out new features, promotions, or customization options.

This enables developers to control the user experience without having to release a new version of their app which can also improve user engagement and retention.

Firebase Hosting is a hosting platform that allows developers to host and deploy web applications with ease. It is fully integrated with Firebase, and enables developers to reliably deploy their website in minutes and serve both static and dynamic content to a global CDN.

Among its features, you can configure custom domains, SSL encryption, and automatic HTTPS enforcement.

Firebase Hosting supports static content such as HTML, CSS, and JavaScript files.

Developers can quickly serve dynamic content and host microservices for their web and mobile applications that respond to specific triggers or run in a managed, secure environment by combining Firebase Hosting with serverless computing options like Cloud Functions for Firebase and Cloud Run.

With Cloud Functions for Firebase, developers can write and deploy backend code that responds to specific triggers, and then use Firebase Hosting to direct HTTPS requests to trigger their function to run.

Similarly, with Cloud Run, developers can write and deploy containerized applications, and then use Firebase Hosting to direct HTTPS requests to trigger their app to run.

Cloud Storage is a service that stores and serves content created by users such as videos, images, and audio files. These files are saved in the cloud and are easily accessed by your users. It can also be used to transfer files between your app and other users, as well as between various apps.

Cloud storage is a scalable and safe method of storing massive volumes of data, with the ability to store and access data from anywhere in the globe.

Furthermore, it smoothly connects with other Firebase services such as Firebase Authentication and Cloud Functions to create a complete backend architecture for your app.

Cloud Functions are a game-changer for developers, they provide a simple and straightforward way to handle events in your Firebase databases.

The Firebase team has created an SDK for cloud functions, which allows you to connect to your database without writing custom code via the Firebase Admin SDK. The SDK provides triggers for Real-time Database, Firestore, and Firebase Authentication, allowing you to execute functions on database changes or user creation, update, or delete.

In a typical lifecycle, these functions wait for changes to a particular database location, and get triggered when an event occurs, and when it does, it receives a data object that contains a snapshot of the data stored in the specified document.

Cloud Functions supports various event types both for Realtime Database and Cloud Firestore with minor differences. The most notable being which object from the Firebase Admin SDK you should use in each case: functions.firestore and functions.database.

  • onCreate(): which triggers when new data is created in the database
  • onUpdate(): which triggers when data is updated
  • onDelete(): which triggers when data is deleted
  • onWrite(): which triggers when data is created, updated, or deleted

As we mentioned before, Firebase databases are designed to be used without the need for a server to mediate the communication between the client and the database. However, it is still possible to add logic to your server to interact with Firebase databases.

To accomplish this, you must first install the Firebase Admin SDK, which is a collection of server libraries that allows you to connect with Firebase from privileged environments such as Node.js, Java, Python, and Go.

In particular, the Admin SDK has two packages that allow you to interact with Firebase databases: the firebase-admin.database package and the firebase-admin.firestore package.

It's worth mentioning that interacting with Firebase databases is not the only capability of the Admin SDK, you can also:

  • Send Firebase Cloud Messaging messages programmatically
  • Create and validate Firebase authentication tokens
  • Access Google Cloud resources such as Cloud Storage buckets connected with your Firebase projects

When it comes to Firebase databases, security is a top priority.

While both Cloud Firestore and the Realtime Database have similar security and access rules capabilities, their implementation and details differ slightly.

The Rules tab in both Realtime Database and Cloud Firestore, allows you to specify who has access to your database and what they can do there.
By default, the rules are quite lax and allow anyone to read and write from your database.
However, before making your application live, it is essential to update these rules with something more restrictive.

As Firebase-powered apps run more client-side code than those with other technology stacks, the way they approach security may be different than what you're used to.

Cloud Firestore Security Rules

With Cloud Firestore Security Rules, you can create access controls and data validation in an easy-to-understand format.

To create user- and role-based access systems that protect your users' data, you must combine Firebase Authentication with Cloud Firestore Security Rules.
This ensures that only authorized users can access your app's data and perform authorized actions.

With Security Rules, developers can enforce granular access controls, specify the conditions under which data can be read, and set up validation and transformation of data.

Writing rules

Writing Cloud Firestore Security Rules involves using match statements to identify the documents in your database and allow expressions to control access to them. It's important to note that every request made from a Cloud Firestore mobile or web client library is evaluated against these security rules before any data is read or written.

If the rules deny access to any specified document paths, the entire request will fail. This makes it easy to prevent unauthorized access to your data and keep it secure.

Testing rules

The Cloud Firestore rules simulator is a fantastic tool to test your ruleset and assure the security of your database.

The simulator, which is accessible via the Rules tab in the Cloud Firestore area of the Firebase console, allows you to test both authenticated and unauthenticated reads, writes, and deletes.

It is necessary to note that simulated requests are performed against the ruleset in your editor, not the ruleset that is currently deployed, so make sure to deploy your ruleset after properly testing it.

Firebase Realtime Database Security Rules

You can decide who can read and write to your database, how your data is structured, and what indexes exist using Firebase Realtime Database Security Rules.

The Firebase servers automatically enforce these rules, and every read and write request will be performed only if your rules allow it.
Initially, the rules do not allow anyone access to your database to protect it from abuse, but you can customize them later or set up authentication.

You can write security rules using a simple and expressive syntax that allows you to control access to your data based on user authentication, user roles, or other conditions. This syntax can be categorized into four types:

  • The first type is .read, which specifies when and if users are allowed to read data
  • The second type is .write, which describes when and if users can write data
  • The third type is .validate, which defines the format of a value, its child attributes, and the data type
  • Finally, the .indexOn type specifies which child to index. This enables ordering and querying

By using these different types of rules, developers can customize their Realtime Database security to best suit their app's needs.

Authentication access rules

By properly identifying your users, you can then enforce user permissions and ensure that each user only has access to the data and actions that they are authorized to use.

This is particularly important in applications where different users may have different levels of access or capabilities, such as in a messaging app where each message is associated with a specific user and users may only be able to delete their own messages.

Authorization access rules

You can specify who can read and write data and under what conditions using Realtime Database Security Rules.

For example, you may wish to restrict access to the database to only authenticated users, or you may want to restrict access to certain users.

You can guarantee that your data is only accessible by authorized users by writing custom Security Rules, and that each user can only access the data that they are authorized to see.

Data validation rules

Firebase Realtime Database provides developers with a way to validate data as it's written to the database using the .validate rule. These rules can be used to ensure that data is of the correct type, meets certain formatting criteria, or passes custom validation functions.

This feature can be incredibly useful for ensuring that your data remains consistent and accurate, regardless of how your app evolves over time.

Defining database indexes

The .indexOn rule can be used to define database indexes in the Firebase Realtime Database.

Indexes aid query performance by allowing the database to quickly locate relevant data without having to scan the entire database. As the database expands in size, queries without indexes can become slow and expensive.

By creating indexes for your queries, you can ensure that your app performs quickly and responsively for your users.

Firebase offers two excellent database solutions that can store and synchronize your app data with the cloud quickly.

While both are NoSQL databases that store and sync data with the cloud in real-time, they have their differences in terms of data modeling, querying capabilities, and pricing models.

The Realtime Database is ideal for real-time updates, whereas Cloud Firestore offers more advanced querying capabilities and a flexible data model.

Before choosing the right database solution, consider your app's specific needs and requirements in terms of querying and filtering.

Additionally, keep in mind that depending on your use cases, you may want to consider a relational database like MySQL or PostgreSQL instead of a NoSQL solution like the Realtime Database or Cloud Firestore altogether.

Overall, Firebase databases are a great choice for building advanced use cases and extending functionality with other Firebase products.

We generally recommend new applications to start with Cloud Firestore.