Additional Information About Sharding with SODA

Performance Tuning

Metadata and Statement Caching

For all implementations, statement caching should be turned on the connection pool. This avoids unnecessary round trips to the database.

To turn on SODA metadata caching:

  • In Java:

    Properties props = new Properties();
    props.put("oracle.soda.sharedMetadataCache", "true");
    OracleRDBMSClient cl = new OracleRDBMSClient(props);

    More information is available at SODA Collection Metadata Caching.

  • In Python:

    # Create the session pool
    pool = cx_Oracle.SessionPool(user="hr", password=userpwd,
                   dsn="dbhost.example.com/orclpdb1",soda_metadata_cache=True)

    More information is available at Using the SODA Metadata Cache

Threading

For optimal use of resources, an instantiation of OracleClient is only required once as it is shared among threads.

The objects obtained from it, such as OracleDatabase and consequently OracleCollection are not thread-safe and do need to be instantiated when creating new requests.

Index Creation and Management

The shard key must be part of the Primary Key. There are no restrictions on creating additional indexes.

All of the guidelines provided by the SODA documentation on creating and managing indexes continue to apply.

Scaling Out Shards

When adding a new shard to the database configuration, all of the DDL, including the SODA metadata and triggers, are automatically available on the new shard.

No extra configuration is required for SODA/JSON Sharding.