I'm not looking for a coding level help, but on a higher level.
I have a database containing millions of status values, each associated with a unique id, among other things.
I want to monitor these unique ID's (up to about ~10k at a time) and check it's status in the database. If the status changes, then I want to send that change over a web socket to update a client. Say the ID is a long and the status is a String.
How is something like this normally done in the real world without causing problems in the database?
How can you efficiently query 10k id's from a few million efficiently?
Is it as straight forward as a service that periodically queries the db for updates?
What's the real world situation for something like this as part of a critical system?
I can limit the number of clients to 10 or 20, but Ideally I'd like a few hundred. And each of those web sockets should be able to query a different batch of id's.
I'm not looking for a complete solution, I just want to know where I need to look to read what I need to consider when building this. What's the most efficient way to query the db, how to decide data limits, common mistakes to watch out for, etc....