I'm currently trying to add a second server for my website by dividing different services. One server takes care of the main part of my website, whereas the other one takes over my chat service.
However, sometimes the main server has to connect with the other server, preferably using only PHP files. This happens when a user changes their settings on the main server, for example, then the second server should be notified in the same moment (i.e. updating the database)
So for example when a user changes a setting on www.example.com/foo.php (Server 1), a request should be sent to www.sub.example.com/bar.php?setting=1&value=abc (Server 2), without showing the second request to the user. It should be made in the background, preferably even asynchronously to the user's request.
Does anyone know the best/easiest way to achieve this?