Menu

Language Bindings

Relevant source files

OpenDAL provides native bindings for multiple programming languages, enabling developers to use the unified data access layer from their preferred programming environment. The language bindings maintain API consistency across languages while providing idiomatic interfaces that feel natural to each language's ecosystem.

For information about the core OpenDAL architecture that these bindings expose, see Core Architecture. For details about individual language-specific implementations, see the respective subsections: Python Binding, Java Binding, NodeJS Binding, C Binding, and Other Language Bindings.

Binding Architecture Overview

OpenDAL employs two primary integration strategies for language bindings: direct Rust integration for select languages and a C-based approach for broader language compatibility.

Sources: bindings/python/Cargo.toml168-169 bindings/java/Cargo.toml153 bindings/nodejs/Cargo.toml155-159 bindings/c/README.md97-99 bindings/go/README.md6

Service Feature Support

All language bindings share a common service feature architecture, with variations based on platform compatibility and binding maturity.

Service CategoryDefault FeaturesExtended FeaturesPlatform Restrictions
Cloud Storageservices-s3, services-azblob, services-gcs, services-cosservices-obs, services-oss, services-swiftNone
File Systemsservices-fs, services-webdav, services-webhdfsservices-hdfs, services-sftpUnix only for SFTP
Key-Valueservices-memoryservices-redis, services-memcached, services-sledVaries by binding
DatabasesNone (default)services-postgresql, services-mysql, services-sqliteFeature-dependent

Sources: bindings/python/Cargo.toml31-46 bindings/java/Cargo.toml34-49 bindings/nodejs/Cargo.toml30-45

Direct Rust Integration Bindings

Integration Technology Patterns

Sources: bindings/python/Cargo.toml168 bindings/java/Cargo.toml153 bindings/nodejs/Cargo.toml155-159

The direct integration bindings use language-specific FFI technologies:

  • Python: Uses pyo3 crate for seamless Rust-Python integration, supporting both synchronous and asynchronous operations
  • Java: Employs JNI (Java Native Interface) with jni crate, providing async-first APIs through AsyncOperator
  • NodeJS: Leverages N-API through napi and napi-derive crates for native addon development

C Binding Foundation

The C binding serves as the stable ABI foundation for most language bindings, providing a consistent interface that can be consumed by various language FFI systems.

Sources: bindings/c/README.md11-51 bindings/c/README.md97-99

C-based Language Binding Implementations

Most language bindings follow a common pattern of wrapping the C library:

  • Go: Uses libffi with purego for CGO-free integration, providing native Go interfaces without C compilation requirements
  • C++: Provides modern C++ wrapper classes around the C API with RAII memory management
  • Haskell: Uses Haskell's FFI to bind C functions, providing monadic operation interfaces
  • Ruby: Implements Ruby extension using native C extension APIs
  • Others: Lua, PHP, Swift, OCaml, .NET, and Zig bindings follow similar C wrapper patterns

Sources: bindings/go/README.md6 bindings/cpp/README.md11-21 bindings/haskell/README.md11-24 bindings/ruby/README.md5

Build and Distribution Patterns

Cargo Configuration Patterns

Each direct Rust binding follows consistent Cargo configuration patterns:

Sources: bindings/python/Cargo.toml154-156 bindings/java/Cargo.toml29-31 bindings/nodejs/Cargo.toml149-151

Platform and Service Compatibility

Different bindings have varying levels of service support based on platform constraints and implementation maturity:

  • Platform Dependencies: Unix-specific services like services-sftp are conditionally enabled
  • Protocol Dependencies: Services requiring protoc (like services-etcd, services-tikv) are often disabled in bindings
  • Library Dependencies: Services requiring external libraries (like services-foundationdb, services-rocksdb) may be excluded
  • Build Complexity: Some bindings prioritize ease of distribution over comprehensive service support

Sources: bindings/python/Cargo.toml172-180 bindings/java/Cargo.toml163-168 bindings/nodejs/Cargo.toml55-80