fusio is a library that provides random read and sequential write traits to operate on multiple storage backends (e.g., local disk, Amazon S3) across various asynchronous runtimes—both poll-based (tokio) and completion-based (tokio-uring, monoio). The main goals are:
- lean: binary size is at least 14× smaller than other alternatives.
- minimal-cost abstraction: compared to bare storage backends, trait definitions allow dispatching file operations without extra overhead.
- extensibility: exposes traits to support implementing storage backends as third-party crates.
fusiois now at preview version, please join our community to attend its development and semantics / behaviors discussion.
While developing Tonbo (an embedded database ideal for data-intensive application), we needed a flexible and efficient way to handle file and file system operations across multiple storage backends—such as memory, local disk, and remote object storage. We also required compatibility with various asynchronous runtimes, including both completion-based runtimes and event loops in languages like Python and JavaScript.
fusio addresses these needs by providing:
- traits that allow dispatch of file and file system operations to multiple storage backends.
- different async runtimes, not only disk but also network I/O.
- compact form: ideal for embedded libs like Tonbo.
- extensibility via third-party crates, enabling custom asynchronous file and file system implementations.
For more context, please check this request to arrow-rs apache/arrow-rs#6051 that presents the motivation behind fusio.
fusio = { version = "*", features = ["tokio"] }fusio supports switching the async runtime at compile time. Middleware libraries can build runtime-agnostic implementations, allowing the top-level application to choose the runtime.
fusio provides two sets of traits:
Read/Write/Seek/Fsare not object-safe.DynRead/DynWrite/DynSeek/DynFsare object-safe.
You can freely transmute between them.
fusio has an optional Fs trait (use default-features = false to disable it). It dispatches common file system operations (open, remove, list, etc.) to specific storage backends (local disk, Amazon S3).
fusio has optional Amazon S3 support (enable it with features = ["tokio-http", "aws"]); the behavior of S3 operations and credentials does not depend on tokio.
Opening an object with OpenOptions::write(true).truncate(false) now keeps the request fully server-side: fusio starts a multipart upload, uses UploadPartCopy to splice the existing object into the new upload, and preserves all metadata/SSE headers from the original object. New bytes are buffered while the copy finishes and then streamed as additional parts. Downstream consumers such as lotus can remove their reopen-or-404 append workarounds once they depend on this release.
When you need a combination of: flexibility, abstraction on different storage backends without a performance penalty and a small binary. Overall, fusio carefully selects a subset of semantics and behaviors from multiple storage backends and async runtimes to ensure native performance in most scenarios. For example, fusio adopts a completion-based API (inspired by monoio) so that file operations on tokio and tokio-uring have the same performance as they would without fusio.
object_store is locked to tokio and also depends on bytes. fusio uses IoBuf / IoBufMut to allow &[u8] and Vec<u8> to avoid potential runtime costs. If you do not need to consider other async runtimes, try object_store; as the official implementation, it integrates well with Apache Arrow and Parquet.
fusio does not aim to be a full data access layer like opendal. fusio keeps features lean, and you are able to enable features and their dependencies one by one. The default binary size of fusio is 16KB, which is smaller than opendal (439KB). If you need a full ecosystem of DAL (tracing, logging, metrics, retry, etc.), try opendal.
Also, compared with opendal::Operator, fusio exposes core traits and allows them to be implemented in third-party crates.
- abstractions
- file operations
- (partial) file system operations
- storage backend implementations
- disk
- tokio
- tokio-uring
- monoio
- network
- HTTP client trait
- network storage runtime support
- tokio (over reqwest)
- monoio (over monoio-http-client)
- tokio-uring (over hyper-tls)
- Amazon S3
- Azure Blob Storage
- Cloudflare R2
- in-memory
- disk
- conditional operations
- extensions
- parquet support
- object_store support
monoio: all core traits—buffer, read, and write—are highly inspired by it.futures: its design of abstractions and organization of several crates (core, util, etc.) to avoid coupling have influencedfusio's design.opendal: Compile-time poll-based/completion-based runtime switching inspiresfusio.object_store:fusioadopts S3 credential and path behaviors from it.
- Unreleased: native S3 append path now relies on multipart
UploadPartCopy, preserving existing metadata and SSE headers. This allows downstream clients (e.g.,lotus) to delete their manual append/404 recovery code once they upgrade to this version.