Resource Coordination
Since the RAC system allows many users to
connect and process database SQL operations
concurrently, many resources, such as data
blocks and enqueues, are used simultaneously.
This situation demands an effective
synchronization of the concurrent tasks.
Synchronization
Within the shared cache (global cache or fused
cache of multiple instances), the coordination
of concurrent tasks is called synchronization.
Resources such as data blocks and enqueues are
synchronized as nodes within a cluster as they
acquire and release ownership. The
synchronization provided by real application
clusters maintains a cluster wide concurrency of
resources, and in turn ensures the integrity of
the shared data. Even though there is seamless
and transparent synchronization of concurrent
tasks within the shared cache, it does not come
without a cost in overhead. Processing within
the local buffer cache is always faster than
processing blocks across instances.
The key to successful cluster database
processing is to divide the tasks that require
resources among the nodes so that very little
synchronization is necessary. The less
synchronization necessary, the better the
system’s performance and scalability will be.
The overhead of synchronization can be very
expensive if there is excessive inter-node
communication.
According to Oracle studies, accessing a
block within the local cache is many times
faster than accessing a block in a remote cache
(Figure 2.10).
Accessing a block from disk is even more
expensive. A combination of local cache block
access with occasional access to remote cache
blocks gives good performance levels.
Figure 2.10:
Block Access Times
GCS Resource Modes and Roles
Because of data block transfers among multiple
instances, the same data block can exist in
multiple caches. The resource mode is defined as
a concurrency control that establishes global
access rights for instances in a cluster. The
data block, or GCS resource, can be held in
different resource modes depending on whether a
resource holder intends to modify the data or
read the data. The modes are as follows:
-
Null (N) mode
- Holding a resource at this level conveys
that there are no access rights. Null mode
is usually held as a placeholder, even if
the resource is not actively used.
-
Shared (S) mode
- When a resource is held at this level, it
will ensure that the data block is not
modified by another session but will allow
concurrent shared access.
-
Exclusive (X) mode
- This level grants the holding process
exclusive access. Other processes cannot write
to the resource. It may have consistent read
blocks.
The resource mode is an important mechanism to
maintain data integrity and avoid data
corruption issues. GCS resources are specified
to have global roles or local roles. These roles
are mutually exclusive.
-
When a block is first read into the cache of
an instance and other instances have not
read the same block, then the block is said
to be locally managed and is therefore
assigned a local role.
-
After the block has been modified by the
local instance and transmitted to another
instance, it is considered to be globally
managed, and is therefore assigned a global
role.
Basically, the concept of role supplements the
access mode characteristic. A typical data block
has both of these characteristics.