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

14,688

Solution 1

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.

Solution 2

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

Share:
14,688

Related videos on Youtube

TomEverin
Author by

TomEverin

Updated on June 09, 2020

Comments

  • TomEverin
    TomEverin about 4 years

    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.