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.
Here the example of JSON on employee record:
"skills": "python, C/C++, paskal"
"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:
<skills>python, C/C++, paskal</skills>
<skills>lips, forton, REST APIs</skills>
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:
- Rest api
Let’s check this mechanism step by step how JSON works between REST Client and REST Server
The five steps process is like below:
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.
REST API converts Y format to JSON Format.
The message is sent from REST Server to REST Client in JSON Format. The data travels in JSON format.
At the other end, REST Client receives data in JSON Format. Data in JSON Format is converted to X format via JSON Converter.
Data is sent to the application with X Format. And X Programming Language can use this data with its structure.