Using MongoDB as a realtime database with change streams
▻https://hackernoon.com/using-mongodb-as-a-realtime-database-with-change-streams-213cba1dfc2a?so
This article was originally published on Pusher’s blog .Pusher, our weekly sponsor, makes communication and collaboration APIs that power apps all over the world, supported by easy to integrate SDKs for web, mobile, as well as most popular backend stacks. Get started.Getting data changes from a database in realtime is not as easy as you may think.In a previous tutorial, I mentioned there are three main approaches to do this:Poll the database every X seconds and determine if something has changed using a timestamp, version number or status field.Use database or application-level triggers to execute a piece of code when something changes.Use the database transaction/replication log, which records every change to the database.However, in MongoDB, change streams allows you to listen for changes (...)
#weekly-sponsor #mongodb-change-streams #javascript #realtime-database-mongodb #change-streams