Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

feat: add last value caching #32

Closed
wants to merge 4 commits into from
Closed

feat: add last value caching #32

wants to merge 4 commits into from

Conversation

dignifiedquire
Copy link
Member

Experiment to improve message loading in orbit.

ipfs/team-mgmt#355

cc @haadcode

@dignifiedquire dignifiedquire added the status/in-progress In progress label Mar 5, 2017
src/index.js Outdated
* @type {Map<string, Buffer>}
* @private
*/
this._lvc = new Map()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using LRU cache, caches like that bitten as so many times in go-ipfs as things scaled up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah need to figure out what's the best caching strategy here. For now I just want to test if this actually solves our problems

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done @Kubuxu better safe than sorry :)

@daviddias
Copy link
Member

Note that this is a change in the spec. Good to try new things, but remember that this won't be present in go-ipfs unless it gets pushed to the spec and implemented in go-ipfs too. //cc @whyrusleeping

This last message cache is something super biased for Orbit. What we are looking for is a SACK (Selective Ack) strategy, so that new peers can NACK the last message.

@dignifiedquire
Copy link
Member Author

@diasdavid please see libp2p/research-pubsub#12 for discussion on this

This last message cache is something super biased for Orbit. What we are looking for is a SACK (Selective Ack) strategy, so that new peers can NACK the last message

could you explain how this would give us last message caching?

@dignifiedquire
Copy link
Member Author

Note that this is a change in the spec

yes, but the spec is not properly written down, which makes it hard to properly propose changes.

but remember that this won't be present in go-ipfs unless it gets pushed to the spec and implemented in go-ipfs too

That is fine. It looks like this works really well, so once we have an agreement on the spec we can move to implementing it in go as well.

@dignifiedquire
Copy link
Member Author

I also want to point out, that while I agree that spec updates are important, the whole floodsub story is still behind an experimental flag, with the goal to get something that works for the consumers of the api. This change is quite an important one, especially on the js side, as there is no ipns that could be used to do a similar thing. I also do not agree that it's fully tailored for Orbit. While that was the motivation it is a problem that many systems trying to propagate state through ipfs using pubsub will run into.

@daviddias daviddias added status/deferred Conscious decision to pause or backlog and removed status/in-progress In progress labels Mar 27, 2018
@daviddias daviddias closed this Jun 29, 2018
@daviddias daviddias deleted the feat/prev branch June 29, 2018 22:42
@ghost ghost removed the status/deferred Conscious decision to pause or backlog label Jun 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants