Trying to figure if javascript and php is good enough for an idea I have, and if not, what language(s) I need.
A player clicks something which modifies the database, immediately the values from the database that were showing on the page are updated, no page refresh needed.
Another player who is currently viewing the same values on their page also needs to be instantly updated.
What is it best and will scale well? Database of ~10k players, several hundred logged in, ~50 columns if any of that matters.
And what about handling a "who pressed first" scenario? I don't really care if it is super accurate, just that it can pick one winner. I think this part is trivial, just want verification.
Didn't want to bog down with details, let me know if more is needed.
You can easily do all of that with Javascript to make an AJAX call to the back end PHP script to update the database. The who pressed first scenario is easy in that the first one to update the database wins. The only iffy part is updating all other players' pages.
Another player who is currently viewing the same values on their page also needs to be instantly updated.
Being stateless, the HTTP can't handle push notifications from server to client. The way this is typically handled in Javascript is to set a timeout and poll the server for updated values at a given interval. If things don't have to be instantaneous, this works well. If you want instant or near instant updates, then you would have to poll the server for updated information every second or every 500 ms or so. If you have lots of online users, this can be a bottleneck unless you beef up your web server and database server to handle all the poll requests.