How treeverse/lakefs works
Main Components
• Data Versioning Engine (Core lakeFS Server): Represent the main lakeFS application that exposes the HTTP API. This includes:
– API layer (served by packages under “pkg/api”).
– Catalog and metadata handling (see “pkg/catalog”, “pkg/graveler” and “pkg/metastore”).
– Object storage interaction modules (under “pkg/block”, “pkg/kv” for adapter integrations with S3, Azure, GCP, etc.).
– Authentication/authorization services (modules in “pkg/auth”, “pkg/authentication”, “pkg/auth/oidc”, etc.)
• Underlying Storage Services: Indicate external object storage backends (S3-compatible, Azure, GCP) along with a metadata store. These are abstracted by lakeFS so that it can “version” data without needing to duplicate files.
• Clients & SDKs:
– Multiple client packages (Java, Python, Rust, Spark, etc., available under “clients” + their language-specific bindings) that interface with the lakeFS API.
– Command-line tools (lakectl and others under “cmd/”) that call the lakeFS API.
• Web UI: The “webui” directory holds the frontend resources that allow users to interact with lakeFS via a browser. This UI connects to the API layer.
• Hooks & Extensions: Customizable hooks implemented in Lua and other languages (see “pkg/actions”, “examples/hooks”) allow users to enforce data quality tests, governance, and Git-like workflows.
• Distributed & Operational Subsystems:
– Components for distributed coordination, retention, garbage collection (“pkg/distributed”, “pkg/graveler/retention”, “pkg/graveler/hooks_handler.go”) and integrations with ETL pipelines.
Relationships and Data Flows
– Incoming API and CLI calls from web UI, CLI tools, and SDK clients.
– Communication with back-end storage adapters which mediate operations on object stores.
– Internal coordination between the catalog/graveler components and the metadata store.
– Hook invocation: illustrate how pre- and post-commit hooks (configured via the lakeFS actions framework – e.g., Lua scripts under “pkg/actions/lua”, “examples/hooks”) are triggered on events.
• How the authentication service validates requests (e.g., through JWT, basic auth, or external OIDC providers) that are part of the API processing pipeline.
• Deployment boundaries to capture how the system can be deployed on-premises or in the cloud. Containers and orchestration details (Dockerfile, deployments directories) might be noted for operational context.
Architectural Patterns and Technologies
• Microservices/Modularity: lakeFS uses a modular design through separate packages for API, authentication, catalog, storage abstraction, and client SDKs.
• Abstraction & Adapter Pattern: Show how lakeFS abstracts the underlying object storage using various “adapters” (located in pkg/block/* and pkg/kv/*) so that the same operations can apply to S3, Azure, GCP, or local file systems.
• Git-like Versioning: Emphasize the branching, commit, rollback, and merge functionalities similar to Git, which are core to its design.
• API-Driven Architecture: The clear separation of front-end (web UI/CLI/SDK) and back-end (lakeFS API server) components supports RESTful, client–server interactions.