NfNitLoop / feoblog

A distributed, cryptographically-verifiable blog / social network
Other
71 stars 4 forks source link

Store `Item` bytes in content-addressable store #93

Open NfNitLoop opened 1 year ago

NfNitLoop commented 1 year ago

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:

NfNitLoop commented 1 year ago

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?