HTTP Post vs. DDP Method vs. Subscription

I started off using the meteor way of using subscriptions for many one off small requests and then query the single record on a collection/subscription. Then I thought I could simplify this and moved going away from Pub/Sub to just using a method to request a small piece of data. The more of these method calls I stacked the worse my performance got when it hit a method that had database calculations. I know methods run in order and I think only one at a time vs. many concurrently is my real issue. I came across the package simple:rest. Browsers support many http threads and I won’t be limited to a single thread using methods. This is for non reactive data.

What I am wondering is for performance what do most people use? The data is a small calculation that is for an un-authenticated user.

If I migrate away from methods to http POST requests can I get more threads and better performance?

Did you know you can relax in-order processing with this.unblock()?


https://medium.com/@pmuens/meteor-defer-and-this-unblock-e610c8426065

Besides, I recommend to only use subscriptions if you actually need reactivity. Otherwise, using methods should be the best option, as they are more lightweight than REST calls. The only upside of REST is that it is fire and forget, i.e. it doesn’t require the server to maintain a DDP connection. But if your client uses the Meteor stack, you will most likely have a DDP connection anyways.

I only use REST endpoints for clients that don’t need a DDP connection. One of our clients is a Unity-based (augmented reality) mobile app. Unity itself communicates with Meteor via DDP, but we also use a native background service which polls the server via REST.

I did check and I have this in all my methods at the top. What I am seeing is this delay in rendering atleast 5-10 seconds. I think I just have to much rendering on the page at one time. I think I might do some tabs to hide the charts and render when the tab is selected vs. render everything on page load. Maybe I’m just trying to render to much at page load.