In short, docker exec is used to operate an already-running container, while docker run -it starts a new container interactively.
When you ran docker run -it --network foo --rm redis redis-cli -h rd you created a 2nd container, this time using the redis-cli image, which was used to query your running redis container.
Were you to repeat the steps you took, ...
Yes, it's absolutely reasonable and this is how real apps work. This is the microservice approach which allows to independently scale instances of a service and a DB.
What you have to do is to run your Flask and Redis services in a way so the first one can achieve the second one. If they are on the same machine, you just have to open Redis port used by your ...
By default Docker uses the bridge network.
On a default Docker installation you can simply map a port to the container's service port. The Redis Docker image exposes its service on port 6379 so you can do:
$ docker run --name rd -d -p 6379:6379 redis:latest
From your host you can now run use the redis-cli utility:
Redis Cluster could be considered as an OOTB solution for the Scalability requirements. There is another interesting open source library known as Redis Shard for sharding implementations on Redis. Please find the GitHub repository here.
You don't mention orchestration, are you planning to implement all by your own configuration on top of Ubuntu?
I recommend you that take a look at Kubernetes and StatefulSet workloads
You can use Ubuntu as your host to accomplish your needs, but in my experience, you can only need to ...
Fortunately, the situation has improved and the problem no longer exists.
Terraform supports in-place updates of the number of shards now. To quote from the updated documentation:
num_node_groups Specify the number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other ...