0

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.

sophia
  • 39
  • 4
  • possible duplicate of [How do you embed binary data in XML?](http://stackoverflow.com/questions/19893/how-do-you-embed-binary-data-in-xml) – Alex Brown Jan 16 '14 at 06:11
  • @AlexBrown: I explicitly **do not** want to embed binary data in XML. I want to know of **alternatives to XML**. – sophia Jan 16 '14 at 06:14
  • XML is a storage/transmission format, so with an appropriate [alternative to an] XML library, you can handle the "save, load" part of your final paragraph, but not the in-memory manipulation part ("add items, delete items, manipulate the structure"), which sounds like vanilla tree code to me. If you're asking for a library that does *all* of those things, *and* is flexible enough to perform your bespoke manipulations, *and* performs well enough, your question is probably wildly unrealistic, apart from being off-topic ([Help/on-topic]). If you aren't, then you need to clarify the question. – anton.burger Jan 16 '14 at 08:52
  • Yes indeed. I write a lot of applications that adopt a function library called "ice-packets" that does everything you want and more. The library is inherently a tree-structure while you work in memory, though it includes mechanisms that let application software implement many other simultaneous organizations and structures on portions of the data, or the entirety of your data. All binary types remain in their binary form. It includes functions that automatically serialize any portion of your data (to save/transmit), or recover (loaded/received) data back into internal in-memory form. – honestann Jan 17 '14 at 06:05

3 Answers3

0

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.

Heath
  • 2,986
  • 18
  • 21
0

Some Info:

Binary XML: http://en.wikipedia.org/wiki/Binary_XML

Binary JSON: http://en.wikipedia.org/wiki/BSON

7zark7
  • 10,015
  • 5
  • 39
  • 54
0

Yes, how about Google protocol buffers?

Nicholas Wilson
  • 9,435
  • 1
  • 41
  • 80