Skip to content

Implement Pluggable Storage Backends #18

@oasaph

Description

@oasaph

Description

Add support for loading flags from various sources beyond HTTP endpoints, making the library more versatile for different deployment scenarios.

Goals

  • Support multiple storage backends
  • Allow easy addition of new backends
  • Maintain consistent API across backends

Proposed Storage Backends

  1. File System (JSON, YAML)
  2. Environment Variables
  3. Redis
  4. Database (SQLite, PostgreSQL)
  5. etcd/Consul

Example Interface

class FlagStorage(ABC):
    @abstractmethod
    async def load_flags(self) -> dict:
        pass
    
    @abstractmethod
    async def save_flags(self, flags: dict) -> None:
        pass

flaggle = Flaggle(storage=FileSystemStorage("flags.json"))

Acceptance Criteria

  • Abstract storage interface
  • At least 2 storage implementations
  • Documentation for each backend
  • Migration guide for existing users

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions