Course contentsShow
← Cloud and Infrastructure
Lesson 440 of 2,9898. Managed DatabasesFree lesson

Google Cloud Firestore and Datastore

Comparing Firestore's document model with native and Datastore modes for different application patterns.

Google Cloud Firestore and Datastore

You'll learn how Google's document-based NoSQL offerings differ in their modes and when to use each for your applications.

What Are Firestore and Datastore?

Both Firestore and Datastore are fully managed, serverless NoSQL databases from Google Cloud. Think of them as cousins in the same family—they share a heritage, but evolved for different needs.

Datastore is the older service, designed for server-side applications with a focus on scalability and strong consistency. Firestore is the newer generation that comes in two modes:

Firestore Native Mode

This is the modern, real-time document database. It organizes data as documents in collections (like folders containing JSON-like files). Native mode excels at:

  • Mobile and web apps needing real-time synchronization
  • Offline data access with automatic sync
  • Rich querying with compound indexes
  • Client-side SDKs for direct database access

Analogy: Imagine a filing cabinet where each folder (collection) contains individual file cards (documents) that instantly update across all offices worldwide.

Firestore in Datastore Mode

This maintains backward compatibility with the original Datastore API. It's better suited for:

  • Server-side applications without real-time requirements
  • Large-scale batch processing workloads
  • Applications already using Datastore that need a migration path
  • Scenarios where you don't need client libraries

Analogy: A warehouse database optimized for backend systems to store and retrieve inventory—reliable and scalable, but workers don't get instant notifications.

Choosing Your Mode

Use Native mode for modern apps needing real-time features. Use Datastore mode for traditional server architectures or when migrating legacy Datastore applications. You choose the mode when creating your database—it cannot be changed later.

Key Takeaway: Firestore Native mode powers real-time, client-facing applications, while Datastore mode serves server-side, batch-oriented workloads with Datastore API compatibility.