Skip to content

Proposal: allow key and value to store per bucket #289

Open
@0x5487

Description

@0x5487

Scenario:
A bucket is just like a table in a database or a collection in MongoDB.
A system has 10 million more records (order) in DB. If we need to find all orders for a user. we probably need to iterate keys to get it. The Get function might be slower in this case.

Proposal:
allow specific a bucket when calling "Put" and "Get" functions. Each bucket has its own index.

func (db *DB) Put(bucket string, key []byte, value []byte) error
func (db *DB) Get(bucket string, key []byte) ([]byte, error)

Unfortunately, this proposal needs to change the record format in the WAL file.

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