Using Docker for Fast and Easy Testing of MaxScale

Using Docker for Fast and Easy Testing of MaxScaleRecently, I asked Colt Engine to help us with the MaxScale Beta Testing process. They agreed to do this, but they had to find the best way to test a new environment, with MaxScale on top and with as little impact as possible on their datacenter. The traditional approach would be to create as many virtual machines as needed and configure them for the designed test environment. This is a valid approach, but it requires some time to setup and the unnecessary use of resources. Instead, they decided to use an “Application Container”; they decided to use Docker.

Docker is an open platform that allows building, shipping, and running distributed applications in a fast and effective way. Docker enables applications to be assembled quickly from components. It also allows you to share easily Docker images inside a group or externally through packages (i.e., Docker files). Processes within Docker run in an isolated environment and without the need to create a virtual machine.

Docker allows creating, running and destroying application containers in a very fast and easy way. To make it even easier, you can find many “pre-cooked” containers in the community. The Docker Engine container is comprised of just the application and its dependencies. It runs as an isolated process in a user space on the host operating system, and shares the kernel with other containers. Thus, it enjoys the resource isolation and allocation benefits of virtual machines, but it’s much more portable and efficient.

Figure - Virtual BoxFigure - Docker

For beta testing, Colt Engine used three different containers: MaxScale Beta, MariaDB 10.0 and MySQL 5.1.

MySQL 5.1 is one of the reasons why Colt Engine agreed to test MaxScale: several “old” Joomla! plugins could not be updated easily to newer versions. They still use MySQL deprecated statements. Without the use of MaxScale and due to these limitations, all of the MySQL servers must be MySQL 5.1.

The test environment was in the end based on four containers:

  • a MySQL 5.1 container to backup Joomla! 1.5.x installations;
  • a MariaDB 10.0 container set as master;
  • a MariaDB 10.0 container set as slave of the master; and
  • a MaxScale container that is able to reach all of the databases.

Andrea Sosso, one of the engineers at Colt Engine who ran the beta tests, deployed a Docker image to run a MaxScale server. If you want to try both Docker and Maxscale, you can find them here: https://registry.hub.docker.com/u/asosso/maxscale/

Thanks to Docker and container technology, it has been extremely easy to set up a test environment that’s lightweight, safe, and easy to deploy. And it was done without the extra load that a set of virtual machines normally would have introduced. As an added value, a container made it easy to reproduce and share application environments anywhere. This can allow a group to share efforts and resources when testing on different servers, but in identical environments.

In one of my future blogs, I’ll explain in more detail the MaxScale use case that Colt Engine tested with this set of containers.