Академический Документы
Профессиональный Документы
Культура Документы
r1: /d r2: /d
r1: /a/c
r2: /a/c
Refresh and garbage collection
refresh
garbage
Concurrency and conflicts
r2a r1 r2b
r2a
merge
r1 r3
r2b
Conflict handling strategies
a. Fully serialized commits
• fail on conflict, no concurrent updates
b. Partially serialized commits
• fail on conflict, concurrent conflict-free updates
c. Partial merge logic
• conflict markers, manual conflict resolution
d. Full merge logic
• conflicting changes may be lost
Interlude: implementations
MicroKernel/NodeStore
• Implementation of the tree/revision model
Responsible for Not responsible for
Clustering Type validation
Sharding Access control
Caching Search
Conflict handling Versioning
etc. etc.
Current implementations
DocumentMK TarMK (SegmentMK)
Persistence backends MongoDB, JDBC (WIP) Local FS (tar files)
Conflict handling Partial serialization Full serialization
Clustering MongoDB clustering Simple failover
Sharding MongoDB sharding N/A
Single-node performance Moderate High
Key use cases Large deployments (>1TB), Small/medium deployments,
concurrent writes mostly read
Replicas and sharding
Replicas and caches
“d” modified
r1 -> r2b “e” added r2b
“d” modified
“e” added
Commit hooks
If this changed, commit this instead
Commit hooks
• Based on given before and after states, a hook can:
• fail the commit, or
• pass the commit unmodified, or
• pass the commit with modifications
• Key plugin mechanism in Oak
• All configured hooks are applied in sequence
• Used for much higher level functionality
• Often implemented using a content diff
Examples
• All kinds of validation
• node types, access control, references, etc.
• Trigger-like functionality
• autocreated content, default values, etc.
• In-content index updates
• etc.
Types of hooks
CommitHook Editor Validator
/a//*
Parser Index
Parser Index
Parser Index
Query processing steps
1. Parsing
a. Select matching parser
b. Parse the query string
2. Execution
a. Estimate cost per index
b. Select index with the least cost estimate
c. Execute the query against the index
3. Post-processing
a. Filter results on access control and additional constraints
b. Apply sorting, grouping, faceting, etc.
Index implementations
• Property index
• Reference index
• Lucene index
• in-content
• local file system
• Solr index
• embedded
• external
Big picture
JCR API
Oak JCR
Oak API
NodeStore API
MicroKernel
Questions?