Chapter 12 – Instrumenting Database Calls
- The concept of a database change feed is similar to messaging, and we can apply the same approach we used in the previous chapter for it. The key question is how to propagate context and correlate operations that change the record and process the notification.
One solution would be to add a record identifier attribute and use it to find all the operations related to a specific record. When multiple operations concurrently modify the same record, it will generate multiple notifications and we won’t be able to map producer operations to notification processing with the record ID. There might be additional notification identifiers we can use, such as record ETags. But in general cases, correlating operations that modify data and ones that process corresponding notifications would mean we have to add a trace context to the record and modify it on every operation.
- The answer depends on how your tracing backend treats...