Oracle Key Value Service Configuration

Enabling Oracle for your Application

To enable your application to be backed by Oracle, you just need to add AtlasDB DbKvs and the OracleJDBC driver as a runtime dependency. In gradle this looks like:

runtime 'com.palantir.atlasdb:atlasdb-dbkvs:<atlas version>'
runtime 'com.palantir.atlasdb:dbkvs-oracle-driver:<oracle driver version>'

e.g.

runtime 'com.palantir.atlasdb:atlasdb-dbkvs:0.19.0'
runtime 'com.palantir.atlasdb:dbkvs-oracle-driver:0.3.0'

Configuring a Running Application to Use Oracle

A minimal AtlasDB configuration for running against Oracle will look like the below.

atlasdb:
  keyValueService:
    type: relational
    ddl:
      type: oracle
      overflowMigrationState: 3
      jdbcHandler:
        type: oracle
    connection:
      type: oracle
      host: localhost
      port: 1521
      sid: oracle
      dbLogin: palantir
      dbPassword: palpal

  leader:
    # This should be at least half the number of nodes in your cluster
    quorumSize: 2
    learnerLogDir: var/data/paxosLogs
    acceptorLogDir: var/data/paxosLogs
    # This should be different for every node. If ssl is not enabled, then the host must be specified as http
    localServer: https://<yourhost>:3828
    # This should be the same for every node. If ssl is not enabled, then the host must be specified as http
    lockCreator: https://host1:3828
    # This should be the same for every node
    leaders:
      - https://host1:3828 # If ssl is not enabled, then the hosts must be specified as http
      - https://host2:3828
      - https://host3:3828

For more details on the leader block, see Leader Configuration.

Configuration Parameters

The Oracle Configuration has 2 major blocks:

The DDL Config Block:

Property Description Required
overflowMigrationState The value should be 3(FINISHED) for all new clients. Yes
tableFactorySupplier This should supply the DbTableFactory required for setting up database operations. No
metadataTable The metadataTable should be a tableReference to the metadata table. The default value is {namespace:””, tablename:”_metadata”}. No
tablePrefix The value should be a string with only alpha numeric characters or underscores. This should not begin with an underscore. Default value is “a_”. No
poolSize The number of threads in the connection pool to Oracle, defaults to 64. No
fetchBatchSize The number of cells fetched in batch queries like getAllRows, getAllTimestamps etc., defaults to 256. No
mutationBatchCount The maximum number of cells in a batch for write operations like put, putWithTimestamps, defaults to 1000. No
mutationBatchSizeBytes The maximum bytes in a batch for write operations like put, putWithTimestamps, defaults to 2MB. No

Connection parameters

If you would like to customize the JDBC connection parameters, for example if you are experiencing performance issues, then you may supply them under the connection section of the keyValueService config. An example is shown below; for full documentation on which parameters are available, check out the JDBC docs.

atlasdb:
  keyValueService:
    # as above - skipped for brevity
    connection:
      # as above - skipped for brevity
      connectionParameters: # JDBC connection parameters
        defaultRowFetchSize: 100 # Default: unlimited. Adjusts the number of rows fetched in each database request.

These are the required parameters:

Property Description Required
host The host running Oracle. Yes
port The port exposed by the Oracle server for Oracle client connections. Yes
sid The site identifier for the Oracle server. Yes
dbLogin The Oracle DB username. Yes
dbPassword The Oracle DB password. Yes