Scaling Local Storage with JuiceFS and Object Storage

Better Stackgo watch the original →

JuiceFS creates a POSIX-compliant file system by separating metadata (stored in Redis) from data chunks (stored in S3), using a local NVMe cache to achieve hardware-line-speed performance on subsequent reads.

Architecture and Setup

JuiceFS functions as a transparent abstraction layer that decouples metadata from raw data. It stores file system structures, permissions, and directory layouts in a database like Redis, while offloading raw data chunks to cloud object storage. To initialize the system, users run juicefs format with a Redis connection string and S3 credentials. Mounting the file system requires a local directory and, on macOS, the installation of MacFUSE to provide the necessary kernel hooks. The system allows for configurable cache management, such as the --free-space-ratio flag, which prevents the local cache disk from exceeding a specified capacity by purging the least-accessed blocks.

Performance and Caching

JuiceFS utilizes a multi-tiered caching engine that stores data chunks on local NVMe or SSD drives. During a cold read, the system fetches data over the network from the S3 bucket. On subsequent reads, the system serves the data directly from the local cache at hardware line speeds, bypassing network latency. This approach enables legacy applications, containerized environments, and machine learning pipelines to interact with cloud storage as if it were a local POSIX-compliant volume without requiring code modifications.

Observability and Monitoring

Every JuiceFS mount exposes a Prometheus-compatible metrics endpoint. To monitor performance, users can expose this local port via a secure tunnel using ngrok. By setting the ngrok-skip-browser-warning header to true, users can allow external services like Better Stack to scrape the metrics securely. This telemetry allows for real-time tracking of cache hit rates, read durations, and S3 request errors, which can be visualized through automated dashboards.

  • #dev-tooling
  • #storage
  • #cloud-infrastructure

summary by google/gemini-3.1-flash-lite. probably wrong about something. check the source.