DevNetOps: Data Serialisation and Deserialisation.
Introduction
In the network engineer community, specifically network automation, I personally feel this topic isn’t tackled appropriately. This topic should be viewed from a computer science or developer angle.
We are quickly dismissing YAML/XML/JSON as just” structured data” or “data formats” it’s a lot more than that.

So what is data serialisation?
Data Serialisation is the process of converting a data object into a series of bytes that freezes the state of a native object and in turn converts this into rapidly transmittable stream of bytes. In this serialised form it can be easily delivered to any other application, datastore(e.g YANG). In simple terms this process converts data into a cross platform compatible object.
Most associates confuse data serialisation as a process exclusive to network automation or DevNet. My fundamental point here is that data serlisation is independent from network automation and DevNet.
Please see the perfect examples from w3school:
Data serialisation example, converting native object(Dictionary) in python to serialised JSON format.

From the example we can see that json library in python, uses the .dumps method to converts the dictionary (a native python object) into a serialised state.
The reverse occurs once data is transmitted. it’s known as data deserialisation and in this stage the stream of bytes is converted to a data object that is native to the destination data store or programming language(e.g python). In DevNet a perfect example of this process is when a serialised(XML or JSON) instance of a YANG container is converted into a native python dictionary object.
On the 2nd example from w3school, JSON deserialisation occurs. The serialised stream of data is deserialised into python native data object(dictionary)
Again From the example we can see that the JSON library in python, uses the .loads method to convert the data into a python object.

conclusion
XML/JSON/YAML are Serialisation data format languages. They are completely independent from network automation and should not be explicitly associated to Network automaton. They contain serialised data. Serialisation is the process of converting object(data) into binary bytes. This allows the data to be transmitted and interpreted by compiled program or another data store.





Leave a comment