Hello @satya,
I congratulate you on your successful use of PostgreSQL with Meteor. Although I donāt use PostgreSQL myself, I have much respect for it and take an interest in projects that combine it with Meteor.
I am the defacto maintainer of the Meteor MySQL integration (vlasky:mysql). Instead of using the Mongo oplog, the Meteor MySQL integration implements reactive queries and publications using the MySQL binary log as the event source, in a manner compatible with Mongo on the client side.
I strongly disagree with parts of your article disparaging the use of reactive publications and subscriptions in Meteor. I have quoted them at the end.
As I write this post, customers across Australia are tracking their food and alcohol deliveries in real-time using Meteor webapps developed by my businesses that leverage reactive MySQL publications to update maps and tables with order status updates as well exchanging instant messages between drivers and dispatchers.
We have found using publications to be more efficient and performant than having the client needlessly poll the server. They greatly reduce latency and the amount of data sent over the wire.
So why are some people having difficulty scaling Meteor apps that use publications?
1. Meteorās reactive Mongo driver is missing a critical throttling feature - a minimum interval between successive query result set fetches.
Publications are most often used to update a UI component on the client side. If a collection is receiving many updates per second, it is pointless and wasteful to push data to the client for each one.
Instead, what if you could specify a minimum interval of say 1 second between updates? This would greatly reduce bandwidth use as well as CPU/IO overhead on the client and server.
This key performance-enabling feature has long been present in the Meteor MySQL integration and I have urged for it to be implemented in Meteorās Mongo driver and also in redis-oplog.
2. Out of the box, Meteorās server-side merge box stores a copy of the collection data for each user who subscribes to the publication.
As long as your server has enough RAM and your Node.js process is configured to use it by passing the --max-old-space-size
argument on the node command line, you should not get into trouble.
Development efforts are already underway to provide finer control over the behaviour of the mergebox that I expect to alleviate this problem for good.
PR#11368 - Support for publication strategies in livedata server
PR#11151 - Initial support for publication strategies in livedata server
This is a technology that was very cool when Meteor launched, and it has its uses. But itās also the main bottleneck for Meteorās performance. It adds load to the server, and to the database. And honestly, real-time can be solved in many ways these days.
As a rule of thumb: donāt use Meteorās publications, they will always cause you headaches. Simply use websockets (or Meteorās DDP) to inform the client of changes, and then have the client fetch data by API.
Donāt use Meteorās publications, itās useless by default due to performance implications and will always cause you headaches.
In other words, Meteor must stay tightly coupled to Mongo, because of its real-time publications offering. But that technology is quite useless by default due to its performance implications, and therefor should not be used.