Comparison with traditional databases

In a traditional RDBMS, you have atomic transactions, which is true for Datastore as well. Datastore does support atomic transactions and the ACID properties, mostly due to the need to keep all of the internal indices consistent. Both traditional RDBMS and Datastore make heavy use of indices for fast lookup. But in Datastore, every query makes use of indices, which is far beyond what traditional RDBMS do. Consequently, the query execution time in Datastore is basically independent of the size of the underlying dataset, which is certainly not the case with traditional RDBMSs.

Traditional RDBMS use relational data, that is, rows and columns, but without many hierarchical relationships within those entity relations. Datastore on the other hand is document-oriented, which implies it is optimized for hierarchically structured data such as XML or HTML. It has the form of a tree in its internal representation, like the document object model (DOM) in an HTML document.

There is also a slight change in terminology in terms of what rows, columns, and attributes are called. In a relational database, rows are stored in tables. In a document database, entities are of different kinds. The word entity corresponds to a row and kind corresponds to table. Note the absence of the word stored. Because entities are of different kinds, entities are not really stored in kinds. For example, consider HTML tags: a HEAD tag or a BODY tag would be an entity in a document data store. Rows consist of fields in a traditional RDBMS while entities consist of properties in a datastore. If you have a HEAD tag with some nested tags, those are the properties.

Traditional databases have primary keys as a unique ID. In Datastore, the word primary is not used, but you refer to them as keys.

In a traditional RDBMS, all rows of the same table need to have the same schema or the same properties. In other words, they will have the same number of columns and those columns will be all of the same type. In contrast, it's perfectly acceptable for different entities of the same kind to have different properties. For instance, you may have two HTML documents, with a head tag each. Inside one of the head tags is a body while the other does not have any body tags at all. This is accepted in a document-oriented store.

This applies to types as well. In a relational database, all of the values in a particular column must have the same type. On the contrary, Datastore types of different properties with the same name can be different. Say you have two XML documents with a body tag each and inside one of them, and the body tag has another property called ID, which is an integer. The other body tag also has a property called ID but it happens to be a string, which is absolutely acceptable in a document-oriented store.

Datastore also differs from traditional databases in which operations it will and will not support. For instance, unlike traditional relational databases, a data store does not support joins, filtering on subqueries, or more than one inequality filter in a query. This table summarizes the comparison between traditional DBMS and the Cloud Datastore concisely:

Traditional RDBMS

DataStore

Atomic transactions

Atomic transactions

Indices for fast lookup

Indices for fast lookup on every column

Some queries use indices

All queries use indices

Query time depend on both size of dataset and size of result set

Query time independent of dataset, depends on result set alone

Structured relational data

Structured hierarchical data (XML, HTML)

Rows stored in tables

Entities of different kinds

Rows consist of fields

Entities consist of properties

Primary keys for unique ID

Keys for unique ID

Rows of table have same properties (schema is strongly enforced)

Entities of a kind can have different properties

Types of all values in a column are the same

Types of different properties with same name in an entity can be different

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset