Skip to content

Directory Layer support for Swift bindings #18

@1amageek

Description

@1amageek

Background

I'm a strong believer in FoundationDB's potential and want to help this Swift bindings project succeed. One area where Swift currently lags behind other official bindings is the Directory Layer, which is available in Python, Java, and Go.

Why Directory Layer Matters

The Directory Layer provides critical functionality for production FoundationDB applications:

  1. Hierarchical namespace management: Human-readable paths mapping to binary prefixes
  2. Partition support: Isolated namespaces that significantly improve database performance
  3. Automatic prefix allocation: Prevents key conflicts in multi-tenant scenarios

The partition feature in particular is essential for database performance optimization, making this more than just a convenience feature.

Questions Before Implementation

Before proposing any implementation, I'd like to understand the project's direction:

1. Roadmap Alignment

Is Directory Layer support part of your development roadmap or milestones? I want to ensure this aligns with your priorities rather than duplicating ongoing work.

2. Design Guidance

I experimented with implementation approaches (closed PR #17 per @vishesh's feedback), and encountered design questions:

  • Subspace as struct vs class: I chose struct for value semantics, making DirectorySubspace a wrapper around Subspace
  • API design: Should we match Python/Java patterns exactly, or adapt to Swift idioms?
  • Integration points: How should Directory Layer integrate with the current Tuple/Subspace implementation?

If you have thoughts on the design direction, I'd love to understand them before investing time in implementation.

3. Internal Discussions

@vishesh mentioned pending internal discussions about the Tuple layer. Would these affect Directory Layer design? Should we wait for those conclusions first?

I'm excited about contributing to this project and want to do so in a way that's helpful rather than disruptive. Thank you for your guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions