feoblog icon indicating copy to clipboard operation
feoblog copied to clipboard

Store `Item` bytes in content-addressable store

Open NfNitLoop opened this issue 3 years ago • 1 comments

When a user uploads an Item, its bytes are currently stored directly into the item table for easy access. But, that means that if multiple users sign and upload the same Item, it gets stored multiple times. And with #92 we'll already be storing some items into the store.

Instead, we should always store the item's bytes into the content-addressable store.

Implementation details to update:

  • Initial Item uploads store the bytes in store.
  • DB migration of old item bytes into store
  • Fix db usage and prune to account for items stored in this way. (i.e.: don't prune rows from store that have a corresponding item entry!)

NfNitLoop avatar Nov 20 '22 20:11 NfNitLoop

Additional things to consider:

For #92, we don't necessarily want to allow embedded items (or their attachments) to be served directly from a server at /u/:uid/i/:sig just because they've been "embedded". Do we need to have different places for storing an item that the server should serve vs. just a lookup of (uid, sig) to contentHash?

NfNitLoop avatar Nov 20 '22 20:11 NfNitLoop