tree: f03ad44d6a08bc920f37526f902e6786fc2073c4
  1. benches/
  2. core/
  3. edge/
  4. examples/
  5. fuzz/
  6. http-transports/
  7. layers/
  8. services/
  9. src/
  10. testkit/
  11. tests/
  12. Cargo.lock
  13. Cargo.toml
  14. CONTRIBUTING.md
  15. DEPENDENCIES.md
  16. DEPENDENCIES.rust.tsv
  17. README.md
  18. users.md
core/README.md

Apache OpenDAL™ Rust Core: One Layer, All Storage.

Build Status Latest Version Crate Downloads chat

Apache OpenDAL™ is an Open Data Access Layer that enables seamless interaction with diverse storage services.

Useful Links

Installation

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"].

Quickstart

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.

Services

OpenDAL talks to 50+ backends through one API. A selection by category:

TypeServices
Standard Protocolsftp, http, sftp, webdav
Object Storages3, gcs, azblob, oss, cos, obs, b2, vercel-blob, …
File Storagefs, hdfs, azdls, azfile, webhdfs, ipfs, …
Consumer Cloud Storagegdrive, onedrive, dropbox, aliyun-drive, koofr, …
Key-Value & Databaseredis, etcd, tikv, rocksdb, sqlite, postgresql, mongodb, …
Cachememcached, moka, mini-moka, ghac, vercel-artifacts

See Services for the full list and each service's configuration keys.

Layers

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.

Contributing

Check out the CONTRIBUTING guide for building, testing, and submitting changes to the core.

Used by

Check out the users list for more details on who is using OpenDAL.

Branding

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.

License and Trademarks

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.