15

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.

dreftymac
  • 31,404
  • 26
  • 119
  • 182
TomEverin
  • 415
  • 1
  • 5
  • 12
  • if you are looking for events which fire ,when some thing happens like table changes ,data insertion,you can use extended events – TheGameiswar Dec 06 '16 at 08:40

2 Answers2

11

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://learn.microsoft.com/en-us/azure/documentdb/documentdb-change-feed

Toby
  • 111
  • 4
8

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.

David Makogon
  • 69,407
  • 21
  • 141
  • 189