Recursive Delimited Array, or RDA, is an encoding format for storing and transporting structured data in a text string.
Unlike XML and JSON using a schema to restrict the data to the specifics of a certain application, RDA is a schema-less format for generic data. It means an RDA-encoded string (aka. "RDA container") can be used for storing any data from any application.
With the simple yet powerful data transportation enabled by using RDA, programs "talking" to each other has never been so easy.
An RDA container is like a large, expandable pocket with many inner pockets, recursively, which can be used for storing "anything"; an XML or JSON container is like a wallet with specific places for coins, notes, and cards.
When using XML/JSON format for data exchange between two applications, a developer must first design a schema that decides the data types and data structure specifically for the data exchange. If one of the applications wants to change its data format and schema, the change must be propagated across, and be agreed by all the connected applications. Changing the schema makes it difficult to manage compatibility, but on the other hand, not being able to change the schema restricts what can be enhanced to the applications.
In comparison, while RDA can also be used for exchanging complex structured data, it is schema-less and is designed to be application independent1:
- Instead of using tags or markups, RDA uses delimited encoding for separating and structuring data elements;
- Instead of using named paths, RDA uses integer-based indexes for addressing data elements inside a container;
- Instead of having multiple, specific data types, RDA has only two generalized data types2: RDA and string, for "composite" and "primitive" data values respectively.
By using RDA, applications are no longer restricted by a pre-defined data format before they can exchange data. It means the data format can be dynamic and can be changed if required, giving the applications the flexibility to handle data changes while maintaining the connection and communication.
RDA allows implementing a generic and unified data transport layer which applications can utilize for sending and receiving data. As the applications are "loosely coupled" using such a data transport layer, they are less dependent and easier to maintain if the data format is changed.
One powerful feature of RDA is for implementing cross-language and cross-application object-serialization. For example, you can send a "Person" object as a serialized RDA container from your C# program to many receivers, and in a Python program, you can de-serialize a "User" object using data elements from the received RDA container. Because there is no schema to be adhered to, the "Person" object and the "User" object can be programmed differently and be maintained separately.
Another feature of RDA is for maintaining version compatibility between a sender and a receiver. Because RDA's recursive storage allows storing an RDA inside another RDA, multiple versions (or different formats) of the data can be transported "side-by-side" (as child RDAs) in an RDA container, and the receiver can pick its preferred version or format to use.
Indeed, being able to send multiple copies of any data side-by-side in a container can be interestingly useful: like sending XML data together with its DTD3, or sending a digital document paired with its digital signature or public key, or sending a computing "workload" that has some data together with an executable script to a data-processing unit, etc.
Also, thanks to its simple and efficient delimiter-based encoding, an RDA container is much more compact than a XML or JSON container with the same content, and it is much easier to parse. RDA encoding is also more robust and resilient to data corruption, as it does not have any reserved keyword or character and allows any charactor to be part of the data content. In contrast, for example, in XML the line-feed character in data has to be encoded as "
", otherwise it will cause corruption.
This project contains the (forthcoming, under development) technical documentation of the RDA encoding rules.
The wiki of this project contains more details about RDA, including -
- RDA overview. - explains the background and philosophy of this project.
- Using the API. - contains more technical details, with a practical example.
- FAQ. - miscellaneous topics and dicsussions.
-
Michael Chen - Invented RDA, and developed the reference RDA parser (in C#) - sierrathedog
-
Samuel Chen - The Java parser and the Python parser - samuelfchen
You can be a contributor and help this project! Please contact us.
This project is licensed under the MIT License - see the LICENSE file for details.
"Recursive Delimited Array" and "RDA" are trademarks of Foldda Pty Ltd.
Footnotes
-
RDA data types and data structure are discussed here. ↩
-
An XML or JSON document can be converted to a single 'string' data element, and be stored inside an RDA container. ↩