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

PseudoKV #67

Open
MeijeSibbel opened this issue Jun 5, 2020 · 8 comments
Open

PseudoKV #67

MeijeSibbel opened this issue Jun 5, 2020 · 8 comments

Comments

@MeijeSibbel
Copy link

Moving this here-->The metafile format was designed to store ordinary user files, and PseudoFS was designed to represent an ordinary filesystem. Neither of them will work optimally with an S3 bucket architecture. It sounds like we should investigate creating something like a "PseudoS3" that is better geared towards key-value storage.

@lukechampine
Copy link
Owner

To make this slightly more concrete, I was thinking along the lines of:

type PseudoS3 struct { ... }

func (PseudoS3) CreateBucket(name string) (*PseudoBucket, error)
func (PseudoS3) Bucket(name string) (*PseudoBucket, error)

type PseudoBucket struct { ... }

func (PseudoBucket) Put(key, val []byte) error
func (PseudoBucket) Get(key []byte) ([]byte, error)
func (PseudoBucket) Delete(key []byte) error
func (PseudoBucket) Sync() error

The main goal would be to aggregate Puts across the entire PseudoS3 instance, such that data is only flushed to hosts when a full sector's-worth of key-vals have been stored. However, I'm not familiar enough with S3 to flesh out a full API, and I don't have a good idea of what the local storage aspect would look like.

@jkawamoto
Copy link
Contributor

I think it also needs List function, too.

@jkawamoto
Copy link
Contributor

I think it'd be better to call this interface PseudoKVS instead of PseudoS3 because S3 API has more functionalities such as versioning and ACL. Using S3 sounds confusing.

@jkawamoto
Copy link
Contributor

It also would be better if the type of val is io.Reader in both Put and Get instead of []byte. If it uses byte slices, we need to copy each object to heap, and thus we might not be able to store bigger objects.

@MeijeSibbel
Copy link
Author

PseudoKV has been integrated, moving new roadmap features to #126 for consistency.

@jkawamoto
Copy link
Contributor

I think PseudoKV isn't done yet.

There are still some missing functions:

// DeleteBlob implements MetaDB.
func (db *BoltMetaDB) DeleteBlob(key []byte) error {
return db.bdb.Update(func(tx *bolt.Tx) error {
// TODO: refcounts
return tx.Bucket(bucketBlobs).Delete(key)
})
}

func (db *BoltMetaDB) UnreferencedSectors() (map[hostdb.HostPublicKey][]crypto.Hash, error) {
return nil, nil // TODO
}

Also kv branch is not merged into master.

@MeijeSibbel MeijeSibbel reopened this Sep 9, 2020
@MeijeSibbel
Copy link
Author

Thanks, reopened. I see this is also related to #102 correct?

@jkawamoto
Copy link
Contributor

Yes, it is. Especially, this problem #102 (comment).

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

3 participants