Tech and Media Labs
This site uses cookies to improve the user experience.




ION Data Modeling

Jakob Jenkov
Last update: 2017-02-28

This text is just a simple illustration of how you can use the various ION field types to model commonly used data structures. The encoding of the fields is not covered here, but in the ION Encoding Specification.

Raw Bytes

ION can contain long sequences of raw bytes, for instance a file, video frame etc. Raw bytes fields can be intertwined with all other ION fields.


Sequences of Fields

You can send sequences of independent ION fields over the network. Actually, each IAP message is an ION Object field. You can also write a sequence of ION fields to a file. For instance, you could write independent ION fields as log records in a log file. There is no requirement to have a single root element as XML has.


Arrays of Fields

ION contains an special Array field which can contain a sequence of ION fields which are to be interpreted as a coherent array / list of ION fields. For instance representing an array of users, documents, names, addresses or something else. ION arrays are similar to arrays in programming languages.



Objects

ION has a special Object field which is used to represent composite objects, like JSON objects, IAP messages etc.




ION Object fields can also be used to mimic XML data.



Tables

ION has a special data structure that can model tabular data. An ION Table contains a single "row" of column names (property names - ION Key fields), and multiple rows of column values corresponding to the column names.



ION Tables can contain other nested ION Tables inside them. Thus, ION Table fields can be used to model complex object graphs and save some of the redundant property names of arrays of "child" objects.


Jakob Jenkov




Copyright  Jenkov Aps
Close TOC