Skip to main content

Apache Fory (incubating)

A blazing-fast cross-language serialization framework powered by just-in-time compilation and zero-copy

High performance

Compared to other serialization frameworks, there is a 20~170x speed up.

Easy to use

No need for DSL, you can use Fory effectively with your intuition.

Multi-languages

Supports popular programming languages such as Java, Python, C++, Golang, Javascript, Rust, and more will be added in the future.

Quick Start!

Choose a language to get started.

import java.util.List;
import java.util.Arrays;
import org.apache.fory.*;

public class Example {
  // Note that Fory instances should be reused between
  // multiple serializations of different objects.
  static ThreadSafeFory fory = Fory.builder().withLanguage(Language.JAVA)
    // Allow to deserialize objects unknown types,
    // more flexible but less secure.
    // .requireClassRegistration(false)
    .buildThreadSafeFory();

  static {
    // Registering types can reduce class name serialization
    // overhead but not mandatory.
    // If secure mode enabled
    //all custom types must be registered.
    fory.register(SomeClass.class);
  }

  public static void main(String[] args) {
    SomeClass object = new SomeClass();
    byte[] bytes = fory.serialize(object);
    System.out.println(fory.deserialize(bytes));
  }
}