ZenFS is modular, designed to provide a flexible abstraction over multiple storage backends. It allows applications to interact with files and directories without needing to be aware of the underlying storage mechanism. Separating the file system logic into distinct layers ensures maintainability and extensibility, without a major impact on performance.
ZenFS is built upon three main components:
Main article: Virtual File System (VFS)
The Virtual File System (VFS) is responsible for emulating the node:fs
API, path resolution, and mounting different storage backends. It provides a unified interface that applications interact with, abstracting away differences between storage implementations. The VFS is responsible for:
node:fs
emulationMain article: Backends
Backends provide a modular way to configure and use various underlying storage implementations. They are the metaphorical glue between the VFS, configuration, and the internal API.
Main article: Internal API
The Internal API provides the core functionality of ZenFS. It serves as the foundation that both the VFS and backends rely on. The internal API is what backend implementations conform to, allowing the VFS to easily perform operations without knowledge of the underlying implementation.