4.2.4 Data Store Properties

MicroTx uses a data store for persistence of the transaction state and to store the transaction logs.

You can use an etcd cluster, Oracle Database, or internal memory to store the transaction logs. When you want to use multiple replicas of the transaction coordinator, you must set up an etcd cluster or Oracle database as the transaction log data store. If you use internal memory, you can't create multiple replicas of the transaction coordinator. Use internal memory only for development environments as all the transaction details are lost every time you restart MicroTx.

Type of Data Store for Transaction Logs

Under tmmConfiguration.storage, specify the type of data store that MicroTx uses for persistence of transaction state. After specifying the type of data store, you can provide additional details to connect to the external data store.

Property Description
type

Enter one of the following values to specify the persistent data that you want MicroTx to use to track the transaction information.

  • etcd to use etcd as the data store. You must provide details to connect to the etcd data store in the storage.etcd field.
  • db to use Oracle Database as the data store. You must provide details to connect to the Oracle data store in the storage.db field.
  • memory to skip entering details to connect to either etcd or Oracle Database and use the internal memory instead. When you use internal memory, all the transaction details are lost every time you restart MicroTx.
completedTransactionTTL The time to live (TTL) in seconds for a completed transaction record in the transaction data store. The permissible range of values is 60 to 1200 seconds. When the specified time period expires, the completed transaction entry is removed from the data store.

Oracle Database as Data Store for Transaction Logs

Under tmmConfiguration.storage.db, specify the details to connect to an Oracle Database. Skip this section and do not provide these values if you are connecting to an etcd database or using internal memory.

The following table specifies the properties required to connect to an Oracle Database as the MicroTx data store.

Property Description
connectionString

Enter the connection string for the data store in Oracle Database.

  • If you are using a database that uses a credential wallet, such as Oracle Autonomous Transaction Processing, use the following format to enter the connection string:
    tcps://<database-host>:<database-portNumber>/<service_name>

    You can find the required details, such as protocol, host, port, and service name in the tnsnames.ora file, which is located in folder where you have extracted the credential wallet. See Download Client Credentials (Wallets) in Using Oracle Autonomous Database on Shared Exadata Infrastructure.

    For example:

    tcps://adb.us-phoenix-1.oraclecloud.com:1521/sales.adb.oraclecloud.com
    Additionally, you can pass database timeout parameters, such as retry_count and retry_delay, by appending it to the connection string. For example,
    <connection-string>?retry_count=20&retry_delay=3
  • If you are using a non-autonomous Oracle Database (a database that does not use a credential wallet), use the following format to enter the connection string:
    <database-host-IPaddress>:<database-portNumber>/<databaseUniqueName>.<hostDomainName>
    For example:
    123.213.85.123:1521/CustDB_iad1vm.sub05031027070.customervcnwith.oraclevcn.com

    Where, CustDB_iad1vm.sub05031027070.customervcnwith is the unique name of the database or the service name.

  • If you are using Oracle RAC database, see About Connecting to an Oracle RAC Database Using SCANs.
credentialSecretName Enter the name of the Kubernetes secret that contains the credentials to connect to the Oracle Database. Example, db-secret. See Create a Kubernetes Secret for Oracle Database Credentials.
connectionParams Enter a space-separated list of connection parameters. For details about the connection parameters that you can specify, see https://pkg.go.dev/github.com/godror/godror#section-documentation. For example, poolMinSessions=1 poolMaxSessions=300
walletConfigMap.configMapName Provide a value for this field only if you connect to a database that uses a credential wallet, such as Autonomous Database. For other databases, you can leave this field empty. Enter the name of the configuration map that you have created for the credential wallet of the Autonomous Database instance. See Get Autonomous Database Client Credentials. For example, db-wallet-configmap.

etcd Database as Data Store for Transaction Logs

Under tmmConfiguration.storage.etcd, specify the details to connect to an etcd database. Skip this section and do not provide these values if you are connecting to an Oracle database or are using internal memory.

The following table specifies the properties required to connect to an etcd database as the MicroTx data store.

Before you provide this information, ensure that you complete the following tasks and note down the required details.

  1. Generate RSA Certificates for etcd
  2. Create a Kubernetes Secret for etcd
Property Description
endpoints Enter the external IP address of the etcd database server. If you have installed the etcd cluster in the Kubernetes cluster where you will install MicroTx, then provide the Kubernetes service name and the port of the etcd cluster (nodes) as values. Otherwise, enter a comma-separated list of host names or IP addresses of the etcd cluster nodes along with the ports, such as 198.51.100.1:4002,198.51.100.2:4002,198.51.100.3:4002.
skipHostNameVerification Set this to false to verify the IP address of the etcd database server. If you set this to true, then the server host name or IP address is not verified. You can set this field to true only for test or development environments.

Caution:

You must set this field to false in production environments.
credentialSecret.secretName Enter the path to the Kubernetes secret in the container. The secret contains the client credentials, client key, and the password that you have used to protect the client certificate. For example, /etc/otmm/etcd-cert-secret. See Create a Kubernetes Secret for etcd.
credentialSecret.secretFileName Enter the location of the JSON file, that contains client credentials, client key, and the password that you have used to protect the client certificate. For example, /etc/otmm/etcdecred.json. See Generate RSA Certificates for etcd.
cacertConfigMap.configMapName Enter the name of the configuration map file, which you had created while initializing the certificate authority. For example, etcd-ca-cert-map. See Create a Kubernetes Secret for etcd.
cacertConfigMap.configMapFileName Enter the name of the PEM file that you had created while initializing the certificate authority. For example, ca.pem. See Generate RSA Certificates for etcd.
The following code snippet provides sample value which are based on the sample values provided in the Generate RSA Certificates for etcd and Create a Kubernetes Secret for etcd topics.
storage:
    type: etcd
    etcd:
      endpoints: "https://198.51.100.1:4002"
      skipHostNameVerification: "false"
      credentialSecret:
        secretName: "etcd-cert-secret"
        secretFileName: "etcdecred.json"
      cacertConfigMap:
        configMapName: "etcd-ca-cert-map"
        configMapFileName: "ca.pem"

If you do not provide the correct IP address for the endpoints field, then host verification fails when you install MicroTx.