From the course: Cisco DevNet Associate (200-901) Cert Prep 1: Software Development and Design

Introduction to data formats

From the course: Cisco DevNet Associate (200-901) Cert Prep 1: Software Development and Design

Start my 1-month free trial

Introduction to data formats

- [Instructor] Common data formats. When we need to communicate with each other, we need to be speaking the same language. The language structure help us package the message in an understandable format. The nouns, verbs, adjectives all help us in correctly deliver the message that could be understood by the other party. The same approach could be extended to communication between machines, they rely on a certain structure to deliver the messages, both in terms of delivery, as well as the message format. As you could imagine, without the benefit of non-verbal human communication, such as gesture or voice tones, machine communication rely on even more rigid sets of rules to ensure effective communication. We will learn about delivery methods such as REST API in another lesson. In this section, let us focus on the ways machine can package the message or data format in order to deliver from one side to another. Of course, there are lots of different ways we could structure our data. If we think back to the human language comparison, do all languages have the same structure and format? Well maybe some of them do, but many of them are very different. In data formats, there are also many different types. Each could have its own advantages and disadvantages. Imagine this, you just built your next generation data center consist of a brand new topology. How would you represent this data center structure in a format that is easy to understand and transmit? Can you describe the topology in a text file? What about a comma separated format, like a spreadsheet? A good data format could consist of the following characteristics. It should be able to easily accommodate common scenarios, making common things easy and hard things possible. The data format should be easily extensible, we shouldn't have to reconstruct the whole file in order to allow newer scenarios. The data format should be made into a standard. This would promote interoperability and allow commonly used programming languages to easily convert this data into a format that could be natively understand and manipulate. Lastly, this data format should ideally be humanly readable, after all, machines read the file, but we human write the code for the machine, so ideally a human readable format would allow us to better troubleshoot when needed. The three common data formats that we will discuss are XML, JSON, and YAML, all of which are meant to store and exchange data. XML stands for extensible markup language, it is a markup language similar to HTML, that makes up the internet webpages. JSON is short for JavaScript object notation. It is written in a notation that could be easily map into common programming languages, such as Python. YAML stands for YAML ain't a markup language, and commonly used for configuration files and addresses what some people would consider the shortfalls of other markup languages. All three formats store data in text, allowing the computer to convert the text into an easily transported binary form over the internet, and be reconstructed on the other end. Let us take a look at each of the data formats in more details.

Contents