Skip to content

Support server-side key filtering in Object Store #322

@StrashkoMaksim

Description

@StrashkoMaksim

Proposed change

Modify the _metaSubject method to encode each segment of the object name separately, similar to the implementation in Key-Value stores. Additionally, consider introducing custom codecs and filtering capabilities for object keys, allowing more flexible server-side filtering using patterns like prefix.*.suffix.>.

Use case

Currently, Object Store does not support server-side filtering by key during operations like listing or watching. The _metaSubject method encodes the entire object name in base64, which prevents effective filtering using standard NATS patterns. For a specific project, I implemented a patch that encodes each segment of the object name separately. This approach resolves the filtering issue and aligns with the behavior seen in KV stores.

The proposed changes would improve the usability of Object Store in scenarios requiring advanced filtering and reduce the need for client-side workarounds. Additionally, custom codecs could provide developers with greater flexibility in encoding and filtering strategies tailored to their use cases.

Questions:

  1. What was the reasoning behind encoding the entire object name as opposed to segment-by-segment encoding?
  2. Are there plans to add support for custom codecs and filtering in Object Store, similar to KV?

Contribution

Yes, I'm interested

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