Is there a data format lighter than json?

943 views Asked by At

We have data with fixed keys in json, like

   { a:1,b:1,c:1},{ a:2,b:2,c:2},{a:3,b:3,c:3}......

Is there any format lighter than json, like

           {a,b,c},{1,1,1},{2,2,2}.......

I don't want to post keys for each dataset. Size of data is so important for me for mobile...

Any suggestions?

2

There are 2 answers

1
Mohit Kanwar On

You can achieve it using json:

{
    "keys": [
        "a",
        "b",
        "C"
    ],
    "values": [
        [
            1,
            1,
            1
        ],
        [
            2,
            2,
            2
        ],
        [
            3,
            3,
            3
        ]
    ]
}
0
jonathanglima On

http://msgpack.org/ or https://github.com/google/protobuf or just CSV if you don't repeat your header a lot (or even don't send it)