Meteor, MongoDB, oplog tailing and you
Prior art
- Pub sub
- Live data sets
- Poll and diff
What's wrong with poll and diff?
- More writes, more polls
- Mongo bandwidth
- Large record sets
- Latency
What is oplog?
- MongoDB replica set
- A capped collection
- A rolling record of all operations that modify data
What is oplog tailing?
- Follow along and find out about changes immediately
- Let the database tell us when things have changed
What does an entry look like?
{
"ts" : Timestamp(1396897233, 1),
"h" : NumberLong(-8686789604923146223),
"v" : 2,
"op" : "i",
"ns" : "bookstore.users",
"o" : {
"password" : "$2a$10$ZK5uFJ8T4Z.TMbvafMIpauYQf0CrGN2DXbJrgVlbFlOgDHnTjWTw6",
"email" : "test@example.org",
"name" : "Test User",
"settings" : {
"fontSize" : 160,
"colourScheme" : "standard"
},
"books" : [],
"canAccessKeystone" : false,
"joinDate" : ISODate("2014-04-07T19:00:33.371Z"),
"_id" : ObjectId("5342f5d15d28ce2802021770"),
"__v" : 0
}
}
What does it mean?
- Less computation
- Reduced db bandwidth
- More connected clients
- Profit?
More info
Nice! Great Summary!