Configuring Apicurio Studio storage

Apicurio Studio storage options

The main decision to make when deploying Apicurio Studio is which storage backend to use.

The following storage options are available:

Table 1. Apicurio Studio data storage options
Storage option Description

In-memory

Data is stored in RAM on each Apicurio Studio node. This is the easiest deployment to use, but is not recommended for production environment. All data is lost when restarting Apicurio Studio with this storage option, which is suitable for a development environment only.

SQL database

Data is stored in a relational database, in this case PostgreSQL 12+. This is the recommended storage option in a production environment for performance, stability, and data management (backup/restore, and so on).

Configuring Apicurio Studio In-Memory storage using CLI

The in-memory storage option uses RAM to store the data on nodes where Apicurio Studio is deployed, and it is the simplest persistence option to use.

Prerequisites
  • You must have a Kubernetes cluster with cluster administrator access.

Procedure
  1. TODO

This persistence option does not support data distribution across Apicurio Studio nodes. Therefore, it is only recommended for development environments using a single replica (Pod).

Configuring SQL (PostgreSQL) storage

Prerequisites
  • You must have a Kubernetes cluster with cluster administrator access.

  • You have a PostgreSQL database reachable from your Kubernetes cluster.

Procedure
  1. In the Kubernetes web console, log in with cluster administrator privileges.

  2. Change to the Kubernetes namespace in which Apicurio Studio and your PostgreSQL Operator are installed.

  3. TODO

Installing PostgreSQL database storage using OpenShift OperatorHub

One of the available storage options requires that you provide connection information to a PostgreSQL database. You can use any PostgreSQL database available on your OpenShift cluster, but it is recommended to use OperatorHub to choose and install an Operator that can manage a PostgreSQL database for you.

You can install your preferred PostgresQL Operator, but this section shows how to install the PostgreSQL Operator by Dev4Ddevs.com and create a new database for Apicurio Registry.

Prerequisites
  • You must have cluster administrator access to an OpenShift cluster.

Procedure
  1. In the OpenShift Container container-platform web console, log in using an account with cluster administrator privileges.

  2. Change to the OpenShift project in which Apicurio Studio is installed. For example, from the Project drop-down, select my-project.

  3. In the left navigation menu, click Operators > OperatorHub.

  4. In the Filter by keyword text box, enter PostgreSQL to find an Operator suitable for your environment, for example, PostgreSQL Operator by Dev4Ddevs.com or Crunchy PostgreSQL for OpenShift.

  5. Read the information about the Operator, and click Install. This displays the Create Operator Subscription page.

  6. Select your subscription settings, for example:

    • Installation Mode: Select one of the following:

      • All namespaces on the cluster (default)

      • A specific namespace on the cluster and then my-project

    • Update Channel > stable

    • Approval Strategy: Select Automatic or Manual

  7. Click Subscribe. This displays the Operators > Installed Operators page.

  8. Wait a few moments until the Status for the PostgreSQL Operator displays Succeeded and the subscription is Up to Date.

    You must read the documentation from your chosen PostgreSQL Operator for details on how to create and manage your database.
  9. Create a PostgreSQL database for your Apicurio Studio storage. For example, click Installed Operators > PostgreSQL Operator by Dev4Ddevs.com > Create database > YAML.

  10. Edit the database settings as follows:

    • name: Change the value to studio

    • image: Change the value to centos/postgresql-10-centos7

  11. Edit any other database settings as needed depending on your environment, for example:

    apiVersion: postgresql.dev4devs.com/v1alpha1
    kind: Database
    metadata:
      name: studio
      namespace: my-project
    spec:
      databaseCpu: 30m
      databaseCpuLimit: 60m
      databaseMemoryLimit: 512Mi
      databaseMemoryRequest: 128Mi
      databaseName: example
      databaseNameKeyEnvVar: POSTGRESQL_DATABASE
      databasePassword: postgres
      databasePasswordKeyEnvVar: POSTGRESQL_PASSWORD
      databaseStorageRequest: 1Gi
      databaseUser: postgres
      databaseUserKeyEnvVar: POSTGRESQL_USER
      image: centos/postgresql-10-centos7
      size: 1
  12. Click Create Database, and wait until the database is created.