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:
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" |