Assuming I have my application set up such that I have a NodeJS server running on some remote machine, and I have my database running on another remote machine. Assuming that I want to set up a Redis server for caching, wouldn't hosting the Redis server on another separate machine from my NodeJS server add unnecessary overhead?
From my understanding, Redis is extremely fast because it is an in-memory database. But if the Redis server is on another machine from my NodeJS server, I would have to make a network request from my NodeJS server to the Redis server, and if it is a cache miss, I would have to make another network request to my database server (which is a total of 2 network requests). Wouldn't it be faster to just do without the Redis server caching, since I would be assured that only 1 network request is made to the database server? What is the typical way of setting up the Redis server in a production environment?