I am wanting to log a public chat to a database to be able to lookup chat history in the future. I am familiar with node.js and mongoDB.
I don't want to miss logging any chat messages, and so was looking for a redundant solution in case of network disconnect or server failure/restarts.
Everything I've seen regarding failover and balancing, is with the node app as a http server, and so can be solved with a reverse proxy sending the requests to the different servers.
But I'm at a loss as how to have 2+ VPSs in different regions, running a node app that monitors the same public chat and logs those chat entries to a DB without race conditions on the DB.
Messaging between the node instances? But it seems like there would also be race conditions with that...
Thanks for the help.