|
1 | 1 | Modern applications often need to respond to database changes in real time. When a customer places an order, updates their profile, or when inventory levels change, downstream systems need notification. SQL Server and Azure SQL provide several mechanisms for capturing and streaming these changes, each with different characteristics for latency, throughput, and implementation complexity. |
2 | 2 |
|
3 | | -Data API Builder integrates with these change mechanisms through Azure Functions SQL trigger bindings and Azure Logic Apps connectors. Understanding when to use each approach helps you build responsive, event-driven architectures that react to data changes efficiently. |
| 3 | +Data API Builder integrates with these change mechanisms through Azure Functions SQL trigger bindings. Understanding when to use each approach helps you build responsive, event-driven architectures that react to data changes efficiently. |
4 | 4 |
|
5 | 5 | ## Understand change capture mechanisms |
6 | 6 |
|
@@ -115,26 +115,6 @@ Configure the connection string in your function app settings: |
115 | 115 | > [!IMPORTANT] |
116 | 116 | > The SQL trigger binding requires Change Tracking, not CDC. If you need CDC's historical capabilities alongside real-time triggers, enable both features on your tables. |
117 | 117 |
|
118 | | -## Implement Azure Logic Apps for workflow automation |
119 | | - |
120 | | -[Azure Logic Apps SQL connector](/azure/connectors/connectors-create-api-sqlazure?azure-portal=true) provides low-code automation for database change scenarios. Logic Apps excel at orchestrating multi-step workflows that involve external systems like email, Teams, or other APIs. |
121 | | - |
122 | | -Create a Logic App that triggers when rows are modified: |
123 | | - |
124 | | -1. Add the **When an item is modified** trigger |
125 | | -2. Configure the connection to your database |
126 | | -3. Select the table to monitor |
127 | | -4. Set the polling interval |
128 | | - |
129 | | -The trigger checks for changes at your specified interval and starts a workflow run for each modified row. Add subsequent actions to: |
130 | | - |
131 | | -- Send notification emails |
132 | | -- Post messages to Teams channels |
133 | | -- Call external APIs or webhooks |
134 | | -- Update other databases or systems |
135 | | - |
136 | | -Logic Apps handle retry logic and error handling automatically. For complex scenarios, use parallel branches to perform multiple actions simultaneously or conditional branches to route based on data values. |
137 | | - |
138 | 118 | ## Stream changes with Change Event Streaming |
139 | 119 |
|
140 | 120 | For high-throughput scenarios where polling latency is unacceptable, Change Event Streaming pushes changes directly to Azure Event Hubs. This approach eliminates polling delays and scales to millions of events per second. |
@@ -168,22 +148,20 @@ The Event Hubs message contains: |
168 | 148 |
|
169 | 149 | Selecting the appropriate change mechanism depends on your requirements: |
170 | 150 |
|
171 | | -**Use CDC when:** |
| 151 | +Use **CDC** when: |
| 152 | + |
172 | 153 | - You need complete before-and-after values |
173 | 154 | - Compliance requires historical change records |
174 | 155 | - Batch synchronization is acceptable |
175 | 156 |
|
176 | | -**Use Change Tracking with Functions when:** |
| 157 | +Use **change tracking** with Functions when: |
| 158 | + |
177 | 159 | - You need real-time response to changes |
178 | 160 | - You only need current values, not history |
179 | 161 | - You're building event-driven microservices |
180 | 162 |
|
181 | | -**Use Azure Logic Apps when:** |
182 | | -- Workflows involve multiple external systems |
183 | | -- Low-code development is preferred |
184 | | -- Polling latency of seconds to minutes is acceptable |
| 163 | +Use **change event streaming** when: |
185 | 164 |
|
186 | | -**Use Change Event Streaming when:** |
187 | 165 | - You need sub-second latency |
188 | 166 | - High transaction volumes require streaming |
189 | 167 | - You're building real-time analytics pipelines |
|
0 commit comments