Why We Use Data Serialization Languages?
So, how is this Data Serialization Language, JSON work between REST Client and REST Server? Let’s check this mechanism step by step
As you can see above, here JSON plays an interpreter role. The five steps process is like below:
- REST Server sends the data to REST API with its original structure. Here, we are using Y Programming language. So, this format is Y Programming languages’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 travel 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 applciation with X Format. And X Programming Language can use this data with its structure.
Data Serialization Languages
- XML (eXtensible Markup Language)
- YAML (YAML Ain’t Markup Language)
You can find JSON format examples below:
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 languge for today’s World. It is a little difficult to read XML file but not too much. As in HTML, beginnign 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 with JSON.
You can find XML format examples below:
YAML (YAML Ain’t Markup Language) is a data serialization language that has a very funny recursive name. As its name imlies, it isnot a markup language like XML. Instead, it is a data serialiaztion language. If we compare with XML and JSON, YAML is more easy and user friendly. You can easily reas 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.
You can find YAML format examples below:
JSON, YAML and XML Comparison
You can find a comparison table of JSON, YAML and XML below.