Is there an equivalent to web-sockets for web-apps in Realm/Atlas?

I often find myself needing to update a web-app’s UI and content, based on changes to the data on the cloud/server. For example, notifications, several users collaborating on the same data, users working with rapidly changing data, etc.

Sync appears to only work on mobile apps and I have read in a reply, here in community, that this will likely remain so.

So that said, I can’t seem to find any documentation that states how my above browser based use cases should/could be addressed in Realm or Atlas. I am not not going to keep repeatedly querying for such new data of course. It looks like I would need to create a web-socket server, outside Atlas, that could then have it’s own Realm-Sync local data store; feeding any updates to a “subscriber”.

Is this last assessment basically correct or am I missing some more standard way of doing this in this ecosystem? Thank you.

I am looking for the same thing as you. Here is the summary of what I have found so far (I am splitting my message into several posts because I am limited to 3 links and 1 attachment per message).

  • WebSockets is not the only solution to stream events to the browser. You also can use Server-sent events. Basically, it is an HTTP connection between the browser and the server being kept open to stream events.

  • The web SDK of Realm (which is provided by MongoDB) is using the Server-sent_events throughout the BAAS of MongoDB Atlas (Backend As A Service). See the tutorial here.

  • This MongoDB tutorial explains how to set up WebSocket by deploying your own backend code. Would it be possible to do it with BAAS? Would it be possible even without BAAS?

  • Would it be possible to stream using HTTP (Server-sent events) directly with the “Data API” / “HTTPS endpoints”?