Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is serialization called serialization? [closed]

It just occurred to me that serialization seems a strange name for the process of writing a data structure out to disk. Wikipedia and Google are not much help for the origin of the name. Why is serialization called serialization? Is it related to writing data out to tapes?

EDIT: To be clear, I'm interested in the origins of the word 'Serialization' not the fact that data needs to be 'serial' in order to be transmitted.

like image 281
Eric Avatar asked Feb 17 '15 00:02

Eric


3 Answers

Is it related to writing data out to tapes?

That's pretty close to the truth. Data stored on a tape is obviously stored in a serial way, i.e. it's basically a series of bits from one end of the tape to the other. However, it's not only data on tapes that is serial in this way. Even if not as obvious, data saved or transmitted in any way is serial in much the same way. A file on the disk or a stream sent over the network is a series of bytes with a start and an end.

As a contrast, when an object resides in memory it can be scattered across several parts of memory. A list of string for example is not a single block of memory where one string follows after another, but a block of pointers where each one points to a different section of memory where one of the strings is stored.

When you want to store or transmit an object, you can't just take that scattered data and send it as it is. You have to take the different parts of data and arrange it as a single series of bytes. There is where the serialization comes in.

like image 193
Guffa Avatar answered Sep 27 '22 18:09

Guffa


You need to understand a couple of concepts from way back.

  1. Serial access: the data is written on a medium that can only be read from beginning to end, e.g., primarily, a tape, but text files with line separators are another example, as indeed is a TCP socket.

  2. Sequential access: the data is written on a medium that may support random or indexed access as well, but what we are doing at the moment is sequential only, i.e. from beginning to end. Many operating systems used to support 'relative' and 'indexed' files, which can both be accessed sequentially, but which can also be accessed by position or by key value respectively.

When you consider the nature of a serialized object stream, 'serial' is clearly the term that applies here. You can't access it by position or key, only serially.

like image 24
user207421 Avatar answered Sep 27 '22 19:09

user207421


Stolen from another question:

"... in order to transmit any information you need to put all parts of that information into a series of bytes.

In order to transmit a record full of information you would have to "serialize" all the bytes that comprise the record, send them over the wire and at the other end would have to deserialize them back into a record.

With the advent of client / server applications, the concept was generalized to serializing objects into some kind of (textual) form that could be transmitted across a network and deserialized back into objects at the other end.

Client / server communication started with several proprietary protocols that handled the deconstruction and reconstruction of object before and after transmission between client and server. With SOAP for client server communication xml became a defacto protocol standard for the textual representation of objects. Javascript and the abundance of web clients using it brought the need for a more concise representation and led to Json."

like image 21
Kyle Gonyea Avatar answered Sep 27 '22 20:09

Kyle Gonyea