
Everything you need to know about YAML!
15 October, 2022
4
4
0
Contributors
YAML
Yet Another Markup Language (Previous Full-Form)
YAML Ain't Markup Language (Present Full-Form)
What is YAML?
•
A simple human-readable language that can be used to represent data
•
YAML is not a programming language
•
It is a data format used to exchange data
•
Similar to JSON & XML
•
Used to store some information about some configurations
•
In YAML, you can only store data, not commands.
Data - Serialization
Serialization:
Serialization is the process of converting the data object that is present in a complex data structure into a steam of bytes(or storage) that can be used to transfer this data on your physical device.
or
A process of converting this data object into series of bytes tat saves the state of the object which is easily transmittable.

Deserialization:
The reverse of data serialization is data deserialization.

Object:
Combination of code and data. It is basically a data storage unit.
Some Data - Serialization Languages
1.
YAML
2.
XML
3.
JSON
Why YAML is not considered as a markup language and why it's full form changed?
Markup language are used to store only documents but in YAML, you can store object data along with documents. That's why it is not considered as a Markup Language.
Uses of Data Serialization:
•
Used in configuration files, such as Docker / Kubernetes, etc.
•
Logs, caches, etc.
Benefits of YAML:
•
It is simple and easy to read
•
It has a strict syntax. (Indentation is important)
•
Easily convertible to JSON, XML
•
Most languages use YAML
•
It is more powerful when representing complex data
•
Parsers, etc. various tools available
•
Parsing is easy. (Parsing means reading the data)
Some Important Points:
•
YAML is case senitive. [apple != Apple]
•
In YAML, we use spaces for indentation not Tabs
•
In YAML, there is no multi-line comments. (only single is comment is available)
•
To seperate blocks of code and treat them as documents in a YAML files use( --- )
•
To mark as the end of document use ( ... )
•
Some of the keys of the sequence will be empty and is known as sparse sequence.
YAML Syntax
Datatypes
Advanced Datatypes
json
devops
yaml
computing
cloud
languages