New Library To Watch The Oplog

41 views
Skip to first unread message

Brandon Mason

unread,
Mar 6, 2013, 4:02:43 AM3/6/13
to node-mong...@googlegroups.com
Hey, I just published a new library which watches the oplog for changes:


This was based on some code from the 'realtime' project by Christian, and I was wondering if I could get some feedback on how I'm creating the cursor:


Do you see any issues with the way I'm going about this?  Any improvements that could be made?  Per comments by Kristina, it seems like it would be handy to enable the OplogReplay flag [halfway down the page]:


I added the flag to my connection code, but grepping the node-mongodb-native code didn't show any mention of this flag, so I'm curious whether its getting passed through.  There was no discernible performance difference in my tests, but I haven't done a true load test as of yet.

Thanks for any feedback!

Brandon

Aaron Heckmann

unread,
Mar 6, 2013, 11:07:04 AM3/6/13
to node-mong...@googlegroups.com
Looks pretty cool. I don't have any feedback on OplogReplay but I thought it was an internal flag for some reason.



Brandon

--
You received this message because you are subscribed to the Google Groups "node-mongodb-native" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-mongodb-na...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Aaron


Brandon Mason

unread,
Mar 11, 2013, 2:15:12 AM3/11/13
to node-mong...@googlegroups.com
Oh thanks.

Yeah, their docs state that it is internal.  Kristina was telling me that my use case here would benefit from it, but I don't think it's exposed through node-mongodb-native.  Which makes sense - the mongo docs specifically say that driver implementors should not expose it.

What I'm doing here might make more sense to handle at a driver level... I'm not sure.  This will be the basis for a library I'm writing to sync the mongo state to the web browser.  If other people find the oplog approach handy for that, it could implications for hosted DB solutions.  My suggestion for hosting platforms would be to give everyone a personal oplog.  You can do this by creating a capped collection under their access, and copying only events specific to their collections into their oplog.

Will be interesting to see if things go this way.  I'm not sure how Meteor or Firebase are doing it, but I'd prefer a solution which is DB agnostic and open source.
To unsubscribe from this group and stop receiving emails from it, send an email to node-mongodb-native+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages