External Data Representation & Marshalling in Distributed Systems
Introduction
External Data Representation & Marshalling in Distributed Systems
Introduction
In distributed systems, applications run across multiple machines that may differ in hardware architecture, operating systems, programming languages, and memory representation. For example, a banking system may have servers in different countries where one system is running Java on Linux while another is running C++ on Windows. Because of these differences, data stored in memory on one system cannot be directly interpreted by another system.
This creates a fundamental challenge: how can data be reliably transferred between heterogeneous systems without losing meaning or structure?
To solve this problem, distributed systems use a standard technique called external data representation, where data is converted into a common format before transmission. This process is called as marshalling, and the reverse process is called unmarshalling.
Marshalling ensures that complex data structures such as objects, records, and arrays are converted into a transferable format, typically a byte stream, while preserving their structure and meaning. On the receiving side, unmarshalling reconstructs the original data from this format.
Different systems use different data representation standards depending on performance, interoperability, and complexity requirements. This report discusses three major approaches:
- CORBA Common Data Representation (CDR)
- Java Object Serialization
- XML-based data representation
Each approach reflects different design trade-offs between efficiency, portability, and usability in distributed computing environments.
1. CORBA CDR (Common Data Representation)
CORBA (Common Object Request Broker Architecture) was designed to support communication between distributed objects written in different programming languages and running on different platforms. In such heterogeneous environments, a major challenge is ensuring that data produced by one system can be correctly interpreted by another. To solve this, CORBA defines a standard called Common Data Representation (CDR), which is a low-level binary encoding format used during marshalling and unmarshalling.
Design Overview
CDR is a platform-independent binary encoding scheme that defines how primitive data types such as integers, floats, and character and complex structures such as arrays and objects are converted into a standard byte stream for network transmission.
Unlike text-based formats, CDR does not store data in a human-readable form. Instead, it encodes data in a compact binary layout, which reduces message size and improves transmission speed. It also defines strict rules for handling issues such as:
- Byte ordering (endianness)
- Data alignment in memory
- Type encoding for structured data
This ensures that a data structure serialized on one machine can be reconstructed correctly on another machine with a different architecture
Example:
struct Employee {
long id;
string name;
float salary;
};
When this structure is transmitted using CDR, it is converted into a binary stream that preserves both type information and data ordering, ensuring that the receiving system can reconstruct it correctly.

Strengths
- High performance due to binary encoding
- Language and platform independent
- Efficient for large-scale distributed systems
- Well suited for tightly controlled enterprise environments
Weaknesses
- Difficult to debug because binary format not human readable
- Complex tooling and steep learning curve
- Tight coupling with CORBA infrastructure
- Less flexible compared to modern formats
Use Case
CDR is best suited for high performance enterprise systems where efficiency is more important than readability. It is commonly found in domains like telecommunications systems and legacy banking middleware, where performance and reliability are critical.
2. Java Object Serialization
Java Object Serialization is a built-in mechanism in Java that allows objects to be converted into a byte stream and later deserialized. It’s commonly used for tasks like deep copying objects, caching, and remote method calls via Java RMI.
Design Overview
Java serialization works by automatically converting an object and its entire object graph into a sequential byte stream. This means that if an object contains references to other objects, those referenced objects are also serialized recursively without requiring manual handling.
Internally, the Java serialization mechanism uses reflection to inspect object fields at runtime and convert them into a portable format. Each object is assigned metadata such as class name, field types, and values, which are written into the stream.
A key feature of Java serialization is serialVersionUID. This acts as a version control identifier for serialized classes. During deserialization, the system checks whether the sender and receiver versions of the class match. If they do not match, deserialization fails to prevent incompatible object reconstruction.
This mechanism ensures structural consistency but also makes the system fragile when class definitions change.
Example Code
import java.io.*;
class Employee implements Serializable {
private static final long serialVersionUID = 1L;
int id;
String name;
double salary;
public Employee(int id, String name, double salary) {
this.id = id;
this.name = name;
this.salary = salary;
}
}
public class SerializeDemo {
public static void main(String[] args) throws Exception {
Employee emp = new Employee(101, "John", 50000);
FileOutputStream fileOut = new FileOutputStream("emp.ser");
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(emp);
out.close();
fileOut.close();
}
}
In this example, the Employee object is converted into a byte stream and stored in a file (emp.ser ). It can later be read back and reconstructed into the original object.
Strengths
- Very easy to use (minimal manual work)
- Automatically handles object graphs
- Fully integrated into the Java ecosystem
- Useful for caching and remote method invocation
Weaknesses
- Limited to Java (poor cross-language support)
- Fragile versioning small class changes can break compatibility
- Security risks especially deserialization has vulnerabilities
- Less efficient compared to modern binary formats like Protobuf or CDR
Use Case
Java serialization works best in Java only environments, such as internal systems, caching layers, or quick prototypes where interoperability with other languages is not a concern.

3. XML (Extensible Markup Language)
XML (Extensible Markup Language) is a text-based data representation format designed to store and exchange structured data in a self-describing and platform-independent manner. It is widely used in distributed systems, particularly in web services such as SOAP-based architectures, where interoperability between heterogeneous systems is required.
Design Overview
XML represents data using a hierarchical tag-based structure where each element explicitly defines both the data and its meaning. This makes XML self-describing, meaning the structure of the data is embedded within the data itself, allowing systems to interpret it without prior agreement on memory layout or binary encoding rules.
Because XML is plain text, it is independent of hardware architecture, programming language, and operating system. This makes it highly portable across distributed systems. However, this portability comes at a cost.
Before XML data can be processed, it must be parsed into an internal tree structure (commonly a DOM or streamed via SAX/StAX parsers). This parsing step introduces significant computational overhead compared to binary formats.
XML also supports schema validation using XSD (XML Schema Definition), which allows systems to enforce strict rules on structure, data types, and constraints before processing the data. This improves reliability in distributed communication where data integrity is critical.
Example
<Employee>
<id>101</id>
<name>John</name>
<salary>50000</salary>
</Employee>
In this example, the structure and meaning of the data are clearly defined by the tags, making it easy to interpret even without prior knowledge of the system.
Strengths
- Highly interoperable across languages and platforms
- Human readable and easy to debug
- Supports validation using schemas (XSD)
- Widely supported in enterprise systems
Weaknesses
- Verbose, resulting in larger payload sizes
- Slow parsing compared to binary formats
- Higher network and processing overhead
- Not ideal for mobile or high-performance systems
Use Case
XML is commonly used in web services (especially SOAP APIs), configuration files, and enterprise integration systems where interoperability and readability are more important than raw performance.
4. Comparative Analysis
The three approaches differ significantly in design philosophy and performance trade-offs.

5. Modern Extensions
While CORBA CDR, Java Object Serialization, and XML form the foundation of data representation in distributed systems, modern architectures often rely on more efficient and scalable alternatives.
Protocol Buffers (Protobuf)
It is binary serialization format developed by Google. It is significantly faster and smaller compared to XML and Java serialization, making it ideal for high-performance microservices.
MessagePack
MessagePack is a binary representation of JSON that maintains a balance between readability and performance. It is lightweight, efficient, and suitable for systems that need faster processing without completely losing structure clarity.
Apache Avro
Apache Avro is widely used in big data ecosystems such as Hadoop. It supports schema evolution, dynamic typing, and efficient serialization, making it highly suitable for large-scale data processing pipelines.
Conclusion
External data representation is a fundamental requirement in distributed systems, and each approach reflects different design priorities and trade-offs.
CORBA CDR focuses on high performance and enterprise-level interoperability within controlled environments, making it suitable for legacy distributed systems.
Java Object Serialization prioritizes simplicity and tight integration within the Java ecosystem, but it suffers from limited flexibility, weaker security, and poor cross-language support.
XML emphasizes interoperability and human readability, making it widely used in web services, though at the cost of performance and efficiency.
There is no single best solution for all scenarios. The appropriate choice depends on system requirements such as performance constraints, platform diversity, scalability needs, and security considerations. While modern systems increasingly adopt lightweight binary formats like Protocol Buffers, understanding these foundational technologies remains essential for designing reliable and efficient distributed applications.

References
- GeeksforGeeks. Marshalling in Distributed System. Available at: https://www.geeksforgeeks.org/marshalling-in-distributed-system/
- TutorialsPoint. Java Serialization. Available at: https://www.tutorialspoint.com/java/java_serialization.htm
메타데이터
- post_id
- b22b05654802
- slug
- external-data-representation-marshalling-in-distributed-systems-b22b05654802
- url
- https://medium.com/@vipusrihar/external-data-representation-marshalling-in-distributed-systems-b22b05654802
- canonical_url
- https://medium.com/@vipusrihar/external-data-representation-marshalling-in-distributed-systems-b22b05654802
- author_url
- https://medium.com/@vipusrihar
- status
- ok
- fetched_at
- 2026-06-12 18:14:10