430 likes | 545 Views
Oak , the Architecture of the new Repository. Michael Dürig, Adobe Research. Design goals. Scalable Big repositories Clustering Customisable, flexible OSGi friendly. Outline. CRUD Changes Search. Tree model. a. d. b. c. Updating. ?. a. d. b. c. x. MVCC. HEAD. r1: /.
E N D
Oak, the Architecture of the new Repository Michael Dürig, Adobe Research
Design goals • Scalable • Big repositories • Clustering • Customisable, flexible • OSGi friendly
Outline • CRUD • Changes • Search
Tree model a d b c
Updating ? a d b c x
MVCC HEAD r1: / r2: / a d r1: /d r2: /d b c r1: /a/b r2: /a/b r2: /d/x
Refresh garbage
Garbage collection garbage
Concurrent updates r2a r1 r2b
Merging r2a merge upates r1 r3 r2b
Conflict handling: serialisation • Fullyserialised • Fail, no concurrent update • Partially serialised • Concurrent conflict free updates
Conflict handling strategies: merging • Partial merge • Conflict markers, deferred resolution • Full merge • Need to choose victim
Replica and caches master copy full replica cache
Sharding strategies by path by level by hash with caching
MicroKernel / NodeStore • Tree / Revision model implementation
Accessible paths a d b c
xistentialism E • All paths traversable • Node may not exist • Decorator on NodeStore • root.getChildNode("a").exists(); • root.getChildNode("a") • .getChildNode("b").exists(); ⟹ false ⟹ true
Content diff • What changed between trees • Cornerstone for • Validation • Indexing • Observation • …
Example: merging ∆ • r1 ➞ r2a“a” modified • “b” removed r2a r1 r3 ∆ r2b • r1 ➞r2b • “d” modified • “x” added
Commit hooks • Key plugin mechanism • Higher level functionality • Validation (node type, access control, …) • Trigger (auto create, defaults, …) • Updates (index, …)
Editing a commit ∆ ∆ + x
Commit hooks • Based on content diff • pass a commit • fail a commit • edit a commit • Applied in sequence
Observers • Observe changes • After commit • Often does a content diff • Asynchronous • Optionally synchronous • Local cluster node only
Examples • JCR observation • External index update • Cache invalidation • Logging
Query Engine parse execute post process SELECT WHERE x=y Parser Index /a//* Parser Index Parser Index Parser Traverse
Index Implementations • Property (ordered) • Reference • Lucene • In-content or file system • Solr • Embedded or external
Big picture JCR API Plugins Oak JCR Oak API Oak Core NodeStore API MicroKernel
Resources http://jackrabbit.apache.org/oak/
Resources http://jackrabbit.apache.org/oak/ http://jackrabbit.apache.org/oak/docs/ https://svn.apache.org/repos/asf/jackrabbit/oak/trunk/