I’m developing a third-party iOS client for OGS game observation (similar in spirit to Surround). Before releasing it on the App Store, I’d like to confirm that my architecture is acceptable and doesn’t place unreasonable load on your servers.
App name: GoLab / GoLab Lite (Registered as “GoLabWatch” on OGS OAuth2) App Store URL: Currently in App Store review (will share once approved)
Architecture
The relay server connects to OGS with one OGS account via WebSocket.
Multiple iOS clients connect to the relay via WebSocket.
The relay subscribes (game/connect) only to games that at least one user is currently watching, and disconnects (game/disconnect) when no one is watching.
Our safeguards to minimize server load
Caching: We cache gamedata in Redis to avoid unnecessary reconnects.
On-demand: We only subscribe when a user explicitly watches a game. If no one is watching, we disconnect immediately.
Throttling: We have logic to prevent duplicate game/connect requests for the same game within a short timeframe.
If this architecture is acceptable, I will proceed with the release. If you have any concerns or specific limits (e.g., max clients, max subscribed games) that you’d like me to respect, please let me know and I will adjust the design before releasing.
You are right that a direct connection is the standard approach. I actually plan to use direct OAuth connections for the upcoming “play” features since playing requires an account anyway.
For the observation feature, I honestly couldn’t think of any other way to allow users to watch live games immediately without creating an OGS account.
If there is a better standard way to achieve this, I am completely open to changing it. However, I also thought that multiplexing connections and caching gamedata on the relay would reduce the overall load on OGS compared to many direct connections.
Makes sense! Though I’m not convinced it’s necessary.
OGS allows you to observe games without logging in (try it in incognito mode!) so I believe it should be possible to do the same with a 3rd party client.
You’re probably right that this would decrease load on OGS, but OGS already expects the load of every user/observer connecting. I imagine the impact is not high compared to the existing users.
I have just finished a quick technical verification and successfully connected to OGS anonymously (using an empty JWT) and retrieved the gamelist and gamedata directly from the WebSocket without any API keys. The board rendering works perfectly.
To be completely honest, I was initially hesitant about whether it was acceptable for a third-party app to connect anonymously like this. That hesitation, combined with my desire to minimize the number of connections to OGS, is exactly why I ended up building the relay server.
But since you’ve confirmed that direct anonymous connections are perfectly fine and that OGS is designed to handle them, I will proceed with the direct connection approach. The relay server has been completely dropped.
I really appreciate your help in clearing this up and pointing me in the right direction. I will share the App Store link once it’s ready!