Cache Docker Deployment Scenarios
NCache provides Enterprise edition Docker Images for Windows and Linux. Using these images, you can create and run your containers that act as NCache servers. Client applications can be connected to these containers under various conditions or scenarios. Each scenario may require a different configuration and setup on your end, depending on the operating system of your containers and host. These scenarios are discussed below:
- Client App and Servers are Containerized on the Same Machine.
- Client App is on Host and Servers are Containerized on the Same Machine.
- Client App and Servers are Containerized on Different Machines.
- Client App is on Different Machine and Servers are Containerized on Same Machine.
1. Client App and Servers are Containerized on the Same Machine
In this scenario, your client application and servers are present inside Docker containers, and all of these containers are running on the same machine. The operating system of your containers and your host may vary or be the same, but you won't have to make any extra configurations in this case.
2. Client App is on Host and Servers are Containerized on the Same Machine
In this scenario, your client application is present on the host, and servers are containerized on the same machine. Here you might have to make some configurations when the operating system of your containers and your host varies. The following are container-host operating system scenarios where you might have to make some changes to connect your servers with your client application:
Windows Docker Containers on a Windows Host
In this scenario, your containers and host are Windows based. You will not have to make any extra changes to your configuration or setup to connect your client application with your servers.
Linux Docker Containers on a Windows Host
In this scenario, your containers are linux based and host is Windows. When linux based containers are hosted on a non-linux host (Windows/macOS), Docker doesn't expose its internal network to the host network. Hence, to make your containerized app accessible on the host machine or host network, you have to expose the container's ports to the host through -p switch of Docker create/run command. To cater to this scenario, NCache provides the Port Forwarding feature. Using this, client apps will be able to connect with cache servers.
Linux Containers on a Linux Host
In this scenario, your containers and host are Linux based. You will not have to make any extra changes to your configuration or setup to connect your client application with your servers.
Linux Containers on a macOS Host
In this scenario, your containers are linux based and host is macOs. The rest of the process is same as linux-containers-on-a-windows-host, where the Docker itself does not expose its internal network to the host network, necessitating the use of the -p switch in Docker's create/run command to expose the container's ports to the host. NCache addresses this requirement by offering port forwarding functionality.
3. Client App and Servers are Containerized on Different Machines
In this scenario, your client application and your servers are containerized on different machines. Your containers will not be able to communicate with each other directly in this scenario. So, to ensure their communication with each other, use Kubernetes or Docker Swarm for all container-host operating system scenarios.
4. Client App is on Different Machine and Servers are Containerized on Same Machine
In this scenario, your client application is either containerized or present on the host on a different machine, and your servers are containerized on the same machine. If the client application is present on the host on a different machine, Docker internal network ports will not be exposed to the host machine. So, make use of Port Forwarding for all container-host operating system scenarios.
If the client application is containerized on a different machine, refer to Client App and Servers are Containerized on Different Machines.
See Also
Port Forwarding NCache Docker on Windows NCache Docker on Linux