Skip to content

Key encoding for dbm-style databases #133

Closed

Description

@alimanfoo

There are a number of embedded key-value stores available, including the built-in dbm-style databases provided by the Python standard library, as well as BerkeleyDB and Kyoto Cabinet. These provide a MutableMapping interface but generally expect keys to be bytes objects not strings, and will return bytes objects when asked for an iterator over keys. Zarr uses text strings for keys currently, and so these key-value databases cannot be used directly with Zarr, however it would be nice and should be straighforward to provide some support.

There are two options. (1) Provide a MutableMapping wrapper class that performs key encoding/decoding (e.g., 'zarr.storage.KeyValueStore' or 'zarr.storage.DbmStore'). (2) Add a key_encoding option to the Array and Group classes, which would be None by default (preserving current behaviour to use text strings as keys) but if not None would be used to encode and decode keys outside of the store.

Activity

  1. added this to the v2.2 milestone on Feb 27, 2017
  2. changed the title [-]Key encoding[/-] [+]Key encoding for dbm-style databases[/+] on Feb 27, 2017
  3. alimanfoo commented on Feb 27, 2017

    @alimanfoo
    MemberAuthor

    I'm leaning towards (2) as it seems reasonable and avoids yet another layer of indirection for the user.

  4. jakirkham commented on Feb 27, 2017

    @jakirkham
    Member

    One thing to consider is whether this will open the door to handling a variety of different encodings.

    Also related, will the encoding information be stored somehow?

  5. alimanfoo commented on Feb 27, 2017

    @alimanfoo
    MemberAuthor
  6. removed this from the v2.2 milestone on Oct 31, 2017
  7. added this to the v2.2 milestone on Nov 16, 2017
  8. added
    enhancementNew features or improvements
    release notes doneAutomatically applied to PRs which have release notes.
    on Nov 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features or improvementsrelease notes doneAutomatically applied to PRs which have release notes.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions