Oracle True Cache is an in-memory, consistent, and automatically managed SQL and key-value (object or JSON) cache for Oracle Database.
At a high level, here's how it works:
- An application decides whether to query data from True Cache or the primary database.
- True Cache satisfies queries by using data that's cached in its memory. When the data isn't in the cache, True Cache fetches the data from the primary database.
- True Cache is empty when it starts up, so it reads large chunks of data to populate the cache. After a block is cached, it's updated automatically through redo apply from the primary database. This is similar to the update mechanism used in Oracle Active Data Guard.
- A query to True Cache returns only committed data, and the data is always consistent.
- Like all caches, the True Cache data might not be the most current data as it exists in the primary database.
- If multiple True Caches exist and serve the same database application service, the listener automatically distributes and load balances sessions to each cache.
To take full advantage of True Cache, Java application developers who are using the latest JDBC Thin driver can set the primary database connection as read-only so the connection is directed automatically to True Cache. If an application isn't using the latest JDBC Thin driver, it can still benefit from True Cache by manually switching connections from True Cache to the primary database, when needed.
This diagram illustrates a True Cache configuration with four mid-tier sessions using the JDBC Thin driver, two True Caches, and one primary database. The frequent reads go to True Cache, and infrequent reads go to the primary database.