field-manual icon indicating copy to clipboard operation
field-manual copied to clipboard

do client need to replicate whole gbs of db ?

Open yashwanth2804 opened this issue 5 years ago • 6 comments

does replicating bulk dbs resources and time consuming, anyway can we limit upto few records
thanks

yashwanth2804 avatar Jul 11 '18 10:07 yashwanth2804

Good question, @yashwanth2804.

Let's make sure to add an answer to the docs when someone provides one.

RichardLitt avatar Jul 11 '18 19:07 RichardLitt

I don't believe there is currently a way to limit replication. You may want to explore modeling your data differently (on orbit-db or even ipfs).

Generally speaking, when modeling data for OrbitDB you should strive to "partition" it where it makes sense - i.e. along access rights. As an example, in a twitter-like application, each user should have their own database instead of a global "tweets" database for everyone.

mistakia avatar Jul 16 '18 16:07 mistakia

thanks for the reply, I understood your explanation.say if i follow Justin X (random 🌟) on Twitter, where he makes tons of tweets a day.if i am gonna subscribe him after 2 yrs. As your mentioned pubsub model ,i subscribed for him so will i get megatons of tweets from his 1st twt. i may limit in ui but how can i limit in loading those tweets.

please correct me if i am off the topic or missing something.

yashwanth2804 avatar Jul 16 '18 17:07 yashwanth2804

If you have the tweets locally - you can limit how many entries are loaded by sending in an amount to db.load(amount):

const db = await orbitdb.feed("<justin's tweet OrbitDB address>")
await db.load(10)
// db now contains the 10 latest entries/tweets

If you don't have the data locally, I'm not sure there's a way to limit syncing to only the 10 latest entries.

mistakia avatar Jul 18 '18 17:07 mistakia

If you can't limit how many data you can replicate, it means that malicious peers could trick you to "follow" them, then just flood you with data. Which might be a huge problem in 99% of the use cases.

cristiano-belloni avatar Sep 10 '18 10:09 cristiano-belloni

Moving to Field Manual to discuss further

aphelionz avatar Sep 27 '19 16:09 aphelionz