WebAPI/DataStore: Difference between revisions

m
Line 73: Line 73:


== Incremental Schema ==
== Incremental Schema ==
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.
DataStore is designed for sharing data among applications.  Applications will make some assumptions on data types of attributes.  If the data type of an attributes is not consistent among applications, applications may be broken.  So, data types of attributes should be enforced.
 
to define types of an attributes while attributes with a new path were found first time.  In another word, once a new object was added to a data store, its tree of attributes will be traveled, and define the type of new found attributes with the type of their values.
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.
Line 88: Line 87:
   }
   }


Then, the table of types of attributes should be
Then, the types table of the data store is
   SN: Integer
   SN: Integer
   name: String
   name: String
Line 106: Line 105:
   }
   }


The table of types of attributes should be
The types table should be
   SN: Integer
   SN: Integer
   name: String
   name: String
Line 114: Line 113:
   info phone: String
   info phone: String


Every time a new object was added to a data store, the types of attributes of the object would be checked against the types table of the data store.  The action of adding will be failed if the type of any attribute does not match the type defined in the types table.
Every time a new object was added to a data store, the types of attributes would be checked against the types table of the data store.  The action of adding will be failed if the type of any attribute does not match the type defined in the types table.


== Issues ==
== Issues ==
Confirmed users
398

edits