{"id":11152467,"url":"https://github.com/apache/fury","last_synced_at":"2025-05-12T13:10:16.323Z","repository":{"id":181137820,"uuid":"633686625","full_name":"apache/fury","owner":"apache","description":"A blazingly fast multi-language serialization framework powered by JIT and zero-copy.","archived":false,"fork":false,"pushed_at":"2025-05-12T09:58:38.000Z","size":12190,"stargazers_count":3271,"open_issues_count":226,"forks_count":269,"subscribers_count":47,"default_branch":"main","last_synced_at":"2025-05-12T13:09:32.371Z","etag":null,"topics":["compression","cpp","cross-language","encoding","fast","golang","hacktoberfest","java","javascript","jit","lightning","marshalling","multiple-language","persistence","python","rpc","rust","serialization","transfer","zero-copy"],"latest_commit_sha":null,"homepage":"https://fury.apache.org/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-28T03:57:00.000Z","updated_at":"2025-05-12T05:16:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"c5d70753-d0fe-415c-958e-d97c7a0c440c","html_url":"https://github.com/apache/fury","commit_stats":{"total_commits":1047,"total_committers":77,"mean_commits":"13.597402597402597","dds":"0.30754536771728747","last_synced_commit":"a3a22381a67451327f1b000cad780f730db951d7"},"previous_names":["alipay/fury","fury-project/fury","apache/incubator-fury","apache/fury"],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Ffury","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Ffury/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Ffury/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Ffury/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/fury/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745161,"owners_count":21957317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compression","cpp","cross-language","encoding","fast","golang","hacktoberfest","java","javascript","jit","lightning","marshalling","multiple-language","persistence","python","rpc","rust","serialization","transfer","zero-copy"],"created_at":"2024-06-13T17:35:44.114Z","updated_at":"2025-05-12T13:10:16.247Z","avatar_url":"https://github.com/apache.png","language":"Java","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"65%\" alt=\"\" src=\"docs/images/logo/fury_github_banner.png\"\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/apache/fury/ci.yml?branch=main\u0026style=for-the-badge\u0026label=GITHUB%20ACTIONS\u0026logo=github)](https://github.com/apache/fury/actions/workflows/ci.yml)\n[![Slack Channel](https://img.shields.io/badge/slack-join-3f0e40?logo=slack\u0026style=for-the-badge)](https://join.slack.com/t/fury-project/shared_invite/zt-1u8soj4qc-ieYEu7ciHOqA2mo47llS8A)\n[![X](https://img.shields.io/badge/@ApacheFury-follow-blue?logo=x\u0026style=for-the-badge)](https://x.com/ApacheFury)\n[![Maven Version](https://img.shields.io/maven-central/v/org.apache.fury/fury-core?style=for-the-badge)](https://search.maven.org/#search|gav|1|g:\"org.apache.fury\"%20AND%20a:\"fury-core\")\n\n**Apache Fury (incubating)** is a blazingly-fast multi-language serialization framework powered by **JIT** (just-in-time compilation) and **zero-copy**, providing up to 170x performance and ultimate ease of use.\n\n\u003chttps://fury.apache.org\u003e\n\n\u003e [!IMPORTANT]\n\u003e Apache Fury (incubating) is an effort undergoing incubation at the Apache\n\u003e Software Foundation (ASF), sponsored by the Apache Incubator PMC.\n\u003e\n\u003e Please read the [DISCLAIMER](DISCLAIMER) and a full explanation of [\"incubating\"](https://incubator.apache.org/policy/incubation.html).\n\n## Features\n\n- **Multiple languages**: Java/Python/C++/Golang/JavaScript/Rust/Scala/Kotlin/TypeScript.\n- **Zero-copy**: Cross-language out-of-band serialization inspired\n  by [pickle5](https://peps.python.org/pep-0574/) and off-heap read/write.\n- **High performance**: A highly-extensible JIT framework to generate serializer code at runtime in an async multi-thread way to speed serialization, providing 20-170x speed up by:\n  - reduce memory access by inlining variables in generated code.\n  - reduce virtual method invocation by inline call in generated code.\n  - reduce conditional branching.\n  - reduce hash lookup.\n- **Multiple binary protocols**: Object graph, row format, and so on.\n\nIn addition to cross-language serialization, Fury also features at:\n\n- Drop-in replace Java serialization frameworks such as JDK/Kryo/Hessian, but 100x faster at most, which can greatly improve\n the efficiency of high-performance RPC calls, data transfer, and object persistence.\n- **100% compatible** with JDK serialization API with much faster implementation: supporting JDK `writeObject`/`readObject`/`writeReplace`/`readResolve`/`readObjectNoData`/`Externalizable` API.\n- Supports **Java 8~21**, Java 17+ `record` is supported too.\n- Supports [AOT compilation serialization](docs/guide/graalvm_guide.md) for **GraalVM native image**, and no reflection/serialization json config are needed.\n- Supports shared and circular reference object serialization for golang.\n- Supports [scala serialization](docs/guide/scala_guide.md)\n- Supports [Kotlin serialization](kotlin/README.md)\n- Supports automatic object serialization for golang.\n\n## Protocols\n\nFury designed and implemented multiple binary protocols for different scenarios:\n\n- **[xlang serialization format](docs/specification/xlang_serialization_spec.md)**:\n  - Cross-language serialize any object automatically, no need for IDL definition, schema compilation and object to/from\n    protocol conversion.\n  - Support optional shared reference and circular reference, no duplicate data or recursion error.\n  - Support object polymorphism.\n- **[Java serialization format](docs/specification/java_serialization_spec.md)**: Highly-optimized and drop-in replacement for Java serialization.\n- **[Row format format](docs/specification/row_format_spec.md)**: A cache-friendly binary random access format, supports skipping serialization and\n  partial serialization, and can convert to column-format automatically.\n\nNew protocols can be easily added based on Fury existing buffer, encoding, meta, codegen and other capabilities. All of those share the same codebase, and the optimization for one protocol can be reused by another protocol.\n\n## Benchmarks\n\nDifferent serialization frameworks are suitable for different scenarios, and benchmark results here are for reference only.\n\nIf you need to benchmark for your specific scenario, make sure all serialization frameworks are appropriately configured for that scenario.\n\nDynamic serialization frameworks support polymorphism and references, but they often come with a higher cost compared to static serialization frameworks, unless they utilize JIT techniques like Fury does.\nTo ensure accurate benchmark statistics, it is advisable to **warm up** the system before collecting data due to Fury's runtime code generation.\n\n### Java Serialization\n\nIn these charts below, titles containing \"compatible\" represent schema compatible mode: type forward/backward compatibility is enabled; while titles without \"compatible\" represent schema consistent mode: class schema must be the same between serialization and deserialization.\n\nWhere `Struct` is a class with [100 primitive fields](https://github.com/apache/fury/tree/main/docs/benchmarks#Struct), `MediaContent` is a class from [jvm-serializers](https://github.com/eishay/jvm-serializers/blob/master/tpc/src/data/media/MediaContent.java), and `Sample` is a class from [kryo benchmark](https://github.com/EsotericSoftware/kryo/blob/master/benchmarks/src/main/java/com/esotericsoftware/kryo/benchmarks/data/Sample.java).\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"24%\" alt=\"\" src=\"docs/benchmarks/compatible/bench_serialize_compatible_STRUCT_to_directBuffer_tps.png\"\u003e\n\u003cimg width=\"24%\" alt=\"\" src=\"docs/benchmarks/compatible/bench_serialize_compatible_MEDIA_CONTENT_to_array_tps.png\"\u003e\n\u003cimg width=\"24%\" alt=\"\" src=\"docs/benchmarks/serialization/bench_serialize_MEDIA_CONTENT_to_array_tps.png\"\u003e\n\u003cimg width=\"24%\" alt=\"\" src=\"docs/benchmarks/serialization/bench_serialize_SAMPLE_to_array_tps.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"24%\" alt=\"\" src=\"docs/benchmarks/compatible/bench_deserialize_compatible_STRUCT_from_directBuffer_tps.png\"\u003e\n\u003cimg width=\"24%\" alt=\"\" src=\"docs/benchmarks/compatible/bench_deserialize_compatible_MEDIA_CONTENT_from_array_tps.png\"\u003e\n\u003cimg width=\"24%\" alt=\"\" src=\"docs/benchmarks/deserialization/bench_deserialize_MEDIA_CONTENT_from_array_tps.png\"\u003e\n\u003cimg width=\"24%\" alt=\"\" src=\"docs/benchmarks/deserialization/bench_deserialize_SAMPLE_from_array_tps.png\"\u003e\n\u003c/p\u003e\n\nSee [benchmarks](https://github.com/apache/fury/tree/main/docs/benchmarks) for more benchmarks about type forward/backward compatibility, off-heap support, zero-copy serialization.\n\n## Installation\n\n### Java\n\nNightly snapshot:\n\n```xml\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003cid\u003eapache\u003c/id\u003e\n    \u003curl\u003ehttps://repository.apache.org/snapshots/\u003c/url\u003e\n    \u003creleases\u003e\n      \u003cenabled\u003efalse\u003c/enabled\u003e\n    \u003c/releases\u003e\n    \u003csnapshots\u003e\n      \u003cenabled\u003etrue\u003c/enabled\u003e\n    \u003c/snapshots\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.apache.fury\u003c/groupId\u003e\n  \u003cartifactId\u003efury-core\u003c/artifactId\u003e\n  \u003cversion\u003e0.11.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n\u003c!-- row/arrow format support --\u003e\n\u003c!-- \u003cdependency\u003e\n  \u003cgroupId\u003eorg.apache.fury\u003c/groupId\u003e\n  \u003cartifactId\u003efury-format\u003c/artifactId\u003e\n  \u003cversion\u003e0.11.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e --\u003e\n```\n\nRelease version:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.apache.fury\u003c/groupId\u003e\n  \u003cartifactId\u003efury-core\u003c/artifactId\u003e\n  \u003cversion\u003e0.10.2\u003c/version\u003e\n\u003c/dependency\u003e\n\u003c!-- row/arrow format support --\u003e\n\u003c!-- \u003cdependency\u003e\n  \u003cgroupId\u003eorg.apache.fury\u003c/groupId\u003e\n  \u003cartifactId\u003efury-format\u003c/artifactId\u003e\n  \u003cversion\u003e0.10.2\u003c/version\u003e\n\u003c/dependency\u003e --\u003e\n```\n\n### Scala\n\nScala2:\n\n```sbt\nlibraryDependencies += \"org.apache.fury\" % \"fury-scala_2.13\" % \"0.10.2\"\n```\n\nScala3:\n\n```sbt\nlibraryDependencies += \"org.apache.fury\" % \"fury-scala_3\" % \"0.10.2\"\n```\n\n### Kotlin\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.apache.fury\u003c/groupId\u003e\n  \u003cartifactId\u003efury-kotlin\u003c/artifactId\u003e\n  \u003cversion\u003e0.10.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Python\n\n```bash\npip install pyfury\n```\n\n### JavaScript\n\n```bash\nnpm install @furyjs/fury\n```\n\n### Golang\n\n```bash\ngo get github.com/apache/fury/go/fury\n```\n\n## Quickstart\n\nHere we give a quick start about how to use Fury, see [user guide](docs/README.md) for more details about [java](docs/guide/java_serialization_guide.md), [cross language](docs/guide/xlang_serialization_guide.md), and [row format](docs/guide/row_format_guide.md).\n\n### Fury java object graph serialization\n\nIf you don't have cross-language requirements, using this mode will\nresult in better performance.\n\n```java\nimport org.apache.fury.*;\nimport org.apache.fury.config.*;\nimport java.util.*;\n\npublic class Example {\n  public static void main(String[] args) {\n    SomeClass object = new SomeClass();\n    // Note that Fury instances should be reused between\n    // multiple serializations of different objects.\n    {\n      Fury fury = Fury.builder().withLanguage(Language.JAVA)\n        .requireClassRegistration(true)\n        .build();\n      // Registering types can reduce class name serialization overhead, but not mandatory.\n      // If class registration enabled, all custom types must be registered.\n      fury.register(SomeClass.class);\n      byte[] bytes = fury.serialize(object);\n      System.out.println(fury.deserialize(bytes));\n    }\n    {\n      ThreadSafeFury fury = Fury.builder().withLanguage(Language.JAVA)\n        .requireClassRegistration(true)\n        .buildThreadSafeFury();\n      // Registering types can reduce class name serialization overhead, but not mandatory.\n      // If class registration enabled, all custom types must be registered.\n      fury.register(SomeClass.class);\n      byte[] bytes = fury.serialize(object);\n      System.out.println(fury.deserialize(bytes));\n    }\n    {\n      ThreadSafeFury fury = new ThreadLocalFury(classLoader -\u003e {\n        Fury f = Fury.builder().withLanguage(Language.JAVA)\n          .withClassLoader(classLoader).build();\n        f.register(SomeClass.class);\n        return f;\n      });\n      byte[] bytes = fury.serialize(object);\n      System.out.println(fury.deserialize(bytes));\n    }\n  }\n}\n```\n\n### Cross-language object graph serialization\n\n**Java**\n\n```java\nimport org.apache.fury.*;\nimport org.apache.fury.config.*;\nimport java.util.*;\n\npublic class ReferenceExample {\n  public static class SomeClass {\n    SomeClass f1;\n    Map\u003cString, String\u003e f2;\n    Map\u003cString, String\u003e f3;\n  }\n\n  public static Object createObject() {\n    SomeClass obj = new SomeClass();\n    obj.f1 = obj;\n    obj.f2 = ofHashMap(\"k1\", \"v1\", \"k2\", \"v2\");\n    obj.f3 = obj.f2;\n    return obj;\n  }\n\n  // mvn exec:java -Dexec.mainClass=\"org.apache.fury.examples.ReferenceExample\"\n  public static void main(String[] args) {\n    Fury fury = Fury.builder().withLanguage(Language.XLANG)\n      .withRefTracking(true).build();\n    fury.register(SomeClass.class, \"example.SomeClass\");\n    byte[] bytes = fury.serialize(createObject());\n    // bytes can be data serialized by other languages.\n    System.out.println(fury.deserialize(bytes));\n  }\n}\n```\n\n**Python**\n\n```python\nfrom typing import Dict\nimport pyfury\n\nclass SomeClass:\n    f1: \"SomeClass\"\n    f2: Dict[str, str]\n    f3: Dict[str, str]\n\nfury = pyfury.Fury(ref_tracking=True)\nfury.register_type(SomeClass, typename=\"example.SomeClass\")\nobj = SomeClass()\nobj.f2 = {\"k1\": \"v1\", \"k2\": \"v2\"}\nobj.f1, obj.f3 = obj, obj.f2\ndata = fury.serialize(obj)\n# bytes can be data serialized by other languages.\nprint(fury.deserialize(data))\n```\n\n**Golang**\n\n```go\npackage main\n\nimport furygo \"github.com/apache/fury/go/fury\"\nimport \"fmt\"\n\nfunc main() {\n type SomeClass struct {\n  F1 *SomeClass\n  F2 map[string]string\n  F3 map[string]string\n }\n fury := furygo.NewFury(true)\n if err := fury.RegisterTagType(\"example.SomeClass\", SomeClass{}); err != nil {\n  panic(err)\n }\n value := \u0026SomeClass{F2: map[string]string{\"k1\": \"v1\", \"k2\": \"v2\"}}\n value.F3 = value.F2\n value.F1 = value\n bytes, err := fury.Marshal(value)\n if err != nil {\n }\n var newValue interface{}\n // bytes can be data serialized by other languages.\n if err := fury.Unmarshal(bytes, \u0026newValue); err != nil {\n  panic(err)\n }\n fmt.Println(newValue)\n}\n```\n\n### Row format\n\n#### Java\n\n```java\npublic class Bar {\n  String f1;\n  List\u003cLong\u003e f2;\n}\n\npublic class Foo {\n  int f1;\n  List\u003cInteger\u003e f2;\n  Map\u003cString, Integer\u003e f3;\n  List\u003cBar\u003e f4;\n}\n\nRowEncoder\u003cFoo\u003e encoder = Encoders.bean(Foo.class);\nFoo foo = new Foo();\nfoo.f1 = 10;\nfoo.f2 = IntStream.range(0, 1000000).boxed().collect(Collectors.toList());\nfoo.f3 = IntStream.range(0, 1000000).boxed().collect(Collectors.toMap(i -\u003e \"k\"+i, i-\u003ei));\nList\u003cBar\u003e bars = new ArrayList\u003c\u003e(1000000);\nfor (int i = 0; i \u003c 1000000; i++) {\n  Bar bar = new Bar();\n  bar.f1 = \"s\"+i;\n  bar.f2 = LongStream.range(0, 10).boxed().collect(Collectors.toList());\n  bars.add(bar);\n}\nfoo.f4 = bars;\n// Can be zero-copy read by python\nBinaryRow binaryRow = encoder.toRow(foo);\n// can be data from python\nFoo newFoo = encoder.fromRow(binaryRow);\n// zero-copy read List\u003cInteger\u003e f2\nBinaryArray binaryArray2 = binaryRow.getArray(1);\n// zero-copy read List\u003cBar\u003e f4\nBinaryArray binaryArray4 = binaryRow.getArray(3);\n// zero-copy read 11th element of `readList\u003cBar\u003e f4`\nBinaryRow barStruct = binaryArray4.getStruct(10);\n\n// zero-copy read 6th of f2 of 11th element of `readList\u003cBar\u003e f4`\nbarStruct.getArray(1).getInt64(5);\nRowEncoder\u003cBar\u003e barEncoder = Encoders.bean(Bar.class);\n// deserialize part of data.\nBar newBar = barEncoder.fromRow(barStruct);\nBar newBar2 = barEncoder.fromRow(binaryArray4.getStruct(20));\n```\n\n#### Python\n\n```python\n@dataclass\nclass Bar:\n    f1: str\n    f2: List[pa.int64]\n@dataclass\nclass Foo:\n    f1: pa.int32\n    f2: List[pa.int32]\n    f3: Dict[str, pa.int32]\n    f4: List[Bar]\n\nencoder = pyfury.encoder(Foo)\nfoo = Foo(f1=10, f2=list(range(1000_000)),\n         f3={f\"k{i}\": i for i in range(1000_000)},\n         f4=[Bar(f1=f\"s{i}\", f2=list(range(10))) for i in range(1000_000)])\nbinary: bytes = encoder.to_row(foo).to_bytes()\nfoo_row = pyfury.RowData(encoder.schema, binary)\nprint(foo_row.f2[100000], foo_row.f4[100000].f1, foo_row.f4[200000].f2[5])\n```\n\n## Compatibility\n\n### Schema Compatibility\n\nFury java object graph serialization supports class schema forward/backward compatibility. The serialization peer and deserialization peer can add/delete fields independently.\n\nWe plan to add the schema compatibility support of cross-language serialization after [meta compression](https://github.com/apache/fury/issues/203) is finished.\n\n### Binary Compatibility\n\nWe are still improving our protocols, thus binary compatibility is not guaranteed between Fury major releases for now.\nHowever, it is guaranteed between minor versions. Please\n`versioning` your data by Fury major version if you will upgrade Fury in the future, see [how to upgrade fury](https://github.com/apache/fury/blob/main/docs/guide/java_serialization_guide.md#upgrade-fury) for further details.\n\nBinary compatibility will be guaranteed when Fury 1.0 is released.\n\n## Security\n\nStatic serialization is relatively secure. But dynamic serialization such as Fury java/python native serialization supports deserializing unregistered types, which provides more dynamics and flexibility, but also introduce security risks.\n\nFor example, the deserialization may invoke `init` constructor or `equals`/`hashCode` method, if the method body contains malicious code, the system will be at risk.\n\nFury provides a class registration option that is enabled by default for such protocols, allowing only deserialization of trusted registered types or built-in types.\n **Do not disable class registration unless you can ensure your environment is secure**.\n\nIf this option is disabled, you are responsible for serialization security. You can configure `org.apache.fury.resolver.ClassChecker` by\n`ClassResolver#setClassChecker` to control which classes are allowed for serialization.\n\nTo report security vulnerabilities found in Fury, please follow the [ASF vulnerability reporting process](https://apache.org/security/#reporting-a-vulnerability).\n\n## How to Build\n\nPlease read the [BUILD](docs/guide/DEVELOPMENT.md) guide for instructions on how to build.\n\n## How to Contribute\n\nPlease read the [CONTRIBUTING](CONTRIBUTING.md) guide for instructions on how to contribute.\n\n## License\n\nLicensed under the [Apache License, Version 2.0](LICENSE)\n","funding_links":[],"categories":["Java","Projects"],"sub_categories":["Serialization"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Ffury","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Ffury","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Ffury/lists"}