tazama-lf / General-Issues

This repo exists to track current work and any issues within the FRMS CoE
2 stars 0 forks source link

TADP: Split DB's to its own instance #395

Open vorsterk opened 5 months ago

vorsterk commented 5 months ago

Story statement

In order to achieve better performance scalability, with the lack of an ArangoDB enterprise license (which would allow sharding), we want to split the Pseudonymns DB to its own instance of Arango.

In order to achieve this, we need to allow the TADP to write to a separate instance of Arango for the transaction DB, configuration DB and transactionHistory DB.

Currently the process configuration is as follows:

  configuration: {
    databaseName: configuration.db.configurationDb,
    certPath: configuration.db.dbCertPath,
    password: configuration.db.password,
    url: configuration.db.url,
    user: configuration.db.user,
    localCacheEnabled: configuration.db.cacheEnabled,
    localCacheTTL: configuration.db.cacheTTL,
  },
  transaction: configuration.db.transactionDb
    ? {
        databaseName: configuration.db.transactionDb,
        url: configuration.db.url,
        password: configuration.db.password,
        user: configuration.db.user,
        certPath: configuration.db.dbCertPath,
      }
    : undefined,
  transactionHistory: {
    databaseName: configuration.db.transactionHistoryDb,
    url: configuration.db.url,
    password: configuration.db.password,
    user: configuration.db.user,
    certPath: configuration.db.dbCertPath,
  },

For the To Be, we have to have a different name for the different Databases, eg:

const databaseManagerConfig = {

configuration: {
    databaseName: configuration.configurationDb,
    certPath: configuration.configurationCertPath,
    password: configuration.configurationPassword,
    url: configuration.configurationURL,
    user: configuration.configurationUser,
    localCacheEnabled: configuration.configurationCacheEnabled,
    localCacheTTL: configuration.configurationCacheTTL,
  },
  transaction: configuration.db.transactionDb
    ? {
        databaseName: configuration.transactionDb,
        url: configuration.transactionURL,
        password: configuration.transactionPassword,
        user: configuration.transactionUser,
        certPath: configuration.transactionCertPath,
      }
    : undefined,
  transactionHistory: {
    databaseName: configuration.db.transactionHistoryDb,
    url: configuration.transactionHistoryURL,
    password: configuration.transactionHistoryPassword,
    user: configuration.transactionHistoryUser,
    certPath: configuration.transactionHistoryCertPath,
  },
};

Acceptance criteria

  1. TADP will be able to write to and read from all the different DB's separately, so each DB should have its own configuration section, allowing a different URL and password.

Files to Update

  1. DockerFile
  2. Index.ts
  3. Config.ts

Look at TMS and Rule Executor for reference