Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
minLevel1
maxLevel3
outlinefalse
styledefault
typelist
printabletrue

The DataWareHouse is a PostgreSQL database where the Moodle data is saved after it has been transformed by NiFi pipelines. It contains very few tables, compared to Moodle original database, but it can easily generate views with critical data, which is used in the different dashboards.

PostgreSQL Installation

  1. Download PostgreSQL Docker image.

    Code Block
    docker pull postgres
  2. Create the container. Replace <password> with the actual password.

    Code Block
    docker run --name datawarehouse -p 127.0.0.1:5432:5433/tcp -e POSTGRES_PASSWORD=<password> -d postgres
  • docker run --name datawarehouse -p 127.0.0.1:5432:5433/tcp -e POSTGRES_PASSWORD=<password> -d postgres

  • docker exec -ti <container ID> bash

  • psql -h localhost -p 5432 -U postgres -d postgres

  • ALTER USER postgres WITH PASSWORD '<password>';

  • CREATE DATABASE zwe_analytics;

DataWareHouse Creation

  1. Enter the PostgreSQL Docker. First, get the container ID.

    Code Block
    docker ps
    docker exec -ti <container ID> bash
  2. Use psql to access the postgres database.

    Code Block
    psql -h localhost -p 5432 -U postgres -d postgres
  3. Change the postgres user password and create the new database.

    Code Block
    ALTER USER postgres WITH PASSWORD '<password>';
    CREATE DATABASE zwe_analytics;
  4. Create the tables…