How can we improve Azure Cosmos DB?

Make triggers automatic

Right now, triggers are not automatic meaning that they must be specified on each database operation where you want them to be triggered. This means that there is no way to ensure that business rules and other constraints are maintained. I have resorted to telling other developers never to hit the database directly but instead use the set of sprocs established to maintain constraints. It seems to work for us because we're small, but I can imagine that in a larger development team, someone will hit the database directly bypassing your sprocs and risk violating your desired constraints.

Triggers provide the best path for ensuring constraints.

This could be implemented as an optional flag on the trigger entity so it's not backward breaking.

Yes, I know that there are performance risks with making triggers automatic, but I think we should have a option to tradeoff some performance and take some performance risk in exchange for having a reliable way to enforce constraints.

86 votes
Vote
Sign in
(thinking…)
Sign in with: oidc
Signed in as (Sign out)
You have left! (?) (thinking…)
Larry Maccherone shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

After reviewing this again we have decided to move this to declined as we would not implement this capability.

The correct means to implement this type of behavior is to use Change Feed. Change feed is to used to build event-driven scenarios and is best suited to handle this. Most customers looking for this capability are all using change feed to do it.

For more information on change feed please see, https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed

Thank you for your suggestion.

0 comments

Sign in
(thinking…)
Sign in with: oidc
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base