MongoDB real time query

I use MongoDB for some of my projects and it works great.

I heard about RethinkDB, and since I am developing a multiplayer online game, I think that if MongoDB pushes changes (let them say new lines) instead of pulling rows, it will be much faster both on the server side and on the client side.

Are there any wrapper or methods for real-time query in MongoDB or not?

+4
source share
1 answer

You can use tailable cursors in private collections . At the lowest level, to do this, you first need to write all the changes to a closed collection, and then apply them to any worker (event search template). This is a major change in the application architecture, so this is probably not what you want.

A more general approach is to observe oplog , a special limited collection that is used to synchronize primary and secondary nodes and contains all the operations performed on documents, so changing the architecture of the application is not required.

, , , RethinkDB, , diff. , , , , , Oplog - , , Meteor, / , , , RethinkDB.

+2

All Articles