Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feeds: arbitrary payload instead of arbitrary data structure #1311

Closed
nugaon opened this issue Feb 22, 2021 · 11 comments
Closed

Feeds: arbitrary payload instead of arbitrary data structure #1311

nugaon opened this issue Feb 22, 2021 · 11 comments
Labels

Comments

@nugaon
Copy link
Member

nugaon commented Feb 22, 2021

User story

Story

As I noticed, the payload of Feeds is an arbitrary data structure currently with only the time of the upload and the reference of a Content Addressed Chunk.
I think it is completely a waste of available chunk payload (in case of passing unencrypted reference, it uses 40 bytes from <4096 bytes).
Secondly, what if I want to add to this update more than one reference of swarm content? Or I want to attach metadata as well? This rigid data structure does not let me do that.
Seems neccessary to make a decision on a more flexible data structure first.
My suggestion is to use BSON instead of this current one, which could be ideal for our use-case (bee-js).

Acceptance criteria

On feed update it is possible to pass arbitrary data that is retrievable later.
It could make place for other specific use-cases as well, like dynamic content references in dApp environment (e.g. HTML link references, etc.) and other later.
The interface of this payload thereby has to be in generic type, but you still could protocolize for specific use-cases, like this before mentioned one.

Background

This approach proposal came up on the feed interface PR of bee-js.

@bee-runner bee-runner bot added the issue label Feb 22, 2021
@Eknir
Copy link
Contributor

Eknir commented Mar 1, 2021

What do you believe are the practical use cases of using BSON type of encoding for feeds instead of the current way of doing things?

@nugaon
Copy link
Member Author

nugaon commented Mar 16, 2021

Hey!
The point is it can open many unconsidered doors which are handled within application layer.
Let's suppose I only would like to open the referenced chunk if the metadata in the feed chunk meets with my requirements (e.g. if it describes the linked content is in format avi with length 1 hour 38 minutes, I don't want to even fetch it, because the theoritical application only supports mkv under 5 minutes).
Also there can be a use-case if I want to reference hashes of two independent content (e.g. one provides a Map DB, the other provides the client side to illustrate it visually.) where the two content connect together but not neccesary I want to download/use one side of it (e.g. I just want to download the DB part for my application that can interpret).

So I can go on, the goal of this approach is decrease the number of unneccessary requests while utilize anyhow the remaining unused data of the feed chunk.

@Eknir
Copy link
Contributor

Eknir commented Apr 15, 2021

I believe this is a good suggestion, but I see it as a nice to have. A higher priority for the dev team is hardening Bee.

@acud acud added pinned and removed pinned labels Sep 9, 2021
@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@nugaon
Copy link
Member Author

nugaon commented Jan 27, 2022

related PR that aims at JSON serialisation in Feeds and also points out the current error message that prevents to support this behaviour in application layer: fairDataSociety/swarm-feeds#2

@acud
Copy link
Member

acud commented Jan 27, 2022

@nugaon feeds in their current form enforce a strict data structure, because that's part of the definition of feeds as a construct. If you want to change the data structure it will not be a feed, but something else. I hope this answers the underlying concern. In theory you don't need to use feeds if they don't fit your purpose, but build some other type of construct that uses soc as the underlying chunk type in order to provide certain guarantees. As we all know, feeds can be entirely implemented outside of bee, so why not do things in the way that suits you best?

@nugaon
Copy link
Member Author

nugaon commented Jan 28, 2022

@acud you are right about its logic can be implemented outside of the Bee.
Nonetheless, if the Bee cannot interpret these extended payloads as feeds - when these are inteded to only extend the default feed capabilities - then one won't able to fetch feed reference on the BZZ path and it won't be supported by other tools as well that use feed endpoint to fetch feeds.
Although, the latter can be sorted out by integrating and replacing the feed endpoint usage with the application layer implementation, the application layer feed lookups cannot perform as well as if it happened on the Bee side; e.g. the browsers have really tight limitation for concurrent requests towards one server (Bee), thereby slows down the lookup time.

@ameer-clara
Copy link

Legacy feed swarm implementation had no restriction on the payload. Was there a reason to make it of Reference type? Would love to find out when this feature could be part of bee-js?

@github-actions
Copy link

github-actions bot commented Apr 3, 2022

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@nugaon
Copy link
Member Author

nugaon commented Apr 5, 2022

.

@nugaon
Copy link
Member Author

nugaon commented Sep 19, 2024

closed by #4677

@nugaon nugaon closed this as completed Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants