Chapter 5. Cloud Datastore: document storage

 

This chapter covers

  • What’s document storage?
  • What’s Cloud Datastore?
  • Interacting with Cloud Datastore
  • Deciding whether Cloud Datastore is a good fit
  • Key distinctions between hosted and managed services

Document storage is a form of nonrelational storage that happens to be different conceptually from the relational databases discussed in chapter 4. With this type of storage, rather than thinking of tables containing rows and keeping all of your data in a rectangular grid, a document database thinks in terms of collections and documents. These documents are arbitrary sets of key-value pairs, and the only thing they must have in common is the document type, which matches up with the collection. For example, in a document database, you might have an Employees collection, which might contain two documents:

{"id": 1, "name": "James Bond"}
{"id": 2, "name": "Ian Fleming", "favoriteColor": "blue"}

Comparing this to a traditional table of similar data (table 5.1), you’ll see that the grid format will look quite different from a document collection’s jagged format (table 5.2).

Table 5.1. Grid of employee records

ID

Name

Favorite color

1 "James Bond" Null
2 "Ian Fleming" "blue"
Table 5.2. Jagged collection of employees

Key

Data

1 {id: 1, name: "James Bond"}
2 {id: 2, name: "Ian Fleming", favoriteColor: "blue"}

5.1. What’s Cloud Datastore?

5.2. Interacting with Cloud Datastore

5.3. Backup and restore

5.4. Understanding pricing

5.5. When should I use Cloud Datastore?

Summary

sitemap