This document provides an overview of Docker sandboxes for MariaDB. It discusses Docker and how it performs operating system-level virtualization through containers. It then describes MariaDB's supported Docker images for its products like MariaDB Server, MaxScale, Columnstore, and X3 Platform. The document outlines the MariaDB Server sandbox and MariaDB Analytics sandbox, including prerequisites and how to run them. It provides a hands-on demonstration of pulling the code from GitHub and running the sandboxes locally using Docker Compose or Minikube.
3. DOCKER
Docker performs operating-system-level virtualization
also known as "containerization".
Makes it easier to create, deploy, and run applications by using containers.
It allows a developer to package up an application with all of the parts it
needs.
4. DOCKER
In a way it is very similar to the a virtual machine.
But there are key differences.
5. VM vs. DOCKER
App 1 App 2 App 3
Bins/Libs Bins/Libs Bins/Libs
Guest OS Guest OS Guest OS
Hypervisor
Host Operating System
Infrastructure
Docker Engine
Operating System
Infrastructure
App 1 App 2 App 3
Bins/Libs Bins/Libs Bins/Libs
6. DOCKER
The main benefits of containerization.
● Portable deployment of applications as a single file;
● Supports for automatic container builds;
● Public registry for sharing containers;
● Built-in version tracking;
● Reusable components;
7. DOCKER COMPOSE
Docker Compose is a tool for defining and running multi-container
Docker applications on a single host.
With Compose, you can:
● Use a single file to configure your application's services.
● Use a single command, to create and start all the services from your
configuration.
8. MARIADB DOCKER CONTAINERS
There are many platforms for containerization like RKT, LXD, OpenVZ and
others.
For MariaDB we chose docker because it is:
● Mature
● Open
● Popular
10. MARIADB DOCKER CONTAINERS
MariaDB X3 Platform in a Box
Single container: mariadb/x3inabox
Combines all of the elements of MariaDB platform into a single container.
Easy configuration
Does not require manual setup of the various components.
Creates the whole setup with a single docker command.
12. MARIA SANDBOXES
● Provide an easy way to get your familiar with the MariaDB
● Provide tools and data to get you start with Relational Databases,
SQL, Analytics and ML;
13. MARIA SANDBOXES
● Server Sandbox
● Analytical Sandbox
● Analytical Sandbox Kubernetes (preview)
More to come trough the year.
14. MARIADB SANDBOX PREREQUISITES
Install docker following this link:
https://docs.docker.com/engine/installation/
Install docker compose following this link:
https://docs.docker.com/compose/install/
Install Minikube following this link
https://kubernetes.io/docs/tasks/tools/install-minikube/
20. MARIADB SERVER SANDBOX
Move to sandbox folder under the project we just cloned.
cd mariadb-server-docker/tx_sandbox/
docker-compose up
Open a new terminal and create tunnel to port 8080 if you are deploying this on
remote server.
ssh -L 8001:localhost:8080 openworks@<your IP address>
Enter your password when prompted.
22. MARIADB SERVER SANDBOX
Or we can use the command line client on the same container:
docker container ls --filter "name=sandbox"
docker exec -it tx_sandbox_server_1 mysql -hlocalhost -usandbox -
phighlyillogical -D bookstore
23. MARIADB SERVER SANDBOX
Additional lab instructions for the sandbox can be found in the same folder as
labs.md:
https://github.com/mariadb-corporation/mariadb-server-
docker/blob/master/tx_sandbox/labs.md
24. MARIADB SERVER SANDBOX
Clean up
Bring down the cluster and remove all volumes
docker network prune
docker-compose down –v
p
29. MARIADB ANALYTICS SANDBOX
Based on MariaDB Columnstore setup. (2UM 3PM)
Apache Zeppelin Server with sandbox notebooks.
Preloaded with data to play with.
transactions: 11,279,171
addresses: 2,666,749
emails: 2,566,571
phones: 2,427,033
customers: 2,005,397
cards: 1,604,661
loyaltypoints: 923008
books: 5001
32. MARIADB ANALYTICAL SANDBOX
Navigate to sandbox folder under the project we just cloned.
cd /mariadb-columnstore-docker/columnstore_zeppelin
docker-compose up
Open a new terminal and create tunnel to port 8080 (if you don’t have one already)
ssh -L 8001:localhost:8080 openworks@<your IP address>
Enter your password when prompted.
35. MARIADB COLUMNSTORE SANDBOX
We can also use the command line client:
mysql -h127.0.0.1 -uzeppelin_user -pzeppelin_pass bookstore
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 46
Server version: 10.3.11-MariaDB-log Columnstore 1.2.2-1
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MariaDB [bookstore]>
36. MARIADB COLUMNSTORE SANDBOX
If we don’t have one on the local machine we can always connect to the
container.
docker exec -it columnstore_zeppelin_um1_1 mysql -hlocalhost -
uzeppelin_user -pzeppelin_pass -D bookstore
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 46
Server version: 10.3.11-MariaDB-log Columnstore 1.2.2-1
37. MARIADB COLUMNSTORE SANDBOX
Additional instructions for the sandbox can be found here:
https://github.com/mariadb-corporation/mariadb-columnstore-
docker/tree/master/columnstore_zeppelin
38. MARIADB SERVER SANDBOX
Clean up
Bring down the cluster and remove all volumes
docker network prune
docker-compose down –v
Clean up network setup
Welcome to OPENWORKS, This is the docker sandboxes workshop.
My name ... years experience in software development focus on databases.
Technical Sales Engineer for quite some time. Currently part of the DBaaS team.
Sample Content
… such as libraries and other dependencies, and ship it all out as one package.
The main benefits of containerization.
Portable deployment of applications as a single file;
Efficient
Supports for automatic container builds;
Built-in version tracking;
Reusable components;
Public registry for sharing containers;
Docker is not the only containerisation platform out there.
RKT (pronounced 'rocket') from the Linux distributor, CoreOSLXD (pronounced “lexdi”) from Canonical Ltd., the company behind UbuntuOpen VZLinux Vserver
Marure Betas 2013 – 1.0 in 2014
Open Apache
Popular 83%
You can use those images as a base for your database applications.
Maintained.
Latest versions.
Those are the images used in the sandboxes and the helm charts as well.
- This provides an easy way to get your familiar with the parts of Platform
- No manually setup and configure
- Test and development environments
- Can get you started on production deployments.
Sample Content
Sample Content
Sample Content
Sample Content
Sample Content
Sample Content
Sample Content
Sample Content
Sample Content
Sample Content
docker exec -it tx_sandbox_server_1 mysql -hlocalhost -usandbox -phighlyillogical -D bookstore
User modules – process queries and aggregate results
The User Modules (ExeMgr) process queries from the application into instructions that are sent to the Performance Module(PrimProc).
PM executes these instructions as block oriented I/O operations to perform predicate filtering, join processing, and the initial aggregation of data, after which PM sends the data back to the User Module for final aggregation of the results.
Starting with MariaDB ColumnStore 1.1 a C++ SDK is available which supports bulk write into ColumnStore. Conceptually this is an API version of cpimport. The SDK is intended to be integrated by custom code and adapters to enable easier publishing of data into ColumnStore.
Sample Content
Sample Content
Sample Content
Sample Content
Sample Content
docker exec -it columnstore_zeppelin_um1_1 mysql -hlocalhost -uzeppelin_user -pzeppelin_pass -D bookstore
docker exec -it columnstore_zeppelin_um1_1 mysql -hlocalhost -uzeppelin_user -pzeppelin_pass -D bookstore
User modules – process queries and aggregate results
The User Modules (ExeMgr) process queries from the application into instructions that are sent to the Performance Module(PrimProc).
PM executes these instructions as block oriented I/O operations to perform predicate filtering, join processing, and the initial aggregation of data, after which PM sends the data back to the User Module for final aggregation of the results.
Sample Content
Specific slide for use on presentations used at OpenWorks 2019