Apache OpenDAL™ is an Open Data Access Layer that enables seamless interaction with diverse storage services.
cargo add opendal
Each service is a feature flag. The in-memory service is always available; enable any other service with its services-* feature, e.g. features = ["services-s3"].
use opendal::services; use opendal::Operator; use opendal::Result; #[tokio::main] async fn main() -> Result<()> { // Configure a service, then build an operator from it. let op = Operator::new(services::Memory::default())?; // The same verbs work on every service. op.write("hello.txt", "Hello, World!").await?; let bytes = op.read("hello.txt").await?; let meta = op.stat("hello.txt").await?; op.delete("hello.txt").await?; println!("read {} bytes", meta.content_length()); Ok(()) }
To use a real backend, swap Memory for another service and configure it — the operations stay identical. See Getting started and Connecting to your storage.
OpenDAL talks to 50+ backends through one API. A selection by category:
| Type | Services |
|---|---|
| Standard Protocols | ftp, http, sftp, webdav |
| Object Storage | s3, gcs, azblob, oss, cos, obs, b2, vercel-blob, … |
| File Storage | fs, hdfs, azdls, azfile, webhdfs, ipfs, … |
| Consumer Cloud Storage | gdrive, onedrive, dropbox, aliyun-drive, koofr, … |
| Key-Value & Database | redis, etcd, tikv, rocksdb, sqlite, postgresql, mongodb, … |
| Cache | memcached, moka, mini-moka, ghac, vercel-artifacts |
See Services for the full list and each service's configuration keys.
Wrap an operator with layers to add retry, logging, timeout, metrics, and other cross-cutting behavior without touching your storage code. Retry, logging, timeout, and concurrency limit are built in:
use opendal::layers::RetryLayer; let op = op.layer(RetryLayer::new());
See Going to production and the layers module.
Check out the CONTRIBUTING guide for building, testing, and submitting changes to the core.
Check out the users list for more details on who is using OpenDAL.
The first and most prominent mentions must use the full form: Apache OpenDAL™ of the name for any individual usage (webpage, handout, slides, etc.) Depending on the context and writing style, you should use the full form of the name sufficiently often to ensure that readers clearly understand the association of both the OpenDAL project and the OpenDAL software product to the ASF as the parent organization.
For more details, see the Apache Product Name Usage Guide.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.