oxigdal-cloud
Advanced cloud storage backends for OxiGDAL - 100% Pure Rust cloud integration with multi-cloud abstraction, intelligent caching, prefetching, and comprehensive retry logic for seamless geospatial data access.
Features
- Multi-Cloud Providers: AWS S3, Azure Blob Storage, Google Cloud Storage with unified API
- HTTP/HTTPS Backend: Enhanced HTTP/HTTPS support with authentication and retry mechanisms
- Unified Abstraction: Single API for accessing data across different cloud providers
- Advanced Caching: Multi-level cache with memory and disk tiers, LRU+LFU eviction, compression
- Intelligent Prefetching: Predictive prefetch with access pattern analysis and bandwidth management
- Robust Retry Logic: Exponential backoff with jitter, circuit breaker, and retry budgets
- Comprehensive Authentication: OAuth 2.0, service accounts, API keys, SAS tokens, IAM roles
- Performance Optimized: Zero-copy operations, efficient streaming, bandwidth throttling
- 100% Pure Rust: No C/Fortran dependencies, everything written in safe Rust
Installation
Add to your Cargo.toml:
[]
= { = "0.1", = ["s3", "cache", "retry"] }
Feature Flags
| Feature | Description | Dependencies |
|---|---|---|
s3 |
AWS S3 support | aws-sdk-s3 |
azure-blob |
Azure Blob Storage support | azure_storage, azure_identity |
gcs |
Google Cloud Storage support | google-cloud-storage |
http |
HTTP/HTTPS backend | reqwest |
cache |
Multi-level caching | lru, dashmap, flate2 |
prefetch |
Intelligent prefetching | cache + async |
retry |
Retry logic with backoff | async |
oauth2 |
OAuth 2.0 authentication | oauth2 |
async |
Async/await support | tokio, async-trait |
std |
Standard library support (default) | - |
Quick Start
AWS S3
use ;
async
Multi-Cloud Abstraction
use CloudBackend;
async
Supported URL formats:
s3://bucket/key- AWS S3az://account@container/blob- Azure Blob Storagegs://bucket/object- Google Cloud Storagehttp://example.com/pathorhttps://example.com/path- HTTP/HTTPS
Advanced Caching
use ;
use Bytes;
async
Intelligent Prefetching
use PrefetchConfig;
async
Retry Configuration
use ;
use Duration;
Usage
Basic Backend Operations
use ;
async
Azure Blob Storage
use ;
async
Google Cloud Storage
use ;
async
HTTP/HTTPS Backend
use ;
async
Error Handling
The crate follows the "no unwrap" policy. All operations return Result<T, CloudError>:
use ;
async
API Overview
Core Modules
| Module | Description |
|---|---|
backends |
Cloud storage backend implementations (S3, Azure, GCS, HTTP) |
auth |
Authentication providers (OAuth2, service accounts, API keys) |
cache |
Multi-level caching with memory and disk tiers |
prefetch |
Intelligent prefetching with pattern analysis |
retry |
Retry strategies with exponential backoff |
error |
Comprehensive error types |
Key Types
CloudBackend
Unified abstraction over multiple cloud providers:
CloudBackend::from_url()- Create from URL stringbackend.get()- Download objectbackend.put()- Upload objectbackend.exists()- Check object existence
CloudStorageBackend Trait
Implemented by all backend types:
get(key)- Retrieve objectput(key, data)- Store objectdelete(key)- Remove objectexists(key)- Check existencelist_prefix(prefix)- List objects
CacheConfig
Configure multi-level cache:
with_max_memory_size()- Memory tier sizewith_cache_dir()- Disk cache locationwith_compression_threshold()- Compression trigger size
RetryConfig
Configure retry behavior:
with_strategy()- Retry strategy (exponential backoff, etc.)with_max_retries()- Maximum retry attemptswith_jitter()- Jitter factor for backoff
Performance
Performance characteristics on modern hardware (AWS EC2 m7i.xlarge, 100 Mbps network):
| Operation | Time | Throughput |
|---|---|---|
| S3 GET (1 MB) | ~50ms | 20 MB/s |
| S3 PUT (1 MB) | ~60ms | 16.7 MB/s |
| Azure GET (1 MB) | ~55ms | 18.2 MB/s |
| Cache HIT (1 MB) | <1ms | >1 GB/s |
| Cache MISS (1 MB) | ~50ms | 20 MB/s |
With prefetching enabled:
- Sequential reads: 50-80% faster
- Random access: 20-40% improvement
- Cache hit rate: 60-85% typical
Examples
See the tests directory for integration test examples:
- S3 Backend: Basic creation and configuration
- Azure Backend: Container and account setup
- GCS Backend: Bucket and project configuration
- HTTP Backend: URL and authentication setup
- URL Parsing: Multi-cloud abstraction usage
Run tests with:
# All tests
# Specific feature tests
Documentation
Full documentation is available at docs.rs.
For OxiGDAL integration, see the main repository.
Error Handling
This library follows the "no unwrap" policy. All fallible operations return Result<T, E> with descriptive error types:
Security Considerations
- Credentials Management: Use environment variables or credential files rather than hardcoding
- HTTPS Only: HTTP backend strongly recommended for production over HTTPS
- SAS/Access Tokens: Azure SAS tokens and API keys should be stored securely
- IAM Roles: Prefer IAM roles over hardcoded credentials on cloud VMs
- Encryption: Data in transit uses TLS 1.3, at-rest encryption depends on cloud provider settings
Contributing
Contributions are welcome! Please ensure:
- No
unwrap()calls in production code - 100% Pure Rust (no C/Fortran dependencies)
- Comprehensive error handling
- Tests for new features
- Documentation with examples
License
This project is licensed under Apache-2.0.
Related Projects
- OxiGDAL - Geospatial data abstraction layer
- OxiBLAS - Pure Rust BLAS operations
- OxiFFT - Pure Rust FFT library
- SciRS2 - Scientific computing ecosystem
Part of the COOLJAPAN ecosystem - Pure Rust geospatial and scientific computing.