On Wed, 2015-06-10 at 10:13 +0000, Marcel Reutegger wrote:
> maybe CachingDocumentStore is misleading and we would rather
> name it HierarchicalDocumentStore, which also implements caching
> and leverage hierarchical information for invalidation as needed.
>
> HierarchicalDocumentStore would extend DocumentStore and
> introduce new methods for NODES collection related operations
> with the proposed DocumentKey (or similar).
I've iterated a bit on the design, and this is what I think is a good
starting point ( feel free to shout if you see anything blatantly wrong
with it, but I think it's good enough to start a POC with ).
interface HierarchicalDocumentStore extends DocumentStore
- adds findDocument/queryDocument/etc methods based on the DocumentKey
abstraction
CachingDocumentStore implements HierarchicalDocumentStore
- implements caching for the nodes collection based on the DocumentKey
abstraction ; caching logic is ported from existing MongoDocumentStore
( will also review the RDBDocumentStore logic )
- typically wraps another DocumentStore, like the MongoDocumentStore
and RDBDocumentStore
MultiplexingDocumentStore implements HierarchicalDocumentStore
- wraps 2..n DocumentStore instances and multiplexes access to those
DocumentStore based on the paths it acts on
- multiplexing will only be done for the NODES collection, and there
has to be a 'root' DocumentStore which holds the CLUSTER_NODES and
SETTINGS collections
Configuration notes:
- Caching will eventually be removed from the non-hierarchical
DocumentStore implementations, so a concrete implementations should
always be wrapped by a CachingDocumentStore
- A multiplexing config would look like the following
DocumentNodeStore
-> 1 CachingDocumentStore instance
-> 1 MultiplexingDocumentStore instance
-> N DocumentStore instances ( N > 1 )
This allows the DocumentNodeStore to be unaware of the changes at the
implementation level, consolidates the caching in a single place ( both
in terms of code and at runtime ) and allows the DocumentStore
instances to focus on communicating with the underlying persistance
storage.
Cheers,
Robert