I’m working with Meteor for some months now and have to admit that I still don’t feel that I am really good at dealing with publication/subscription, collection management, latency compensation and all that related stuff.
When I started, I was quite amazed by the possibilties offered by Minimongo and client-side, latency-compensated collection updates. But as soon as I removed the autopublish and insecure packages, things got more complicated, of course.
Then I added template-level subscriptions to the picture, had to deal with referential relationships between several collections, had to care for security and data privacy, and also had to take into account that my app is mainly running on mobile devices, so the network / DDP connection is rather unreliable. And I also read that relying on allow/deny rules tends to get quite complicated / insecure if your application grows.
In the end, I noticed that I more and more switched to the “traditional mode” of client-server calls, i.e. I created server-side methods for nearly every data-base update and waited for the results on the client side. Which I think is not really optimal from the user-experience point of view, but it often was the “easiest” way to get all these requirements fulfilled.
Still, I am looking for ways to improve my code, so I am looking for “real-world” samples / best practices that go beyond beginner scenarios (I’ve read a lot of these beginner tutorials on latency compensation, pub/sub and all of that stuff, but then struggled to apply these principles to my more complex scenarios).
How are you guys dealing with these things?