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

Optimize sync and make it real-time #491

Open
frankhinek opened this issue Aug 29, 2023 · 1 comment
Open

Optimize sync and make it real-time #491

frankhinek opened this issue Aug 29, 2023 · 1 comment
Assignees
Labels
feature New feature or request proposal needed indicates that no proposal yet exists question Further information is requested

Comments

@frankhinek
Copy link
Contributor

frankhinek commented Aug 29, 2023

Background/Context

During a sync pull() operation:

  • a MessagesGet request is sent over the network to the remote DWN for every messageCid that needs to be sync'd
  • if the message returned by MessagesGet does NOT contain encodedData , then an additional RecordsRead must be sent over the network to fetch the data from the datastore, if any

During a sync push() operation:

  • a MessagesGet request is sent to the local DWN for every messageCid that needs to be sync'd
  • if the message returned by MessagesGet does NOT contain encodedData , then an additional RecordsRead must be processed by the local DWN to fetch the data from the datastore, if any

An obvious optimization we can and will pursue is to batch the first step such that all messageCids are included in a single MessagesGet request sent either to the local DWN or over the network to a remote DWN. This is a change to an application or SDK using dwn-sdk-js, so as such, will be implemented first in the web5-js SDK.

However, as currently implemented, there isn't a way to optimize the second step.

Question to Research and Propose Alternative Solutions

How might we modify MessagesGet (or add a new method) such that fewer over the network requests are needed to retrieve the message metadata and data payload for each message that is queued for sync?

@frankhinek frankhinek added question Further information is requested proposal needed indicates that no proposal yet exists labels Aug 29, 2023
@frankhinek frankhinek moved this to Backlog in Web5 Roadmap Aug 29, 2023
@csuwildcat
Copy link
Member

Can we just use/require HTTP/2 framed multiplexing for multiple file fetch?

@csuwildcat csuwildcat changed the title Can sync be optimized? Optimize sync and make it real-time May 29, 2024
@csuwildcat csuwildcat removed the status in Web5 Roadmap Jul 31, 2024
@thehenrytsai thehenrytsai added the feature New feature or request label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request proposal needed indicates that no proposal yet exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants