Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
0x5487 opened this issue Oct 3, 2023 · 1 comment
Open

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

0x5487 opened this issue Oct 3, 2023 · 1 comment

Comments

@0x5487
Copy link

0x5487 commented Oct 3, 2023

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.

@roseduan
Copy link
Collaborator

roseduan commented Dec 9, 2023

I will consider this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants