YAML

A human-readable data serialization language used for configuration files and data exchange between programming languages.

YAML (YAML Ain't Markup Language) is a data serialization format designed for human readability and ease of manual editing. Unlike JSON, it minimizes the use of structural characters like braces, brackets, and quotes. YAML is a superset of JSON, meaning any valid JSON file is also a valid YAML file, allowing for broad compatibility across different systems.

How it works

The data structure is defined by indentation (spaces) rather than delimiters. The format consists of three basic primitives:

  • Scalars: strings, integers, floats, and booleans.
  • Sequences: ordered lists prefixed with a hyphen.
  • Mappings: key-value pairs separated by a colon.

YAML supports advanced features like multi-line strings, explicit data typing, and anchors for referencing the same data block multiple times to avoid redundancy. YAML is the industry standard for configuration in DevOps tools such as Kubernetes, Ansible, and Docker Compose. It is also used in CI/CD workflows like GitHub Actions. Its primary advantage is the ability to include comments, which simplifies documentation within the configuration files. A common use case is a k8s.yaml manifest defining resource limits and environment variables for a pod.