Replit Database Updating
So I had this idea to use the replit database as a server. I'm wondering how often does the replit database update. For example, if I have two clients and one of the sets "server" to "hi" by
db["server"] = "hi"
and the other client has
if db["server"] == "hi": print("THEY SAID HI")
will it print "THEY SAID HI" if we run those two programs at pretty much the same time (well, the database "server" is updated to "hi" first)?
Have you managed to use the Replit database as a server? The following link https://docs.replit.com/hosting/deploying-http-servers describes how to make Replit host your database. There are many complaints about Replit as a host, but since I started using it, no problems have appeared.
The most vivid example is the database I bought from https://www.globaldatabase.com/data-enrichment, hosted by Replit for a year now.
The best way to guarantee this is working is to do something like this:
db["server"] = "hi" while not db["server"]: pass # ... still loading print(db["server"])
Using a database as a realtime server is probably the worst idea i've heard in a long time. Python captures the current instance of the database client side when you run the program, there is no connection to the server when running. Like for example, you can't edit your code when you're running, it's not gonna update during runtime.
Edit: To clarify, clients can edit the database but will have to run the program again before they see changes in the database.
Edit: I was proved wrong, see above comment.