Is there a big performance cost creating a lot of smart and reusable containers?

Is it a good practice to create all components as completely independent elements? or is it best to create the minimum amount of smart and reusable containers as possible to not add an unnecessary cost performance?

The question is how efficient are meteor subscriptions? Can i subscribe several containers to the same publication without a big performance cost?

Meteor will avoid sending the data multiple times, the main cost is one extra roundtrip where the client will ask the server if it has all of the data yet. So you don’t want to go overboard and have a subscription on every single component, but having several of them on one page isn’t a big deal.

So, having several containers subscriptions may delay the ready state in the app, and send unnecessary petitions to the server?

Would be a best practice to create a singleton for the model publication then?

The issue is that you have to make a call based on your app structure. The singleton approach has the downside that your app becomes more coupled together. So I’d strike some balance.

2 Likes