3box / 3box-js

3Box JavaScript SDK: User identities, storage, messaging
MIT License
207 stars 65 forks source link

Result paging from space.private.all? #898

Closed cyphercider closed 3 years ago

cyphercider commented 3 years ago

Hi all,

Super excited about 3Box. For scaling spaces to a large number of documents, is there a way to:

  1. Search document by date modified?
  2. Page through results?

My basic plan is to keep search indexes sync'd locally in IndexedDB. I will keep a "date last sync'd" and when the app starts up, I would ideally get just the docs updated since the sync'd date and rebuild the indexes to enable local text search.

I hope this issue isn't a duplicate of an existing. I wasn't able to find a corresponding issue or discussion in Discord.

oed commented 3 years ago

Currently the way 3Box works (really OrbitDB which 3box uses under the hood) is that when you sync a DB you sync all of it's history. This means that all of the entires are loaded into memory. In this case paging would only be a syntactic sugar for developers and not actually load the DB entries partly.

Hope that clarifies things a bit!

cyphercider commented 3 years ago

Makes sense, thanks for the explanation!