Skip to main content
Apache Fory™ - Blazingly-Fast Multi-language Serialization

Apache Fory™

A blazingly-fast multi-language serialization framework for idiomatic domain objects, Schema IDL, and cross-language data exchange.

Core capabilities

What Fory is built to handle.

Fory brings together cross-language serialization, idiomatic object support, Schema IDL/code generation, reference tracking, schema evolution, and row-format access.

Quick start

Start from idiomatic domain objects.

Create a native object in your language, then serialize and deserialize it with one-line Fory calls.

Java supports xlang and native modes, JIT serializers, schema evolution, and Java-native object graph features.

Install
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
<version>1.1.0</version>
</dependency>
Serialize / deserialize
import org.apache.fory.Fory;

public record Person(String name, int age) {}

Fory fory = Fory.builder()
.withXlang(true)
.build();
fory.register(Person.class, "Person");

byte[] bytes = fory.serialize(new Person("Alice", 30));
Person out = (Person) fory.deserialize(bytes);
Schema IDL

Model contracts that still understand object graphs.

Fory IDL starts with familiar message definitions, then adds unions and reference-aware fields for data models that ordinary IDLs tend to flatten.

01

Message Type

Define structured data types with typed fields, field IDs, and explicit optional fields.

02

Union Type

Map one-of-several cases to tagged unions, and to native union or sum types where supported.

03

Circular References

Use ref-tracked fields when the same object can be shared or a graph contains cycles.

model.fdlFory IDL
package example;

message Dog {
string name = 1;
int32 bark_volume = 2;
}

message Cat {
string name = 1;
int32 lives = 2;
}

union Animal {
Dog dog = 1;
Cat cat = 2;
}

message Node {
string value = 1;
ref Node parent = 2;
list<ref Node> children = 3;
}
Performance

Designed for high-throughput serialization paths.

Fory combines efficient binary encoding with highly optimized serializers, from JIT compilation to statically generated code.

View full benchmark charts
Optimized Serializers

Use JIT serializers, source generators, macros, KSP, and build_runner where each runtime supports them.

Efficient Encoding

Encode typed objects into an efficient binary format for fast serialization and deserialization.

Data boundaries

Match Fory to each data boundary.

Use one serialization layer, but choose the payload surface by the boundary your data crosses.

Language boundary

Use xlang when services in different languages need to exchange the same typed payload directly.

Runtime boundary

Use native mode when objects stay inside one runtime and object graph fidelity matters.

Read boundary

Use row format for partial reads and analytics workloads that should not rebuild whole objects.

Adoption path

Adopt Fory without changing the object model.

Choose the wire mode for each boundary, promote shared models into Fory IDL when contracts need to last, then validate the exact path with per-language benchmarks.

01

Choose the wire mode

Use xlang for portable payloads shared across languages; use native mode for same-runtime traffic that needs broader runtime-specific object models.

Usage guide
02

Promote shared contracts

Define Fory IDL once, generate type-safe native models across languages, and use optional fields, refs, unions, or services when contracts evolve.

Schema IDL guide
03

Benchmark the rollout path

Compare serialization throughput, deserialization throughput, payload size, and reproduction steps for the runtime you plan to ship.

Benchmark charts