locked
how to transmit database update from db to .net layer RRS feed

  • Question

  • Hi All,

    I was looking for a  approach in .net  so that if any update happens in database , that update has to be send to .net layer.

    THe code behind will be c# and front end will be ASP.NET MVC with razor or html. What I am looking mainly will be if any stock price changes database will get refreshed when the price changes and that changes has to be send immediately to the .net layer and it will be displayed on the screen

    Scenario : it will be for a stock price updates which will change every seconds in db and that has to be communicated to .net layer and should be displayed on a dashboard.

    Please let me know if anybody done anything like this or if you have web reference please share the link.

    thanks

    Monday, May 1, 2017 12:35 PM

All replies

  • I haven't heard of such feature in an RDBMS (although probably it might exist). There are two approaches that I have seen in this situation:

    1. You query the database every x milliseconds (e.g. 500) and send the information to the client (via e.g. SignalR). An alternative to this approach is to issue a request from the front-end to a service reading the DB every x milliseconds, so no push notifications are needed.
    2. You have access to the software updating the database. Then after each update you send a notification to the client (again via some push mechanism like SignalR)

    I think the first approach is quite common, since in most cases you don't own the DB and some third-party service is used. As far as I know, most of the stock/forex trading software use it.


    • Edited by quattuor Tuesday, May 2, 2017 6:41 AM
    Tuesday, May 2, 2017 6:41 AM
  • Web sockets is the correct technology here, but as quattuor has stated SignalR will provide an abstraction in case your browser doesn't support it. Some databases do have mechanisms to register actions based on changes to the underlying data, but it depends on what you're using.

    http://pauliom.com

    Monday, May 8, 2017 5:42 AM