TBD54566975 / dwn-sdk-js

Decentralized Web Node (DWN) Reference implementation
https://identity.foundation/decentralized-web-node/spec/
Apache License 2.0
325 stars 96 forks source link

Optimize sync and make it real-time #491

Open frankhinek opened 1 year ago

frankhinek commented 1 year ago

Background/Context

During a sync pull() operation:

During a sync push() operation:

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?

csuwildcat commented 1 year ago

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