do any binary alternatives to XML exist

324 Views Asked by At

XML is one way to organize information in a tree-structured manner. However, I am looking for a mechanism that lets my software applications conveniently and efficiently store, retrieve and manipulate arbitrary information organized in a tree-structured manner.

Since much of the information my applications need to store is binary with no obvious text form, and overhead of translating back and forth between text and binary forms is too substantial, I prefer something that lets me applications store, retrieve and manipulate each element of information in its native [usually binary] form.

My application will be manipulating the structure of information in many ways and in real time, so these processes must be efficient. One typical and common example: my applications will move elements around, and every sub-element below that element (its "child elements") should move around with it automatically (without data actually being moved in memory). I imagine this would be done by each element having a "parent", so just changing the ID of the parent would change where that entire sub-hierarchy is located in the overall tree structure. Or something along these lines.

Bottom line: do any binary alternatives to XML exist, especially any that leave binary data in its native form?

I do not want to embed binary data into XML. And I prefer a solution that includes a (C compatible) function library of routines to add items, delete items, manipulate the structure, save, load, etc.

3

There are 3 best solutions below

0
On
0
On

Yes, how about Google protocol buffers?

0
On

Sounds like you want a NoSQL database solution, which you can add objects with child references and save the database, which will serialized those objects. As you move child references from one object to another and save the database, it should serialized efficiently. (In memory, the object references (basically pointers) are just reassigned.)

A popular choice - though not the only one (just search for "C# nosql") - is RavenDB.