What is YAML? Explained With Examples

What is YAML? Explained With Examples

The recursive YAML acroynym stands for “YAML Ain't Markup Language,” denoting it as flexible and data-oriented. ... Its flexibility is partially due to the fact that YAML is made up of bits and pieces of other languages. A few examples of these similarities include: Scalars, lists, and associative arrays are based on Perl.

Most formatting languages display data in a non-human readable format. Even JSON, the most popular data format in use, has poor code readability.

YAML is an alternative to JSON that formats data in a natural, easy-to-read, and concise manner.

This article will introduce you to the YAML markup language. We cover the basic concepts behind this markup language, explain its key features, and show what YAML offers to DevOps teams.

What is YAML?

YAML is a data serialization language. Back when it came out in 2001, YAML stood for “Yet Another Markup Language.” The acronym was later changed to “_YAML Ain’t Markup Language_” to emphasize that the language is intended for data and not documents.

It is not a programming language in the true sense of the word. YAML files store information, so they do not include actions and decisions.

Unlike XML or JSON, YAML presents data in a way that makes it easy for a human to read. The simple syntax does not impact the language’s capabilities. Any data or structure added to an XML or JSON file can also be stored in YAML.

Besides human-readable code, YAML also features:

  • Cross-language data portability
  • A consistent data model
  • One-pass processing
  • Ease of implementation and use

Users can write code for reading and generating YAML in any programming language. The extensions in YAML are .yaml and .yml. Both extensions stand for the same file type.

Why use YAML?

Yaml Features

YAML has several features that make it an excellent option for data formatting.

Multi-Document Support

Users can add multiple documents to a single YAML file. Separate different documents with three dashes (---), like this:

---

time: 19:04:12

player: playerOne

action: strike (miss)

---

time: 20:03:47

player: playerTwo

action: strike (hit)

...

devops

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Extend your DevOps Strategy For Success in the Cloud?

DevOps and Cloud computing are joined at the hip, now that fact is well appreciated by the organizations that engaged in SaaS cloud and developed applications in the Cloud. During the COVID crisis period, most of the organizations have started using cloud computing services and implementing a cloud-first strategy to establish their remote operations. Similarly, the extended DevOps strategy will make the development process more agile with automated test cases.

What Is DevOps and Is Enterprise DevOps Any Good?

What is DevOps? How are organizations transitioning to DevOps? Is it possible for organizations to shift to enterprise DevOps? Read more to find out!

DevOps Basics: What You Should Know

What is DevOps? What are the goals it helps achieves? What are its benefits? This article has answers!

Why You Should Be Adopting a DevOps Culture in 2020 - DZone DevOps

The year 2020 has arrived, and its arrival brings a lot of innovations and transformations in the Information and Technology (IT) sector to DevOps technologies.

Measuring DevOps Metrics: A How-To Guide

DevOps is supposed to help streamline the process of taking code changes and getting them to production for users to enjoy. But what exactly does it mean for the process to be "streamlined"? One way to answer this is to start measuring metrics.