Real Time in the browser

Discussion in 'App Development' started by TradingPilot, Nov 19, 2015.

  1. Good evening!

    I'm trying to understand how real time data is streamed to the browser.
    Is it via websockets, HTTP poling, SSE? What are some good data providers?
    When I try to find information online I just find sample code with AJAX calls made in set intervals.
    I'm so confused in trying to understand the big picture. I'm assuming when a trade is made a server event is fired from the exchange, then my server is listening to it and fires another event where my front end will listen to it.

    Thanks in advance!
     
  2. 2rosy

    2rosy

  3. vicirek

    vicirek

    First of all real time quotes require paying exchange fees and filling some forms due to regulations. Usually you get them through your broker or firm that re-sells feed data.

    Your front end for receiving quotes (be it browser or other app) will not connect directly to the exchange unless you talking direct feed which costs a lot plus needs to meet strict requirements of the exchange.

    Anything that happens on the net is through raw sockets. The data protocol being used on top of that varies; it can http(s), Rest or web sockets for browsers. What you probably see in Ajax is push notification when the server updates pages from time to time with most recent information.

    For most users real time quotes are of historical value. The exchange is allowed some time before disseminating quotes, then it goes to aggregated feed (another computer another program) since we have a dozen of major exchanges; then it is forwarded to the brokers or companies specializing in market data and then hops though few internet nodes to you arriving with delay of course.

    Data dissemination through browser is inherently slower than through specialized front end and usually involves REST. This is not that would depend on you because specific protocol has to be offered by market data provider.

    I recently saw one company offering programmable REST but cannot not recall name now;
     
  4. Sig

    Sig

    Its always pushed, the overhead would be prohibitive with polling. JSON is a more recent format but AJAX is also used. Again, this would have to be asynchronous, so no calls at set intervals.