Open yashwanth2804 opened 6 years ago
Good question, @yashwanth2804.
Let's make sure to add an answer to the docs when someone provides one.
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.
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.
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.
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.
Moving to Field Manual to discuss further
does replicating bulk dbs resources and time consuming, anyway can we limit upto few records
thanks