Firebase Data Connect
Firebase's first relational database solution for developers who want to create secure and scalable apps with Cloud SQL for PostgreSQL and type-safe mobile and web SDKs. Learn more.
Firebase Data Connect is a relational database service for mobile and web apps that lets you build and scale using a fully-managed PostgreSQL database powered by Cloud SQL. It provides secure schema, query and mutation management using GraphQL technology that integrates well with Firebase Authentication. You can quickly integrate this product into your mobile and web apps with SDK support in Kotlin Android, iOS, Flutter, and web.
Data Connect lets you declare your application's data model and the exact queries needed by your application. Using your data model we automatically create a PostgreSQL database schema to fit your data model, secure server endpoints that talk to the database, and type-safe SDKs for your client application that talk to the server endpoints. It's like a "self-driving app server" made-to-order for your specific application.
Pricing
Firebase Data Connect consists of two billable components, the Data Connect service itself, and the Cloud SQL for PostgreSQL instance that contains your project data. If you integrate with Vertex AI, you are billed for vector embeddings.
Data Connect pricing
No cost for Data Connect network egress until the product enters General Availability (GA).
After GA, network egress has no cost up to 10 Gib/month; more than 10 Gib/month, egress is charged at Google Cloud Internet Data Transfer Rate Premium Tier pricing.
No cost for operations (queries or mutations) executed from clients until the product enters General Availability.
After GA, no cost up to 250,000 operations per month; more than 250,000, operations are charged at $4.00 per million. Note that the price is per operation and is not related to the amount of data read from the database; there is no "per row read" fee. Each Data Connect operation can perform complex, multi-table queries or multi-row updates.
Cloud SQL no cost trial
If you accept the default configuration when you provision a Cloud SQL for PostgreSQL instance, you will be qualified for no cost trial for the duration of Public Preview.
- 5 free trials are available per billing account.
- 1 free trial Cloud SQL for PostgreSQL instance per project, although you can have multiple non-free instances within that project.
- The default configuration of your Cloud SQL for PostgreSQL instance is equivalent to a db-f1-micro instance that has 1 vCPU, 10 GB of storage, 628.74 MB of memory.
During the no cost trial, you can add computing resources to your Cloud SQL instance, set up a private IP for your instance, and create a read replica for your instance, at which point you will be billed according to Cloud SQL pricing.
After General Availability, new customers can sign up for a 3 month no cost trial for the default Cloud SQL instance created using Firebase Data Connect. Existing customers participating in the Public Preview trials will automatically roll into the 3 month no cost trials when General Availability starts. After 3 months, pricing starts as low as $9.37 / month (pricing varies based on regions and configurations; see Cloud SQL pricing.
Vertex AI embedding generation
Using Data Connect with Vertex AI will incur standard usage charges from Vertex AI for embedding generation.
Key capabilities
Backed by Cloud SQL for PostgreSQL | Rely on a fully-managed database service that helps you set up, maintain, manage, and administer your PostgreSQL relational databases on Google Cloud. |
Vector search | Data Connect supports vector search for developers to build AI-powered applications. |
Multiple platform SDKs | Firebase Data Connect offers multi-platform SDKs, for Kotlin Android, iOS, Flutter, and web. |
User-based authentication | Data Connect supports end-user authentication, ensuring that only authorized users can access the data. |
Visual Studio Code extension | Offers easy schema development, and query and mutation management, directly from your Visual Studio Code editor using GraphQL. |
Emulator | Firebase Data Connect includes an emulator that lets you test your app with a local database without having to deploy to production. |
AI assistance from Gemini in Firebase | Use Gemini in Firebase to generate queries and mutations on-demand using natural language and test them directly in the Firebase console. Learn more at Use AI assistance for Data Connect in the Firebase console for queries and mutations. |
How does it work?
The top-level resource for Firebase Data Connect is a service, which represents a managed GraphQL API that can be defined by developers and called by end users. Your schema is the app data model for a service, represented primarily as a collection of GraphQL source files, as well as specific configuration for attached datasources (such as Cloud SQL instances). There can be only one schema per service. Finally, your connectors are collections of queries and mutations that have been defined to operate against a service's schema. There can be many connectors per service (for instance if you have a "rider" app and a "driver" app for your rideshare company).
Your Data Connect schema maps explicitly to a specific underlying PostgreSQL database schema. Data Connect includes tooling to automatically generate the SQL DDL needed to perform schema migrations based on changes to the app schema. Based on your app schema, Data Connect automatically generates additional GraphQL schema to query and manipulate the data model.
Once your app schema is defined, you can write predefined queries and mutations that are executed to read and write data in the application. Data Connect queries and mutations are not submitted by client code and executed on the server. Instead, when deployed, these Data Connect operations are stored on the server, like Cloud Functions. This simplifies code management, and development of your client code. In privileged environments, like the Firebase console and using our Data Connect VS Code extension, you can execute ad hoc operations with appropriate Google IAM credentials for administrative operations.
For client code, each supported platform has a core SDK that handles connecting to the backend, issuing requests, and processing responses. These SDKs are not schema-aware and must be supplied with operation names and variables as unstructured data. Each supported platform also has a generated SDK. As you define your data model and operations, tooling on your machine will automatically generate strongly-typed SDKs specific to the application. These SDKs will "wrap" the core SDKs for type safety, ergonomics, and other features such as data validation and more down the road.
Implementation path
Prototype your schema | Prototype your database schema, including designs using vector types, starting in a local environment with tooling | |
Prototype your operations | Build predefined query and mutation operations for client apps based on automatically-generated queries and mutations | |
Generate type-safe SDKs | Generate and test type-safe SDKs from your schema and operations, then implement client-side code | |
Deploy schema and operations | Deploy the schema and operations for your Firebase Data Connect service | |
Deploy clients | Deploy your client code |
Next steps
- If you'd like to see the Firebase Data Connect development flow in action, read through the Get started guide.