Ion (serialization format)


Ion is a data serialization language developed by Amazon. It may be represented by either a human-readable text form or a compact binary form. The text form is a superset of JSON; thus, any valid JSON document is also a valid Ion document.

Data types

As a superset of JSON, Ion includes the following data types
  • : An empty value
  • : Boolean values
  • : Unicode text literals
  • : Ordered heterogeneous collection of Ion values
  • : Unordered collection of key/value pairs
The nebulous JSON 'number' type is strictly defined in Ion to be one of
Ion adds these types:
  • : Date/time/time zone moments of arbitrary precision
  • : Unicode symbolic atoms, stored as interned strings in binary format
  • : Binary data of user-defined encoding
  • : Text data of user-defined encoding
  • : Nested list of values with application-defined semantics
Each Ion type supports a null variant, indicating a lack of value while maintaining a strict type.
The Ion format permits attaching one or more annotations to any value. Such annotations may be used as metadata for otherwise opaque data.

Implementations

Examples

Sample document

Features seen in JavaScript and JSON5:

// Comments are allowed using the double forward slash

Features unique to Ion:


Uses

  • Amazon's Quantum Ledger Database stores data in Ion documents.
  • , an open source SQL-based query language also by Amazon, is built upon Ion. PartiQL supported queries are used by QLDB, S3Select.

Tooling and extensions

  • aims to combine the convenience of a DOM API with the speed of a streaming API.
  • IDE support
  • *
  • *
  • for Ion
  • *
  • *
  • defines an algorithm for constructing a hash for any Ion value, given a user-provided hash function capable of taking binary data of arbitrary length.
  • *
  • *