6. #MDBlocal
INTRODUCING: CHANGE STREAMS
Allows you to watch all the changes against a given collection.
CHANGESTREAMSAPI
Event Notifications
● Application
● MongoDB Stitch
● Message Queue
7. #MDBlocal
CHANGE STREAMS: USE CASES
● Refreshing trading apps as
stock prices change
● Syncing changes across
microservices
● Updating dashboards,
analytics systems, search
engines
● IOT data pipelines - generating
alarms in response to connected
asset failures
● Push new credit card transaction
into Machine Learning models to
recalculate risk
● Maintaining multiplayer game
scoreboards.
22. #MDBlocal
DEFINING THE documentKey
The “_id” field of the document created or modified by
the operation.
● Replica Set : ‘_id’
● Sharded Cluster : ‘_id’ + ‘shard key’
44. #MDBlocal
1. If your application requires state:
Match on unchanging fields.
2. If your application needs to notify on deleted data:
Handle deletes and replaces appropriately.
3. If your application needs to see every change
(even outdated changes):
Have matching fields in the document key.
47. #MDBlocal
The secondaries replicate the primary’s
oplog and apply the operations to their
data sets such that the secondaries’ data
sets reflect the primary’s data set.
REPLICATION