Bruce Dou
Bruce Dou

Reputation: 4761

Collection usage in BackboneJS

Which is better to use the collection:

  1. Collection contain the total list of data, and include a function to select the the part of data show in view. Lots of data should be loaded in client side.

  2. Collection only contain the data to show in view. In this way, require to fetch data from server more frequently. And the data to show in view is selected on server side.

Any suggestion?

Upvotes: 4

Views: 231

Answers (2)

hashwarp
hashwarp

Reputation: 3933

It depends on the size and sensitivity of the collection, but in general I preference proxying requests to the server-side, and storing only the view/cache data locally. It will serve better in the long-run.

Upvotes: 3

SET001
SET001

Reputation: 11718

If you have tonnes of data, best solution will be to load it on demand.

Upvotes: 0

Related Questions