Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>If you need a server for processing the data:</strong></p> <p>I would definitely go with websockets at Compute Engine!</p> <p>The Channels API is much slower, and also quite unpredictable (latency differs from message to message)! Data has to go to the Channels server, which sends it to the App Engine instance, which has to do a request back to the Channels server, which will push the message to the client. There is too much going on there if you want to keep latency down!</p> <p>Here is a Channels API stress test:<br> <a href="http://channelapistresstest.appspot.com/" rel="noreferrer">http://channelapistresstest.appspot.com/</a><br> Try clicking "send 5"-button a lot, and you will see latency numbers going up to several seconds.</p> <p>The Channels API is also quite expensive under heavy load (it probably does not scale well, even if Google of course can solve that with more instances).</p> <p>When keeping latency down, geolocation is quite important. With a websocket server at Compute Engine, you can send your european visitors to google's european datacenter and your american visitors to the US datacenter (using the geo location headers that AppEngine will provide). You have no such control with the Channels API (or app engine, which all your messages are relayed through). Maybe Google has edge servers for the Channels API (I don't know), but if your AppEngine instance is on the other side of the planet, that does not matter.</p> <p><strong>If you do NOT need a server for processing the data:</strong></p> <p>You should establish a peer-to-peer connection with WebRTC, sending stuff directly between the users' browsers. That is was Cube Slam does. (WebRTC requires some initial handshaking ("signaling") so the two peers can find each other, and Channels API would work fine for that handshaking, that's just a couple of messages to establish the peer-to-peer connection.)</p> <p>WebRTC DataChannels API will give you a nice websocket-like interface like <code>channel.onmessage = function(e) { yadayada()... };</code> and <code>channel.send("yadayada");</code> to send your data between the peers.</p> <p>Occasionally, WebRTC is not able to make a peer-to-peer connection. Then it will fall back to a TURN server, which relays traffic between the peers. Cube Slam is using TURN servers running on ComputeEngine (in both Europe and America to keep latency down), but that is just the fallback when true peer-to-peer is not possible.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload