Data - Database

Azure Cosmos DB vs GCP Firestore – some no-schema thoughts

I agree here that the comparison is between apples and oranges, but it has at least a near-similar round shape.

Cosmos DB: Account -> Database -> Container -> Item/Document 

  • Documents are grouped logically by a partition key
  • Containers hold documents/items.
  • Application-level hierarchy is usually modeled inside documents or through document relationships, rather than by nesting containers under documents.

Firestore: Database -> Collection -> Document -> Subcollection -> Document -> … 

  • Documents store fields as key-value data.
  • Firestore does not use the same partition-key-based grouping model that Cosmos DB exposes.
  • A document does not contain a collection as a normal field/object. It can have subcollections under it.
  • Collections contain documents only
  • Firestore is naturally hierarchical through subcollections.

Leave a Reply