Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an Azure database equivalent to Firebase clients being able to listen for database changes?

Firebase's realtime database SDK has callback methods built in which allow the client to listen for database changes. (e.g. as per https://firebase.google.com/docs/database/android/start/)

Does Azure have any functionality like that in either the SQL Database or DocumentDB products? If not, why not? And what is the best way to achieve this functionality using Azure?

Thanks.

Edit context: I'm building a cross-platform mobile app using Xamarin.

like image 276
TomEverin Avatar asked Dec 06 '16 01:12

TomEverin


People also ask

Is Azure better than Firebase?

"Realtime backend made easy", "Fast and responsive" and "Easy setup" are the key factors why developers consider Firebase; whereas "Scales well and quite easy", "Can use . Net or open source tools" and "Startup friendly" are the primary reasons why Microsoft Azure is favored.

Which function is used for users to listen monitor for changes in the Firebase?

Set the event handler Functions let you handle Realtime Database events at two levels of specificity; you can listen for specifically for only creation, update, or deletion events, or you can listen for any change of any kind to a path.

Can we use MongoDB instead of Firebase?

If you're looking for a full back-end as a service (BEaaS) and the least possible effort, Firebase is ideal, but MongoDB (and specifically MongoDB Atlas) gives you the most powerful and flexible platform for application development, and the ability to support both transactional and warehouse-style workloads in the same ...

Which is best Firebase or Firestore?

Cloud Firestore is Firebase's newest database for mobile app development. It builds on the successes of the Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales further than the Realtime Database. Realtime Database is Firebase's original database.


2 Answers

Microsoft just announced a new feature in DocDb called Change Feed which sounds like what you are looking for. It is enabled by default and included in the cost of DocDb.

From their announcement: "With Change Feed support, DocumentDB provides a sorted list of documents within a DocumentDB collection in the order in which they were modified. This feed can be used to listen for modifications to data within the collection and perform actions..."

Documentation on how to work with the change feed can be found here: https://docs.microsoft.com/en-us/azure/documentdb/documentdb-change-feed

like image 112
Toby Avatar answered Oct 12 '22 12:10

Toby


Azure's SQL Database service now has Extended Events (currently in Preview). More info here.

DocumentDB does not have events you can subscribe to. You would need to build your own mechanism for taking action when modifying your database contents.

EDIT: Cosmos DB (formerly called DocumentDB, when this answer was originally posted) provides a change feed you can subscribe to.

As for "best way to achieve this functionality" - there is no best way. It's whatever you decide to build, based on your app, chosen frameworks, etc.

like image 34
David Makogon Avatar answered Oct 12 '22 11:10

David Makogon