yorkie icon indicating copy to clipboard operation
yorkie copied to clipboard

Introduce repository method for only fetching SnapshotInfo's metadata

Open 4whomtbts opened this issue 1 year ago • 0 comments

What would you like to be added: Introduce new repository method which only fetching SnapshotInfo's metadata The SnapshotInfo's metadata that i'm suggesting contains fields except for 'Snapshot' field

Why is this needed: Snapshot field of SnapshotInfo would be a large field, As document getting bigger and bigger. large SnapShot field would require many Network bandwidth and I/O time

snapshots.go#storeSnapshot always fetch every field of snapshotInfo

https://github.com/yorkie-team/yorkie/blob/50d8722d50b2e2ab48cdc59d00b296042ddaf66b/server/packs/snapshots.go#L36-L38

But sadly, 'SnapShot' field of SnapshotInfo is necessary, only when a below conditions are satisfied.

https://github.com/yorkie-team/yorkie/blob/50d8722d50b2e2ab48cdc59d00b296042ddaf66b/server/packs/snapshots.go#L42-L47

To sum up, I want to suggest separating SnapShotInfo related repository into two parts. one is a method that fetching only metadata of SnapshotInfo another is a method that fetching only Snapshot field of SnapshotInfo

4whomtbts avatar Aug 07 '22 08:08 4whomtbts