Conceptly
← All Concepts
🔥

Google Cloud Firestore

DatabaseServerless NoSQL Document Database

Google Cloud Firestore is a document-based NoSQL database with built-in real-time sync and offline support. Store data as JSON without a fixed schema, with automatic global scaling.

Architecture Diagram

🔍 Structure

Dashed line animations indicate the flow direction of data or requests

Why do you need it?

Storing data in a mobile/web app and syncing it across users in real time requires building a REST API server, implementing WebSockets, and handling offline logic yourself. Building all of this separately causes complexity to skyrocket.

Why did this approach emerge?

Traditionally, mobile apps had to go through a REST API server to access data. Real-time features required a separate WebSocket server, and offline support was up to the developer. The real-time database model that started with Firebase evolved into Cloud Firestore, absorbing that complexity into the database itself.

How does it work inside?

Firestore stores documents inside collections in a hierarchical structure. When you read and write documents with the client SDK, real-time listeners detect changes and propagate them instantly to all connected clients. Security Rules control read/write permissions at the document level.

What is it often confused with?

Firestore and Cloud SQL both store data but use different models. Cloud SQL's relational structure (tables/rows/columns) excels at complex JOINs and transactions, while Firestore's document/collection model excels at real-time sync and flexible schemas. Choose Firestore when schemas change frequently and real-time sync is essential; choose Cloud SQL when you need normalized data and complex queries.

When should you use it?

Ideal for real-time data sync in mobile/web apps, chat, collaboration tools, and user profile management. Not the right choice for large-scale analytical queries or workloads heavy on relational JOINs.

Mobile/web app backendReal-time collaborationUser profiles and settingsIoT state management