The documentation of the Composite NodeStore implementation is work-in-progress. Please ask on oak-dev for things that are missing or unclear.
The CompositeNodeStore
is a NodeStore
implementation that wraps multiple NodeStore
instances and exposes them through a single API. It is possible, for instance, to store all data in a DocumentNodeStore
instance and relocate /libs
and /apps
in a SegmentNodeStore
instance.
Each node stored wrapped by the composite node store instance is called a mount. The CompositeNodeStore
can be configured with one or more mounts, each owning a defined set of paths, and a default mount, owning the rest of the repository.
The implementation allows for a default mount, which is read-write, and for any number of additional mounts, which are read-only. This limitation is by design and is not expected to be removed in future Oak version.
There are two major aspects to this limitation
Referenceable nodes are not permitted in non-default mounts. The reason is cross-mount references can become invalid in scenarios where the set of mounts changes. Consider the following scenario:
Mounts:
D
N1
, currently mounted under /tmpN2
, currently not mountedIn the repository, node /content/bar
references referenceable node /tmp/foo
(from N1). When the repository is shut down and reconfigureed to use N2 instead of N1, the reference can be broken unless we ensure that the reference stores used by N1 and N2 are the same. This does not happen today.
This constraint also means that:
nt:resource
nodes (usually found as children of nt:file
nodes) are not permitted. It is recommended to replace them with oak:Resource
( see also OAK-4567 ).The Composite NodeStore mounts various other node stores in read-only mode. Since the read-only mode is not enfored via permissions, it may not be queried via Session.hasPermission
. Instead, the read-only status is surfaced via Session.hasCapability
. See OAK-6563 for details.