Skip to content

Feature Request: Support DuckDB Virtual File System for Configuration and SQL Files #10

Closed

Description

@jrosskopf

Feature Request: Support DuckDB Virtual File System for Configuration and SQL Files

Is your feature request related to a problem? Please describe.
Currently, flapi reads configuration files, endpoint definitions, and SQL files exclusively from the local file system. This limits deployment flexibility in cloud-native and containerized environments where:

  1. Configuration should be centralized (e.g., in S3, GCS, or Azure Blob Storage)
  2. SQL templates might be managed in a shared repository accessible via HTTP(S)
  3. Teams want to update endpoint definitions without redeploying containers
  4. Multi-instance deployments need consistent configuration without shared volumes

The current local-filesystem-only approach creates operational friction when deploying flapi in modern infrastructure where "cattle, not pets" principles apply.

Describe the solution you'd like
I propose leveraging DuckDB's Virtual File System (VFS) abstraction to handle all file operations for configuration, endpoint definitions, and SQL files.

DuckDB already supports multiple file system backends out of the box:

  • S3 (s3://bucket/path/config.yaml)
  • GCS (gs://bucket/path/endpoints/)
  • Azure Blob (azure://container/path/)
  • HTTP(S) (https://config-server.example.com/flapi/endpoints/)
  • Local (current behavior, remains default)

Proposed Changes:

  1. Abstract all file read operations (and writes where supported) through DuckDB's FileSystem interface
  2. Support URI-style paths in the --config-path / --endpoints-path CLI arguments and configuration
  3. Add optional credentials configuration for cloud storage (or inherit from environment variables / instance profiles)
  4. Implement appropriate caching strategies for remote files (with configurable TTL for hot-reload scenarios)

Configuration Example:

# flapi.yaml
endpoints_path: "s3://my-company-configs/flapi/endpoints/"
sql_path: "s3://my-company-configs/flapi/sql/"
templates_path: "https://raw.githubusercontent.com/myorg/flapi-templates/main/"

Describe alternatives you've considered

  • Mounted Volumes (EFS, NFS): Works but adds infrastructure complexity, latency, and cost; doesn't leverage DuckDB's existing capabilities.
  • Init Containers / Sync Scripts: Copying files at startup works but loses the ability to hot-reload configuration changes.
  • Environment Variables / ConfigMaps: Suitable for small configs but impractical for managing multiple endpoint definitions and SQL templates.

Additional Context & Use Cases

  1. Centralized Configuration Management:
    DevOps teams can manage all flapi configurations in a single S3 bucket with versioning, avoiding configuration drift across instances:

    flapi --config s3://company-configs/flapi/production/
  2. GitOps Workflows:
    SQL templates and endpoint definitions can be served directly from a Git repository via raw HTTP URLs, enabling true GitOps:

    sql_path: "https://raw.githubusercontent.com/myorg/analytics-sql/main/queries/"
  3. Multi-Tenant / Multi-Environment Deployments:
    Different environments or tenants can point to different configuration paths without requiring separate container images or complex volume mounts.

  4. Serverless / Ephemeral Deployments:
    Functions-as-a-Service or short-lived containers can bootstrap configuration from remote storage without persistent local state.

Technical Feasibility
DuckDB's FileSystem abstraction is already mature and battle-tested. The httpfs extension (bundled) provides S3, GCS, Azure, and HTTP support. Since flapi already depends on DuckDB, this is primarily a matter of routing file operations through the existing DuckDB APIs rather than direct std::ifstream / POSIX calls. Write support would be limited to backends that support it (S3, local) while HTTP would be read-only—which aligns with typical configuration patterns.

Activity

  1. added
    enhancement
    on Jan 17, 2026
  2. changed the title [-]Support DuckDB Virtual File System for Configuration and SQL Files[/-] [+]Feature Request: Support DuckDB Virtual File System for Configuration and SQL Files[/+] on Jan 17, 2026
  3. self-assigned this
    on Jan 17, 2026
  4. added 3 commits that reference this issue on Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions