0

Until now I didn't find anything good about monitoring a DB's specific table (or related tables) specific values changed. I want to know:

Since most of DB's don't support monitoring changes for specific rows/values/columns, how to link them together? (I mean I don't want to use something like Timer or loop to check whether a specific row's value is changed and notify my client……).

So is it necessary for us to make another new technology that will support "notifications to the client application" about which is changed in my DB? Or is there anything that has made this come true?

  • 4
    nearly all DBs support insert or update triggers on tables. – gbjbaanb Apr 6 '16 at 9:56
  • Might want to check out RethinkDB, i think that's what you are looking for. Realtime updates from the database itself – Borjante Apr 6 '16 at 10:12
  • @gbjbaanb: I see, but how to catch the changes and notify my client side? – xqMogvKW Apr 9 '16 at 13:35
2

Most databases use one-way request-response approach: the client contacts the server and (eventually) expects an answer in return. This, essentially, prevents the server from notifying a client about anything; techniques such as polling, exist, but have their own drawbacks (such as the heavy load on server and network).

On the other hand, you seem to expect a two-ways communication; RethinkDB, already quoted in a comment, is one example of a database which supports this, so it may be a solution for the problem you are trying to solve.

Another solution would be to simply track the changes within your own application, at data access layer. Depending on the language/framework you use, this could be more or less easy to implement, as well as to use technologies such as WebSockets in order to propagate the changes down to the end users.

Finally, if you need to track changes to a table which is used across multiple applications, you may create a web service which will have exclusive rights to modify this table, and make all other applications call this service instead of querying the database directly. On change, the service may use a message queue service to broadcast the message indicating that the data was changed.

  • What do you mean by "track the changes"? You know that I don't know when the values are changed, so how to "track"? – xqMogvKW Apr 9 '16 at 13:33
  • @CA55CE37: why don't you know when the values are changed? As explained in the answer, if the database is accessed by multiple applications, so one cannot necessarily know when another one changes the data, using a common web service and a message queue would do the trick. – Arseni Mourzenko Apr 9 '16 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.