WebAPI/DataStore: Difference between revisions

m
Line 73: Line 73:


== Incremental Schema ==
== Incremental Schema ==
DataStore is designed for sharing data among applications.  Applications will assume data types of attributes of objects in a data store.  If the data type of an attributes is not consistent among applications, applications will be broken for read data from other applications with different assumption on the data type.  That is why the data types of attributes should be enforced.
DataStore is designed for sharing data among applications.  Applications will make some assumptions on data types of attributes of objects in a data store.  If the data type of an attributes is not consistent among applications, applications may be broken for reading data from other applications with different assumption on the data type.  So, data types of attributes should be enforced.


Every object in a data store is a tree.  The path from root to any node can be represented as an ordered list of attribute names.  Incremental schema is to define the type of an attribute while the path of the attribute was found first time.  In an other word, once a new object was added to a data store, its tree of attributes will be traveled, and assigned the type of new attributes as the type of their values.  A new attribute is one attribute whose path from root is never found before in a data store.
Every object in a data store is a tree.  The path from root to any node can be represented as an ordered list of attribute names.  Incremental schema is a way that define the type of an attribute while the path of the attribute was found first time.  In an other word, once a new object was added to a data store, its tree of attributes will be traveled, and assigned the type of new attributes with the type of their values.  A new attribute is an attribute whose path from root is never found before in a data store.


For example, if the following object is the object been added to a data store.
For example, if the following object is the object been added to a data store.
Confirmed users
398

edits