Overview

What is Oracle True Cache?

Oracle True Cache is an in-memory, consistent, and automatically managed SQL cache for Oracle Database. It operates seamlessly within your database environment, efficiently storing frequently accessed information to dramatically improve application response times. By shouldering the load of repetitive data requests, Oracle True Cache effectively reduces strain on the database server. Its automated management and unwavering consistency streamline application development, offering a cost-effective and simplified approach for developers.

What are the benefits of Oracle True Cache?

Oracle True Cache provides several business benefits related to application development and performance.

  • Improves scalability and performance by offloading queries from the primary database.
  • Reduces application response time and network latency by deploying True Cache closer to the application. This especially benefits situations where a database is in a different location than the application due to data residency requirements.
  • Creates a large, in-memory storage area by dividing data across multiple True Caches. The total size of the cached data across all True Caches can be much larger than it would be for a single primary database or cache.
  • Automatically maintains the cache contents.
  • Simplifies development and maintenance by being transparent to the application.

How does Oracle True Cache work?

At a high level, here's how Oracle True Cache 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 automatically updated 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.
  • If multiple True Caches exist and serve the same database application service, the listener automatically distributes and load balances sessions to each cache.

Lifecycle details

How is data loaded into Oracle True Cache?

True Cache is empty when it starts up, so it reads large chunks of data to populate the cache.

How is data refreshed in Oracle True Cache?

After a block is cached, it's automatically updated through redo apply from the primary database. This is similar to the update mechanism used in Oracle Active Data Guard.

How does Oracle True Cache handle essential data to prevent eviction?

True Cache offers the capability to pin specific tables and data sets within the cache. This ensures that crucial data remains intact, even under memory constraints or least recently used (LRU) algorithms. Pinned data is automatically refreshed in real time as changes occur on the primary database, maintaining consistency and reliability.

How does Oracle True Cache scale?

True Cache can scale by leveraging the concept of services. For instance, you can define two services, one for the sales department and another for HR. All requests for the sales service will be directed to one cache, while requests for HR will be routed to another cache. Because the data for each service is distinct, with different tables and data structures, scaling True Cache can be achieved effectively using the following approach. For example:

  • The primary database (PRIMDBI) runs two database application services: SALES and HR.
  • Two True Caches are associated with different services that correspond to the primary database application services:
    • TCDB1I is associated with the SALES_TC service.
    • TCDB2I is associated with the HR_TC service.

Which parameter do you set to associate database application services with Oracle True Cache?

Set the TRUE_CACHE_SERVICE parameter using service names that correspond to the primary database application services. To distinguish the True Cache database application services, it's a good practice to use the primary service name followed by _TC. For example, if the primary service is SALES, the True Cache service would be SALES_TC.

Is colocation possible with Oracle True Cache?

Yes, colocation is possible using the COLOCATION_TAG feature, which allows data to be sent to True Caches in specific regions. For example, you might have two applications and two True Caches. Sessions with COLOCATION_TAG set to United States go to one True Cache (TCDB1I) and sessions with COLOCATION_TAG set to Europe go to the other True Cache (TCDB2I).

Can I perform updates directly on Oracle True Cache?

No, True Cache is a read-only cache, so you can't directly update the cache, but you can use DML redirection to indirectly update the cache. DML redirection writes data to the primary database and then that data is automatically updated in the cache. This is similar to how Oracle Active Data Guard works. Because DML redirection uses more resources, it's not recommended for update-intensive applications.

How do I enable DML redirection in Oracle True Cache?

To enable DML redirection, set the ADG_REDIRECT_DML initialization parameter to TRUE on True Cache.

What type of data can be cached in Oracle True Cache?

Oracle True Cache caches all Oracle Database objects and data types, including relational, JSON, text, spatial, graph, and vector data types. Data in True Cache can be accessed in a row or columnar format, ensuring compatibility and flexibility for diverse caching needs.

How do smart client drivers enhance the performance with Oracle True Cache?

Smart client drivers refer to the Oracle JDBC driver's intelligent functionality, which automatically identifies the presence of True Cache. These drivers can discern between read-only and read-write requests, seamlessly routing read-only queries to the cache. This innovative feature streamlines application development by eliminating the need to manage separate connections for the primary database and the cache.

What deployment use cases are supported by Oracle True Cache?

True Cache offers versatile deployment options, catering to various scenarios such as mid-tier cache, edge cache, cross-region cache, and cross-cloud cache configurations.

What security measures are in place for Oracle True Cache?

Oracle True Cache implements Oracle Database security policies. These include a wide array of protections such as at-rest data encryption, over-the-wire data encryption, row-level security, Oracle Database Vault, Oracle Key Vault, and thorough authentication and authorization mechanisms.

Licensing

With which database version is Oracle True Cache available?

True Cache is available with Oracle Database 23ai and later versions. It is not supported in earlier releases.

How is Oracle True Cache licensed and priced?

Oracle True Cache is a feature available with Oracle Base Database Service.