Skip to main content

Databases

SQL databasesโ€‹

You can easily create a database from the templates available in the DSRI OpenShift web UI catalog:

Databases in catalog web UI

You can connect to a database from another application in the same project by using the database service name as hostname:

Databases in catalog web UI

You can also use the oc CLI to get the services in your project:

oc get services

Start PostgreSQL ๐Ÿ˜โ€‹

Use the Postgresql template in the DSRI OpenShift web UI catalog to start a SQL database.

Connect to the database

When the database has been deployed, you can connect from another pod using your favorite language and connector.

Example with the psql Command Line Interface:

apt-get update && apt-get install postgresql-client -y

Connect to the Postgresql database using the service name (change depending on the username and database name you chose):

psql -h postgresql-db -U postgres db

Checkout the dsri-demo repository for a quick demo for accessing and using a PostgreSQL database from a Jupyter notebook on the DSRI.

Start MySQL ๐Ÿฌโ€‹

Use the MySQL template in the DSRI OpenShift web UI catalog.

Connect to the database

When the database has been deployed, you can connect from another pod using your favorite language and connector.

Example with the mysql Command Line Interface:

apt-get update && apt-get install mariadb-client -y

Connect to the MySQL database using the service name:

mysql -h example-mysql -p

Checkout the dsri-demo repository for a quick demo for accessing and using a MySQL database from a Jupyter notebook on the DSRI.

Alternatively, MySQL databases can be started using Helm, see the Helm documentation page for more details.

NoSQL databasesโ€‹

MongoDB ๐ŸŒฟโ€‹

MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.

Use the MongoDB template in the DSRI OpenShift web UI catalog.

Connect to the database

Use the service name as hostname to connect from another pod in the same project.

Redis ๐ŸŽฒโ€‹

Redis is an advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, bitmaps and hyperlog.

Use the Redis template in the DSRI OpenShift web UI catalog.

Connect to the database

Use the service name as hostname to connect from another pod in the same project.

Graph databasesโ€‹

Search for the Virtuoso triplestore template in the DSRI web UI catalog. Instantiate the template to create a Virtuoso triplestore in your project.

The deployment is based on the latest open source version of Virtuoso: https://hub.docker.com/r/openlink/virtuoso-opensource-7

Connect to the database

Use the service name as hostname to connect from another pod in the same project.

Ontotext GraphDB triplestoreโ€‹

Use the official DockerHub image if you have an enterprise license. Or build GraphDB free edition image from graphdb-docker on GitHub.

After copying the .zip file in the graphdb-docker/free-edition folder, go the graphdb-docker folder in your terminal:

cd graphdb-docker

Before creating your GraphDB ImageStream, make sure you are in the right project:

oc project my-project

Create the ImageStream for GraphDB:

oc new-build --name graphdb --binary

Build the image on the DSRI and save it in the ImageStream:

oc start-build graphdb --from-dir=free-edition --follow --wait

You can now use the Ontotext GraphDB template to deploy a GraphDB instance on DSRI.

Use the name of the ImageStream when instantiating the template, you can check if the image was properly built in Search > Filter Resources for ImageStreams

Connect to the database

Use the service name as hostname to connect from another pod in the same project.

AllegroGraphโ€‹

AllegroGraphยฎ is a modern, high-performance, persistent graph database. It supports SPARQL, RDFS++, and Prolog reasoning from numerous client applications.

AllegroGraph has not been tested on DSRI yet, but it can be deployed on Kubernetes using Helm, cf. https://www.github.com/franzinc/agraph-examples/tree/master/clustering%2Fkubernetes%2Fmmr%2Fkubernetes-mmr.md