File Formats and Serialization
File formats define how information is arranged in files or messages. Serialization turns in-memory data into that arranged representation so another program, machine, or later process can reconstruct and interpret it.
itComputer fundamentals | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Intro
File Formats and Serialization
A file format is a set of rules for representing information as bytes. Serialization is the act of converting an in-memory value into such a representation. Deserialization reverses that conversion. The representation may live in a file, cross a network, enter a message queue, or remain in a database column.
These terms overlap, but they are not identical. A format describes the representation. A serializer and deserializer implement the conversion. A protocol adds rules about exchanging representations. A schema describes the expected structure and types. An application still supplies the meaning: a field named temperature needs an agreed unit even when its syntax and type are valid.
The representation pipeline
Structured data passes through several layers:
application values
↓ map to a data model
logical records, arrays, maps, scalars
↓ serialize with format rules
bytes or text
↓ store or transmit with metadata
file, message, database value, or HTTP representation
↓ identify, parse, and validate
reconstructed values
↓ apply application meaning
usable information
Every boundary can lose information. A language may distinguish integer sizes that the format does not. A map may allow key types that JSON objects cannot express. A timestamp may become a string without its time zone rule. A decimal may become a binary floating-point number. Round-trip testing checks whether encoding and decoding preserve the distinctions the application needs.
Syntax, structure, and meaning
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.rfc-editor.org/rfc/rfc8259.html
Supports
- JSON syntax, data model, parser and generator behavior, duplicate-name interoperability concerns, and UTF-8 requirement for open-system exchange
- JSON publication as an Internet Standard in December 2017
- https://www.w3.org/TR/xml/
Supports
- XML elements, attributes, character data, well-formedness, encoding declarations, and encoding detection
- https://www.w3.org/news/1998/the-world-wide-web-consortium-issues-xml-1-0-as-a-w3c-recommendation/
Supports
- XML 1.0 Recommendation publication on 10 February 1998
- https://yaml.org/spec/1.2.2/
Supports
- YAML representation, serialization, presentation, parsing, composition, and construction stages
- YAML scalars, sequences, mappings, tags, schemas, and revision 1.2.2 publication on 1 October 2021
- https://yaml.org/spec/1.0/
Supports
- YAML 1.0 final draft date and its cross-language Unicode serialization purpose
- https://yaml.org/spec/1.2/spec.html
Supports
- YAML 1.2 publication in October 2009, JSON subset goal, and revised schemas
- https://www.rfc-editor.org/rfc/rfc4180.html
Supports
- CSV records, fields, quoting conventions, optional header, and media type
- https://www.rfc-editor.org/rfc/rfc6838.html
Supports
- Media types as identifiers for representation formats and registration rules
- https://protobuf.dev/overview/
Supports
- Protocol Buffers as a schema-driven, language-neutral serialization mechanism
- Definition language, generated code, runtime libraries, wire format, stored data, and 2008 open-source release
- https://protobuf.dev/programming-guides/encoding/
Supports
- Numbered fields, wire types, key encoding, and message structure
- https://protobuf.dev/programming-guides/proto3/#updating
Supports
- Safe update guidance, compatibility behavior, and field-number preservation
- https://protobuf.dev/programming-guides/proto3/#deleting-fields
Supports
- Reserving deleted field numbers and names to prevent reuse
- https://avro.apache.org/docs/current/specification/
Supports
- Avro schemas, binary encoding, object container files, writer and reader schemas, and schema resolution
- https://github.com/msgpack/msgpack/blob/master/spec.md
Supports
- MessagePack value types, binary representations, maps, arrays, and extension types
- https://www.rfc-editor.org/rfc/rfc8949.html
Supports
- CBOR data model, major types, tags, deterministic encoding, decoding expectations, and security considerations
- RFC 7049 history and RFC 8949 publication in December 2020
- https://www.rfc-editor.org/rfc/rfc8742.html
Supports
- Framing a sequence of CBOR data items and handling incomplete items
- https://www.rfc-editor.org/rfc/rfc8785.html
Supports
- Canonical JSON representation for hashing and signing
- https://json-schema.org/draft/2020-12/json-schema-validation
Supports
- JSON Schema validation assertions for instance structure and values
- https://flatbuffers.dev/schema/
Supports
- FlatBuffers schemas, file identifiers, field access, and non-self-describing buffers
- https://flatbuffers.dev/evolution/
Supports
- FlatBuffers compatibility rules for field addition, deprecation, IDs, types, and defaults
- https://thrift.apache.org/docs/concepts
Supports
- Separation among Thrift protocols, transports, generated processors, and serialization
- https://cheatsheetseries.owasp.org/cheatsheets/Deserialization_Cheat_Sheet.html
Supports
- Risks from deserializing untrusted data and constrained deserialization guidance
- https://www.rfc-editor.org/info/rfc4627
Supports
- RFC 4627 publication in July 2006 and JSON media type registration
- https://ecma-international.org/publications-and-standards/standards/ecma-404/
Supports
- ECMA-404 first edition in October 2013 and its syntax-only scope
- https://www.rfc-editor.org/info/rfc7049
Supports
- RFC 7049 publication in October 2013 and original CBOR specification
- https://github.com/sindresorhus/awesome
Supports
- Discovery of the curated Awesome JSON list from the canonical Awesome index
- https://github.com/burningtree/awesome-json
Supports
- Discovery of jq, fx, dasel, JSON Crack, Ajv, JMESPath, MessagePack, and CBOR ecosystem resources
- https://jqlang.org/manual/
Supports
- jq filters, JSON types, paths, transformations, and streaming behavior
- https://fx.wtf/
Supports
- fx terminal-based interactive JSON viewing and processing
- https://daseldocs.tomwright.me/
Supports
- dasel querying and modification across JSON, YAML, TOML, XML, and CSV
- https://jsoncrack.com/
Supports
- JSON Crack visualization for JSON, YAML, XML, CSV, and related formats
- https://ajv.js.org/
Supports
- Ajv JSON Schema validation, draft support, compilation, formats, and error reporting
- https://jmespath.org/
Supports
- JMESPath query language specification, multi-language libraries, and compliance tests
- https://docs.confluent.io/cloud/current/sr/index.html
Supports
- Registry storage, versioning, compatibility, schema identifiers, and Avro, JSON Schema, and Protocol Buffers support
- https://www.apicur.io/registry/docs/apicurio-registry/3.3.x/index.html
Supports
- Apicurio storage and retrieval of event schemas and API designs with evolution controls
- https://www.oxygenxml.com/xml_editor.html
Supports
- Oxygen XML Editor support for structured-document authoring, schemas, and validation
- https://www.altova.com/xmlspy-xml-editor
Supports
- XMLSpy XML, JSON, YAML, schema, validation, transformation, and Apache Avro tooling
