Questions tagged [data-serialization]

the process of translating data structures or object state into a format that can be universally stored (for example, in a file or memory buffer, or transmitted across a network connection link) and reconstructed later in the same or another computer environment [Wikipedia--Serialization]

Data Serialization solves the problem of porting data across disparate computer environments using a common format understood at both ends of the serialization/deserialization process. Data may be serialized into different "Data Serialization Formats" that have advantages and disadvantages under different scenarios and may be broadly categorized as either a text-based (i.e. human readable) encoding or byte-stream-based (i.e. binary) encoding.

Some popular formats include

  • XML
  • JSON
  • Google Protocol Buffers
29 questions
236
votes
1 answer

google protocol buffers vs json vs XML

I would like to know the merits & de-merits of Google Protocol Buffers JSON XML I want to implement one common framework for two application, one in Perl and second in Java. So, would like to create common service which can be used by both…
Manoj Kathiriya
  • 3,366
  • 5
  • 19
  • 19
44
votes
5 answers

Java Serialization vs JSON vs XML

I am wondering what serialized mechanism should we choose when dealing with object transferring over the network. What are the pros and cons ? I know most of the time we use JSON or XML for AJAX since the transfer format are pretty much Javascript…
peter
  • 8,333
  • 17
  • 71
  • 94
36
votes
4 answers

MIME type for msgpack?

msgpack seems to be an extremely fast, if extremely new format for data serialisation. Does it have a recognised MIME type yet? If not, what should be used in the interim?
Tim McNamara
  • 18,019
  • 4
  • 52
  • 83
18
votes
2 answers

what is a data serialization system?

according to Apache AVRO project, "Avro is a serialization system". By saying data serialization system, does it mean that avro is a product or api? also, I am not quit sure about what a data serialization system is? for now, my understanding is…
Yang
  • 9,794
  • 15
  • 44
  • 52
9
votes
1 answer

Data validation in AVRO

I am new to AVRO and please excuse me if it is a simple question. I have a use case where I am using AVRO schema for record calls. Let's say I have avro schema { "name": "abc", "namepsace": "xyz", "type": "record", "fields": [ …
user2166328
  • 199
  • 2
  • 2
  • 6
6
votes
1 answer

DataContractSerializer fails, null data

I've got some code for Windows Phone 7, for a RSS app: private RSSSettings DeserializeSettings(string data) { RSSSettings rsssettings; try { var ser = new DataContractSerializer(typeof(RSSSettings)); …
4
votes
1 answer

Data Serialisation in Objective-C (Avro alternative)

I've been the last week trying to serialise all of the classes of one iOS project (Objective-C). Due to I use to do it in Android projects with Avro (Apache) library, I've been trying to do the same in the iOS project, however, the first thing that…
CPI
  • 786
  • 1
  • 5
  • 18
4
votes
2 answers

Why should you use XML CDATA blocks?

When creating XML I'm wondering why the CDATA blocks are uses rather than just escaping the data. Is there something allowed in a CDATA block that can't be escaped and placed in a regular tag? instead…
Xeoncross
  • 55,620
  • 80
  • 262
  • 364
3
votes
2 answers

Python data persistence

Whenever a Python object needs to be stored or sent over a network, it is first serialized. I guess the reason is that the storage and network transfer are both based on bits. I have a stupid question, which is more like a computer science…
David Zheng
  • 797
  • 7
  • 21
3
votes
1 answer

Hazelcast IMap.get() throws HazelcastSerializationException, but IMap.put() works fine

I have an Hazelcast server instance running on a VM. Data is supposed to be stored in a MAP, where the User class is as following: public class User implements com.hazelcast.nio.serialization.DataSerializable{ private Integer id; …
antonio
  • 722
  • 11
  • 22
2
votes
6 answers

What is the best way to binarize data

I have some data files that are written as tag = value, where tag is string and value may be numeric, string, array, etc. I use this format because is readable and can be edited easy. Now every class that is instantiated using this format has a load…
Mircea Ispas
  • 20,260
  • 32
  • 123
  • 211
1
vote
2 answers

'function' object has no attribute 'dumps'

I imported pickle from copyreg. I then use the attribute dumps to convert a dictionary into bytes b'\x80\x04...' but it results in the error shown below: from copyreg import pickle d={"name":value} d=pickle.dumps(d) Error: AttributeError:…
Kobina Adu
  • 27
  • 4
1
vote
2 answers

Simple data serialization in C

I am currently re-designing an application and stumbled upon a problem serializing some data. Say I have an array of size mxn double **data; that I want to serialize into a char *dataSerialized using simple delimiters (one for rows, one for…
alkar
  • 5,459
  • 7
  • 27
  • 43
1
vote
0 answers

How to understand a YAML script to answer questions?

I am going to learn YAML data serialization language, and I want to answer these questions based on a YAML script. What would be the right answers? I have learned some JSON but to differentiate YAML with JSON & to get an idea of YAML I have found…
1
vote
3 answers

Why does ethereum uses RLP encoding

Why does ethereum uses RLP encoding encoding for serialising data i mean is there are specific reason for not using already existing formats ?? other than RLP being really compact and space efficient.
1
2