When the data grows, the result will contains many duplicate field names, and size growing.
How can I serialize each field into an array to get small size or better compression. Like below:
This is known as the SoA vs AoS distinction. The easiest is probably to construct a struct with id, name and other being vectors and just serialize that.
Besides that, you can make your own DataVec and implement Serialize on it such that it serializes like that.
The format you're proposing doesn't seem like a particularly good idea to me. It's quite difficult to read (for humans) and still pretty verbose.
If you want fewer bytes on the line but still keep the human-readability, run the JSON through ZIP or some other compression, that will transparently take care of the duplicate keys and is easily reversible.
If you don't care about human-readability, there are binary serialization formats that are much more compact than what you're proposing.