Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once models are defined and deployed their schematic layout is persisted in Storage (TQL Cache) defined at the time of the deployment. Note that even though models are persisted in SQL type of storage that data is highly unstructured and stored in proprietary format.Before Models can be queried using Find - Models must be initialized the meta structure of the definition is stored in memory. 

Before Find queries can find anything from the models, they must be instantiated, or populated with data. The result of model creation instantiation is called Model Instances. Multiple model instances can be created from the same model (definition). Model instance data is persisted in the storage (TQLCache), as defined at the time of the deployment.

Note

Even though TQLEngine uses SQL type of database technology to persist model instances, they are stored in a schema-less way, not in a relational format. This preserves the the performance at scale.

For example: Here is the definition of a ThingModel - PhidgetSensorModel that combines PhidgetSensorFacet. 

Definition

Code Block
languagexml
titlePhidgetSensor Thing Model
linenumberstrue
<ThingFacet Name="PhidgetSensorFacet">
  <Integer Name="SensorValue" Update="auto" KnownBy="PhidgetSensorAction"/>
  <String Name="SensorURL" Default="phid://"/>
  <String Name="SensorInterfaceIndex"/>
  <String Name="SensorType"/>
  <String Name="SensorInterfaceType"/>
  <String Name="SensorValueFormat"/>
  <String Name="Simulated"/>
</ThingFacet>
<ThingModel Name="PhidgetSensorModel" Combines="PhidgetSensorFacet">
  <Sid Name="phidId"/>
</ThingModel>

...