-
Notifications
You must be signed in to change notification settings - Fork 20
Scaling Sharded Database Mid Tier Routing
Mid-Tier routing services can be setup as a docker container by following the article Sharded database mid-tier routing services.
-
Download all the Mid-tier Routing docker stack configurations files from the following location.
-
Substitute the placeholders marked within angular brackets < > in all the docker files that expect parameters (For example : IP / port / db credentials etc..). Please refer the mid-tier routing services command usage and examples, on what to substitute for these placeholder parameter values.
Choose one of the caching modes for mid-tier routing swim lane cache :
- Local in-memory cache mode
In this mode, the cache is local and in-memory. So if the container goes down the swim lane details are lost. So the swim lane mappings needs to be established again.
This mode is recommended if the number of shards or the swim lane mappings aren't too large.
> docker-compose -f sdb-mtr-local-cache.yml up
- External REDIS cache mode
In this mode, the user is responsible here to start the REDIS instance and pass in the necessary parameters for the sdb mid-tier routing docker container. As the cache is external and running in its own container, even if the sdb-mtr container goes down, the swim lane mappings are not lost.
This mode is recommended if the number of shards or the swim lane mappings are large and you need or already using a distributed cache like REDIS.
> docker-compose -f sdb-mtr-redis.yml up
Note : To bring down the container started with docker-compose, use the down switch with the docker-compose command to gracefully bring down the services.
> docker swarm init
> docker stack deploy -c docker-compose.yml oracle-sdb-mtr
> docker stack rm oracle-sdb-mtr
> docker swarm leave --force
If there is a need to load balance SDB Mid-tier routing in Local in memory cache mode, then we can opt for swarm mode and specify the replication/scale factor for mid-tier routing container.
> docker stack deploy -c sdb-mtr-local-cache-swarm-mode.yml oracle-sdb-mtr
If there is a need to load balance SDB Mid-tier routing in Local in memory cache mode, then we can opt for swarm mode and specify the replication/scale factor for mid-tier routing container instance.
> docker stack deploy -c sdb-mtr-redis-swarm-mode.yml oracle-sdb-mtr