top of page
hand-businesswoman-touching-hand-artificial-intelligence-meaning-technology-connection-go-

DATA SERIALIZATION AND ITS TYPES

Data serialization is the process of converting data objects present in complex data structures into a byte stream for storage, transfer and distribution purposes on physical devices.




Data Serialization Languages are very important for Network Automation. By using these standards as an interpreter, different applications can communicate with each other. There are different types of Data Serialization Languages. The most popular one is JSON (JavaScript Object Notation) for Network Automation. But beside JSON, there are two more languages used for this purpose.

  1. JSON (JavaScript Object Notation)

JSON (JavaScript Object Notation) is one of the most popular data modeling language used in Network Automation.JSON is a Human-readable language that one can easily understand what it says.Its structure is Map structure and it is a fast data serialization language.

Here the example of JSON on employee record:

{

"EmpRecord": {

"Employee": [

{

"-id": "emp01",

"name": "Alex",

"job": "Developer",

"skills": "python, C/C++, paskal"

},

{

"-id": "emp02",

"name": "Bob",

"job": "Tester",

"skills": "lips, forton, REST APIs"

}

]

}

}


2. XML (eXtensible Markup Language)


XML (eXtensible Markup Language) has originally developed for dynamic web pages. With this language, web pages that has dynamic content can be updated easily. But its properties make it also a good data serialization language for today’s World. It is a little difficult to read XML file but not too much. As in HTML, beginning and ending tags are used in XML. XML (eXtensible Markup Language) was developed at 1996. Its structure is Tree structure and it is slow data serialization language, if we compare it with JSON.

Here is the example for XML on employee record:



<?xml version="1.0"?>

<EmpRecord>

<Employee id="emp01">

<name>Alex</name>

<job>Developer</job>

<skills>python, C/C++, paskal</skills>

</Employee>

<Employee id="emp02">

<name>Bob</name>

<job>Tester</job>

<skills>lips, forton, REST APIs</skills>

</Employee>

</EmpRecord>


3. YAML (Yet Another Markup Language)

YAML (YAML Ain’t Markup Language) is a data serialization language that has a very funny recursive name. As its name implies, it is not a markup language like XML. Instead, it is a data serialization language. If we compare with XML and JSON, YAML is more easy and user friendly. You can easily read a YAML file.

YAML (YAML Ain’t Markup Language) was developed at 2006. Its structure is Map structure and it is a fast data serialization language.

Here the example of YAML on employee record:

#Employee records

  • Employee one:

Name: Alex

Job: developer

Skills:

  • Python

  • c/c++

  • java


  • Employee two:

Name: bob

Job: tester

Skills:

-lisp

-fortran

- Rest api


Applications use different programming languages. They store variables used in these programs differently. Because all the programming languages use different architecture. For example, C++ uses a style, Java uses another and Python uses a different one. All these programs’ store mechanism is different. There is no standard between them. During REST API operation, if one side REST Client uses a different program and the other end REST Server uses the other one, they can not communicate without a third interpreter. Here, Data Serialization Languages are used. By using this language, both end become similar and they can understand each other. With Data Serialization Languages, in other words, applications gain a standard method for their different variable mechanisms. One of the most popular ones used in Network Automation is JSON (JavaScript Object Notation). Here, we will learn JSON, YAML and XML.


Let’s check this mechanism step by step how JSON works between REST Client and REST Server


The five steps process is like below:

  1. REST Server sends the data to REST API with its original structure. Here, we are using the Y Programming language. So, this format is Y Programming language's format.

  2. REST API converts Y format to JSON Format.

  3. The message is sent from REST Server to REST Client in JSON Format. The data travels in JSON format.

  4. At the other end, REST Client receives data in JSON Format. Data in JSON Format is converted to X format via JSON Converter.

  5. Data is sent to the application with X Format. And X Programming Language can use this data with its structure.

355 views0 comments
bottom of page