Code is not open source but more than happy to look at anything you’re entertaining and can share specifics from my codebase if there is something useful to you there. to be honest, the way we’re storing data in our db is optimized to solve problems you may not run into. 100% agree with paul - your use case should drive your decision. Do you plan on querying the JSON in the db? If so it may make sense to store it as jsonb.
Thanks. Not planing to query that data, just need to be able to persist it through code deploys and then load it into memory again.
@oconn could you show me how you manage the web sockets and allocate a connection to a specific user/match? I’m reworking the networking code because I’m introducing authentication, login ect. Glad to have found someone who uses sockets as well ~
This is just the way we’re doing it - hope some of this helps; 1. There is an unauthenticated ws connection that gets upgraded upon authentication 2. On an upgrade connection event, a row is created in our DB that maintains the connection details for that user 3. When a game is created, references to all the users (who in turn have references to their current connection identifiers) are stored in the DB for that game 4. When an event occurs within that game that needs to be broadcasted to all the participants, it has access to all the connection-ids.
When it comes to managing the connection pools, we don’t do that. We rely on a 3rd party service for that.