-
Notifications
You must be signed in to change notification settings - Fork 28
Implement datastore-backed peerstore #28
Comments
Keeping it abstract for now, but wondering if using Badger or RocksDB directly wouldn't be of a big benefit here. They can handle TTL and the like on their own, and would enable the use of multiple column families with different sorts, if we desired. |
We really do want to be generic over the datastore. Personally, I'd just occasionally sweep the datastore. However, we can probably add some (optional) expiration functionality to the datastore interface if this becomes a performance issue. That is, define a new interface that provides |
@Stebalien Sounds good, why mentioned a similar desire! I'm wrapping up a relatively straightforward pure badger impl to benchmark off of, but will look into extending
EDIT: I do like the idea of the "upgrading" a naive type ExpiringDatastore interface {
Datastore
PutExpiring(...)
SetExpiration(...)
}
type Txn interface {
Datastore
Commit(...)
Rollback(...)
}
type TransactionalDatastore interface {
Datastore
NewTransaction(...) *Txn
} |
then could have something like MakeExpiringDatastore(ds.Datastore) ds.ExpiringDatastore |
@Stebalien Just mulling over this a bit... Is it reasonable to mix and match like so: // ds is both a TransactionalDatastore and a TTLDatastore
txn, ok := ds.NewTransaction().(TTLDatastore)
txn.PutExpiring(...)
txn.Commit() |
In theory. Unfortunately, we start beating our heads against the type system (and I can't blame go here because I don't know of any type systems that can handle this). Basically, we have:
And, unfortunately, every wrapper needs to implement and forward every extension Bah humbug... Back on topic, Using adapters here will actually be a bit interesting. Unlike our current adapters, these will need to store additional state. That means that if a user opens the datastore and doesn't view it through the adapter, bad things will happen. I'm not sure what the best solution is.
Yes, but that's really tricky. Depending on how TTLs are implemented, that could make every transaction conflict with every other transaction. (we should probably move this discussion to an issue in the go-datastore repo) |
Typeclasses and modules compose pretty cleanly 😛! Monad transformers exhibit that kind of extensionality pretty well! Type systems aside... moved the conversation to ipfs/go-datastore#87. |
@raulk, here are some guidelines for tomorrow! backgroundi've just recently merged a big change that introduces a version of the datastore that runs on take a look at badger to get a basic understanding of what the database is capable of. the transaction semantics are particularly important for us. likewise, check out the new datastore interfaces. your changes will all be made in the we'll start with these changes and then sync up when they're all done to talk about optimizations we can make and ways to improve the correctness of the address stream manager. goalsnote, these don't need to happen all at once!
|
Benchmark logs here for now: #31 |
To support the above goals and establish a comprehensive baseline for benchmarking, I am also proceeding with the following:
|
what are we thinking wrt the options struct? what kind of stuff would you like to be able to configure? |
@bigs Here it is: https://github.com/libp2p/go-libp2p-peerstore/pull/33/files#diff-2ab9c4c4a50a480d085b467584d97980R14 We need it –at least for now– to be able to benchmark different configurations, i.e. with/without ARCCache, and the performance degradation with peers with many multiaddrs. |
Everything on this ticket appears to be done, so closing. Reopen if it wasn't the case! |
perfect
…On Thu, Sep 20, 2018 at 06:33 Raúl Kripalani ***@***.***> wrote:
Closed #28 <#28>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANBWtfck9JbF5jQf6ftJyd1IhqOX6eOks5uc5ksgaJpZM4UZzD3>
.
|
Creating an issue so we can track progress/discuss here. There's an open PR (#10) that seems to have stalled/disappeared. I'll be taking inspiration from that and starting anew.
Right now i'm thinking all of the various
*Book
s will use the same datastore, potentially changing that in the future so that eachBook
might be able to use a different underlying store.Todos
(To be migrated to a PR onceup)
AddrBook
ImplementKeyBook
ImplementMetrics
Peerstore
meta methodsPeerstore
implThe text was updated successfully, but these errors were encountered: