Database Upgradability

The Database Upgrade transforms an existing database schema to an updated version. The Database upgrade supports the following operations:

  • Adding new collections
  • Adding new fields to the existing collection
  • Adding indexes to fields of collection

The database upgrade feature is executed in the Microservice framework in diverse ways based on the user requirements. This is implemented in all the stacks K8 , Azure, and AWS.

The APPINIT component is introduced by MSF to support database upgradability. If the MS is a new installation for the client, the APPINIT component helps in creating the tables in the database.

The Following are the versions from which the upgrade is supported to 202301 and higher versions.

  • 202110-202301
  • 202204-202301
  • 202207-202301
  • 202210-202301

The client can upgrade from 202110, 202204, 202207, and 202210 to 202301 and higher versions. All the scripts which help in database upgrades are committed to the source and will be available as part of the package under the database/ scripts/ migration folder.

Azure

A new function app is introduced for APPINIT. Following URL is invoked to run the API in the function app and this upgrades the database.

https://${APPINIT_NAME}.azurewebsites.net/api/v1.0.0/dbmigration?code=${MASTER_KEY}

The following properties are mandatory properties that are to be set for the function app.

--settings DATABASE_NAME=$DATABASE_NAME DB_CONNECTION_URL=$DB_CONNECTION_URL DRIVER_NAME=$DRIVER_NAME DIALECT=$DIALECT DB_PASSWORD=$DB_PASSWORD DB_USERNAME=$DB_USERNAME DATABASE_KEY="sql" temn_msf_name=$MSF_NAME   tem_msf_disableInbox=$TEM_APPINIT_DISABLEINBOX  temn_msf_security_authz_enabled=$APPINIT_AUTHZ_ENABLED temn_msf_database_auto_upgrade=$DB_AUTO_UPGRADE  JPA_ENABLED=$JPA_ENABLED MIN_POOL_SIZE=1 MAX_POOL_SIZE=10

AWS

Lambda function and API Gateway for cms-appinit-initiate and cms-appinit-getstatus are created for APPINIT. The following API is invoked to upgrade database

https://${restAPIId}.execute-api.$AWS_REGION.amazonaws.com/ms-consent-api/v1.0.0/migration -H "x-api-key: ${API_KEY}"

The following properties are to be set for the Lamda functions.

--environment Variables=\{DRIVER_NAME=com.mysql.jdbc.Driver,DIALECT=org.hibernate.dialect.MySQL5InnoDBDialect,HOST=${host},PORT=${port},DATABASE_NAME=${dbname},DB_USERNAME=root,DB_PASSWORD=campaignroot,DB_CONNECTION_URL=jdbc:mysql://${host}:${port}/campaign,DATABASE_KEY=sql,temn_msf_security_authz_enabled=false,className_initiateDbMigration=com.temenos.microservice.framework.dbmigration.core.InitiateDbMigrationImpl,class_inbox_dao=com.temenos.microservice.framework.core.inbox.InboxDaoImpl,class_outbox_dao=com.temenos.microservice.framework.core.outbox.OutboxDaoImpl,tem_msf_disableInbox=true,temn_msf_database_auto_upgrade=N,MIN_POOL_SIZE=5,MAX_POOL_SIZE=10,JPA_ENABLED=none\}

K8

In the K8 Deployment Scripts, the APPINIT component is to be installed. To install the component, the following properties need to be configured in the helm job.

  • For new installation temn_msf_database_auto_upgrade should be N in the install scripts. After successful execution of install scripts, one entry for install script execution is visible in schema_history table.
  • To upgrade the database temn_msf_database_auto_upgrade should be Y in the install scripts. After successful execution of install scripts, migration scripts execution entry is visible in schema_history table.
  • The corresponding database upgrade is visible in following image.

Field Name
|
Application/Table name

Temenos Headquarters SA
2 Rue de l'Ecole-de-Chimie
CH - 1205 Geneva
Switzerland

Copyright © 2020- Temenos Headquarters SA

Published on :
Tuesday, May 23, 2023 9:30:59 PM IST