# rkyv/rkyv

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/rkyv-rkyv).**

4,267 stars · 230 forks · Rust · MIT

## Links

- GitHub: https://github.com/rkyv/rkyv
- Homepage: https://rkyv.org
- awesome-repositories: https://awesome-repositories.com/repository/rkyv-rkyv.md

## Topics

`rust` `serialization` `zero-copy`

## Description

rkyv is a zero-copy deserialization framework for Rust that provides a binary serialization format for memory-mappable data archives. It allows complex data structures to be mapped to bytes and accessed directly from a buffer without allocating new memory or copying data.

The project enables the serialization of polymorphic types and trait objects, maintaining their dynamic behavior and structure within the binary form. It utilizes relative-pointer addressing and byte-aligned structure packing to ensure data remains valid regardless of where it is loaded in memory.

The framework covers high-performance data persistence and low-latency state management through direct memory mapping. It provides mechanisms for both zero-copy data access and full data type reconstruction when required by the application.

## Tags

### Data & Databases

- [Zero-Copy Deserialization](https://awesome-repositories.com/f/data-databases/zero-copy-data-access-libraries/zero-copy-deserialization.md) — Implements zero-copy deserialization to access complex data structures directly from buffers without allocations.
- [Binary Serialization Formats](https://awesome-repositories.com/f/data-databases/binary-serialization-formats.md) — Provides a specialized binary serialization format designed for efficient memory-mappable data archives.
- [Memory-Mapped File Access](https://awesome-repositories.com/f/data-databases/data-access-querying/memory-mapped-file-access.md) — Provides direct mapping of files into process memory for high-performance structured data access.
- [Zero-Copy Memory Mappings](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage-architectures/zero-copy-memory-mappings.md) — Maps byte buffers directly to memory addresses to enable data access without allocation or copying.
- [Polymorphic Binary Encodings](https://awesome-repositories.com/f/data-databases/data-type-managers/dynamic-type-managers/custom-type-serializers/polymorphic-binary-encodings.md) — Encodes and decodes Rust trait objects while maintaining their dynamic behavior in binary form.
- [Polymorphic Type Serializers](https://awesome-repositories.com/f/data-databases/data-type-managers/dynamic-type-managers/custom-type-serializers/polymorphic-type-serializers.md) — Encodes trait objects and polymorphic types using stable identifiers to maintain dynamic dispatch in binary form.
- [In-Place Layouts](https://awesome-repositories.com/f/data-databases/in-place-data-modifiers/in-place-layouts.md) — Provides a binary data layout that matches target types in memory for instant access.
- [Memory-Mapped Data Structures](https://awesome-repositories.com/f/data-databases/memory-mapped-data-structures.md) — Transforms data structures into memory-mapped formats optimized for cache locality and reduced overhead. ([source](https://cdn.jsdelivr.net/gh/rkyv/rkyv@main/README.md))
- [Offset-Based Addressing](https://awesome-repositories.com/f/data-databases/pointer-based-navigation/offset-based-addressing.md) — Uses relative offsets instead of absolute addresses to ensure data remains valid regardless of memory location.
- [Zero-Copy](https://awesome-repositories.com/f/data-databases/serialization-frameworks/zero-copy.md) — Offers a complete framework for mapping binary data directly to memory to eliminate encoding and decoding overhead.
- [Zero-Copy Data Access](https://awesome-repositories.com/f/data-databases/zero-copy-data-access.md) — Creates memory-mappable data archives that allow fields to be read directly from a buffer.
- [High-Performance Data Infrastructures](https://awesome-repositories.com/f/data-databases/high-performance-data-infrastructures.md) — Enables high-throughput storage and retrieval of large datasets by eliminating traditional deserialization costs.

### Software Engineering & Architecture

- [Polymorphic Data Encodings](https://awesome-repositories.com/f/software-engineering-architecture/polymorphic-data-encodings.md) — Represents variant types and trait objects within serialized memory-mapped structures using binary tagging.
- [Structure Padding](https://awesome-repositories.com/f/software-engineering-architecture/memory-alignment-utilities/structure-padding.md) — Implements structure padding to ensure data fields are aligned to hardware memory boundaries for optimal CPU access.
- [Trait-Based Serialization](https://awesome-repositories.com/f/software-engineering-architecture/trait-based-service-abstractions/trait-based-serialization.md) — Utilizes Rust traits to define the transformation of complex types into their archived binary counterparts.

### Operating Systems & Systems Programming

- [Direct Memory Access](https://awesome-repositories.com/f/operating-systems-systems-programming/direct-memory-access.md) — Connects archived data directly to memory addresses for access without allocating new structures. ([source](https://rkyv.github.io/rkyv))
- [Low-Latency State Persistence](https://awesome-repositories.com/f/operating-systems-systems-programming/low-latency-state-persistence.md) — Allows application state to be read instantly from disk without an expensive reconstruction phase.
