Oracle True Cache Technical Architecture

Oracle logo

September 2025

Copyright © 2024, 2025 Oracle and/or its affiliates

True Cache General Architecture

Global Data Services (GDS) (Optional) Mid-tier sessions using
JDBC Thin driver Router, API Gateway True Cache Primary Database Redo apply Cache miss, Warm-up Infrequent reads Frequent reads

Notes

Oracle True Cache is an in-memory, consistent, and automatically managed SQL and key-value (object or JSON) cache for Oracle AI Database.

At a high level, here's how it works:

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.

You can optionally deploy Oracle True Cache with Oracle AI Database Global Data Services (GDS) to manage workload routing, dynamic load balancing, and service failover across multiple True Caches and other database replicas.

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. 

Related Resources

True Cache Application

Client Primary Database True Cache Application Code static String url_primary = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=primary_host)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=sales)(SERVER=DEDICATED)))"; OracleDataSource ods1 = new oracle.jdbc.pool.OracleDataSource(); ods1.setURL(url_primary); ods1.setUser(user); ods1.setPassword(password); ods1.setConnectionProperty("oracle.jdbc.useTrueCacheDriverConnection","true"); Connection conn1 = ods1.getConnection(); verifyConnection(conn1); conn1. verifyConnection(conn1); conn1. verifyConnection(conn1); // This is connected to primarysetReadOnly(true) // This is connected to True Cache setReadOnly(false) // This is connected back to primary

Notes

When True Cache is configured, applications must decide whether to query data from True Cache or the primary database. There are two ways to do this:

The JDBC method does the following:

  1. The client application creates a logical connection to connect to the primary database application service called SALES by using the connection's useTrueCacheDriverConnection parameter.
  2. The application flags the logical connection as setReadOnly(true) or setReadOnly(false) to direct SQL statements to True Cache or the primary database, respectively. For each logical connection, the JDBC Thin driver internally maintains two physical connections: one to the primary database and one to True Cache. Both connections were associated when the database application service SALES was created.

The JDBC method is illustrated in the following code:

static String url_primary = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=?(ADDRESS=(PROTOCOL=tcp)(HOST=primary_host)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=sales)(SERVER=DEDICATED)))";

OracleDataSource ods1 = new oracle.jdbc.pool.OracleDataSource();

ods1.setURL(url_primary);
ods1.setUser(user);
ods1.setPassword(password);

ods1.setConnectionProperty("oracle.jdbc.useTrueCacheDriverConnection","true");

Connection conn1 = ods1.getConnection();

verifyConnection(conn1); // This is connected to primary

conn1.setReadOnly(true)

verifyConnection(conn1); // This is connected to True Cache

conn1.setReadOnly(false)

verifyConnection(conn1); // This is connected back to primary

Related Resources

True Cache Uniform Configuration

Listener sales_rl CONNECT_DATA= (service_name=SALES) Application CONNECT_DATA= (service_name=SALES) Application remote_listener=sales_rl service_names=SALES_TC fal_server=PRIMDBI fal_client=TCDB1I True Cache 1: TCDB1I remote_listener=sales_rl service_names=SALES_TC fal_server=PRIMDBI fal_client=TCDB2I True Cache 2: TCDB2I Primary DB: PRIMDBI remote_listener=sales_rl service_names=SALES (true_cache_service attribute of 
SALES set to SALES_TC) Other Configuration Types Partition with colocation Partition with multiple services

Notes

In a uniform configuration, you can deploy multiple, identical True Caches that use the same True Cache database application service. Client sessions are evenly distributed among True Caches, which all cache the same set of data.

This diagram shows an example of a uniform configuration with the following elements:

When True Cache starts, the True Cache network name that is specified in the FAL_CLIENT parameter (TCDB1I or TCDB2I) is registered with the primary database network name that is specified in the FAL_SERVER parameter (PRIMDBI).

If the application handles connections manually, it sends queries to True Cache through a True Cache database application service, and it sends other queries and updates to the primary database through the primary database application service.

To achieve more application transparency, you can use the JDBC method and associate primary database application services with True Cache database application services. This diagram shows the following database application services:

The two services are associated by setting the TRUE_CACHE_SERVICE parameter to SALES_TC for the primary database application service (SALES). The application's code only needs to know about the primary database application service (SALES). To use the SALES_TC database application service, the application changes the setReadOnly flag (TRUE or FALSE) of the SALES JDBC connection.

The True Caches and the primary database share a remote listener (sales_rl). If multiple True Caches exist and serve the same database application service, the listener automatically distributes and load balances sessions to each cache.

Related Resources

True Cache Configuration with colocation_tag

Other Configuration Types Listener sales_rl CONNECT_DATA= (service_name=SALES) (colocation_tag=EUROPE) Application CONNECT_DATA= (service_name=SALES) (colocation_tag=US) Application remote_listener=sales_rl service_names=SALES_TC fal_server=PRIMDBI fal_client=TCDB1I True Cache 1: TCDB1I remote_listener=sales_rl service_names=SALES_TC fal_server=PRIMDBI fal_client=TCDB2I True Cache 2: TCDB2I Primary DB: PRIMDBI remote_listener=sales_rl service_names=SALES (true_cache_service attribute of 
SALES set to SALES_TC) Uniform configuration Partition with multiple services

Notes

In a partitioned configuration, the data is divided across multiple True Caches, which each cache a different subset of the data. 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 a single cache in a uniform configuration.

A partitioned configuration with COLOCATION_TAG similar to the uniform configuration, except that when you set COLOCATION_TAG within the CONNECT_DATA parameter of your network alias, load balancing is ignored. The listener tries to send all connections that have the same COLOCATION_TAG to the same True Cache.

This diagram shows an example of a partitioned configuration with COLOCATION_TAG with the following elements:

In this example, both True Caches are in the same data center. One True Cache processes all requests with the client's TNS CONNECT_DATA tagged with US (connections coming from US) and the other processes all requests with the client's TNS CONNECT_DATA tagged with EUROPE (connections coming from EUROPE).

When True Cache starts, the True Cache network name that is specified in the FAL_CLIENT parameter (TCDB1I or TCDB2I) is registered with the primary database network name that is specified in the FAL_SERVER parameter (PRIMDBI).

If the application handles connections manually, it sends queries to True Cache through a True Cache database application service, and it sends other queries and updates to the primary database through the primary database application service.

To achieve more application transparency, you can use the JDBC method and associate primary database application services with True Cache database application services. This diagram shows the following database application services:

The two services are associated by setting the TRUE_CACHE_SERVICE parameter to SALES_TC for the primary database application service (SALES). The application's code only needs to know about the primary database application service (SALES). To use the SALES_TC database application service, the application changes the setReadOnly flag (TRUE or FALSE) of the SALES JDBC connection.

The True Caches and the primary database share a remote listener (sales_rl). 

Related Resources

True Cache Partitioned Configuration with Multiple Services

Other Configuration Types Listener sales_rl CONNECT_DATA= (service_name=) HR Application CONNECT_DATA= (service_name=) SALES Application remote_listener=sales_rl service_names=fal_server=PRIMDBI fal_client=TCDB1I SALES_TC True Cache 1: TCDB1I remote_listener=sales_rl service_names=fal_server=PRIMDBI fal_client=TCDB2I HR_TC True Cache 2: TCDB2I Primary DB: PRIMDBI remote_listener=sales_rl SALES, HR SALES SALES_TCHR HR_TC service_names=(true_cache_service attribute of 
set to) (true_cache_service attribute of 
set to) Uniform configuration Partition with colocation

Notes

In a partitioned configuration, the data is divided across multiple True Caches, which each cache a different subset of the data. 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 a single cache in a uniform configuration.

This diagram shows an example of a partitioned configuration where each True Cache caches data for a different database application service. The diagram has the following elements:

When True Cache starts, the True Cache network name that is specified in the FAL_CLIENT parameter (TCDB1I or TCDB2I) is registered with the primary database network name that is specified in the FAL_SERVER parameter (PRIMDBI).

If the application handles connections manually, it sends queries to True Cache through a True Cache database application service, and it sends other queries and updates to the primary database through the primary database application service.

To achieve more application transparency, you can use the JDBC method and associate primary database application services with True Cache database application services. This diagram shows the following database application services:

The services are associated by setting the TRUE_CACHE_SERVICE parameter to SALES_TC and HR_TC for the corresponding primary database application services (SALES and HR). The application's code only needs to know about the primary database application services (SALES and HR). To use the SALES_TC and HR_TC database application services, the application changes the setReadOnly flag (TRUE or FALSE) of the SALES and HR JDBC connections.

The True Caches and the primary database share a remote listener (sales_rl). 

Related Resources

True Cache Integration with Oracle Global Data Services (GDS)

Region Global Data Services GDS Catalog SALES SALES, SALES_TC GDS pool Services UCP JDBC Connection Pool True Cache 2 True Cache 1 Primary Database Oracle Notification Service (ONS) Network Redo apply Cache miss, warm-up infrequent reads Writes and reads Frequent reads Frequent

Notes

You can deploy Oracle True Cache with Oracle AI Database Global Data Services (GDS) to manage workload routing, dynamic load balancing, and service failover across multiple True Caches and other database replicas. 

Global services are functionally similar to the local database application services that are provided by single instance or Oracle Real Application Clusters (Oracle RAC) databases. The main difference between global services and local services is that global services span the instances of multiple databases, whereas local services span the instances of a single database.

This diagram illustrates a basic True Cache configuration with GDS in a single region.

There is one region with two True Caches and one primary database. True Cache reads from the primary database to warm up the cache or when there's a cache miss. After a block is cached, it's updated automatically through redo apply from the primary database. Applications are configured so that frequent reads go to the True Caches and writes and infrequent reads go to the primary database.

The GDS configuration includes the following components:

Related Resources