Optimize sync and make it real-time #491
Labels
feature
New feature or request
proposal needed
indicates that no proposal yet exists
question
Further information is requested
Background/Context
During a sync
pull()
operation:MessagesGet
request is sent over the network to the remote DWN for everymessageCid
that needs to be sync'dMessagesGet
does NOT containencodedData
, then an additionalRecordsRead
must be sent over the network to fetch the data from the datastore, if anyDuring a sync
push()
operation:MessagesGet
request is sent to the local DWN for everymessageCid
that needs to be sync'dMessagesGet
does NOT containencodedData
, then an additionalRecordsRead
must be processed by the local DWN to fetch the data from the datastore, if anyAn obvious optimization we can and will pursue is to batch the first step such that all
messageCids
are included in a singleMessagesGet
request sent either to the local DWN or over the network to a remote DWN. This is a change to an application or SDK usingdwn-sdk-js
, so as such, will be implemented first in theweb5-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?The text was updated successfully, but these errors were encountered: