Reflect on the oplog implementation #11842
Replies: 5 comments 4 replies
-
Really well put arguments with great references, thanks for sharing. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Just a quick update on redis-oplog. MCP has now taken ownership of it. |
Beta Was this translation helpful? Give feedback.
-
I experimented with the MongoDB Change Streams more and... I got some mixed feelings. For once, our history logging service I mentioned in the first post here scaled a lot and it just works, really. We are, however, in the process of moving it to Atlas Database Triggers, but only due to internal reasons. Now, let's get to the mixed feelings part. I created a script that creates a lot observers (10k without a query and 20k with one). At the same time, it's constantly flooding the database with events by doing single and batch
|
Beta Was this translation helpful? Give feedback.
-
Disclaimer 1: This is probably going to be a mix of a couple of feature requests under one "umbrella" discussion. I may need to split it later - we'll see how the discussion goes.
Disclaimer 2: I do use the real-time aspect of Meteor really hard in a couple of apps; definitely less in some other, where it's not business critical. I don't want this to be another round of "just don't use it" or "Meteor doesn't scale" (it does) kind of discussion.
The current implementation of the real-time part of the Meteor-Mongo integration is a great piece of software. If it wouldn't, probably most of the community wouldn't be here today. But as time goes and the app scale, we see that it's definitely not ideal.
That's where projects like
cultofcoders:redis-oplog
or any of the "publications replicated using methods" came in. (I'll skip the latter as they effectively change the way our code behaves, not only the "backend" of it.) And it's awesome! It helped many projects, including the ones I've worked on. Let's just pause for a minute on the fact that this forum post has stunning 626 (!) messages from 85 users. As of today, a couple of years later, it just works with the latest version of Meteor.Somehow in parallel (OK, nearly a year later), the discussion to replace oplog tailing with change streams has started. Back then I didn't care that much as none of the projects I worked on have had any problems with the current implementation. (Just to be clear - none of them have these problems today. We've had some hiccups, but it's all fine now.) Time has passed, some great comments were made 1, 2, 3, 4, and the discussion died naturally, as it turned out not to be so great (probably).
Now, in one of the projects, we actually do use both.
redis-oplog
is there to let us do things the "naive way" (at this point we're far from naive - every published field and reused cursor counts). As we do use bulk operations really heavily in the app (we have relatively many places where that's the only sensible way of not doing tens of updates at once), we would have to notify Redis ourselves. Luckily, the amazingoplogtoredis
does the job for us. It's run separately, effectively getting rid of all of the work we would have to do manually. (On top of that, the servers don't have to push anything to Redis.)As I think I've set up the picture, let's get to the actual feature request. Let's divide it into parts:
redis-oplog
or a similar solution. I'm aware of the forks out there (I still have to try this one butoplogtoredis
is a must for us; it may happen though), but I think that this piece of code is simply crucial for a big enough Meteor application with a decent amount of reactive publications in place.oplogtoredis
would be welcome as well.redis-oplog
-like solution would work? Like a sidecar service, watching change streams and publishing it somewhere (Redis is fine)? I'm just thinking out loud now.Having said that, there's one more thing. I don't need that personally (like most people), but it may be a huge selling point sooner than later:
or
oplogtoredis
in place, it may be possible. It'd get rid of one of the all-time Meteor limitations.Beta Was this translation helpful? Give feedback.
All reactions