Hello everyone, sorry if this question may seem off-topic, but I need some guidance to understand what the best practice is for a web app I’m developing with Django, Uvicorn, and Redis. In my web app, each user can:
- request a series of machine data that I provide through an API call to a third-party server that has a database
- enable a WebSocket connection with the machine they want in order to allow real-time information exchange (both incoming and outgoing to the machine)
The points I’m uncertain about are as follows:
- Since multiple users can request the same data from the third-party database, I thought of creating a local copy of that database to minimize the API calls (as they are also limited). The issue is that the database is really huge, so it’s not feasible unless I allocate a lot of space and resources to keep the system in sync. What’s the best approach here?
- To allow the client to communicate with the machine via WebSocket, I need to go through the Django server (as there’s also a unique access key for each user) because the communication must be maintained even when the client is closed. Do I need to establish a WebSocket connection for each user?
What are the best practices to make such a solution scalable over time? It’s important, however, that the WebSocket communication latency is as low as possible.
Any thoughts or suggestions?
Thank you