Apache Jackrabbit Oak Documentation

repository·trunk·Indexed 19 days ago

https://github.com/apache/jackrabbit-oak

A scalable, high-performance hierarchical content repository for modern web sites and content applications. Documentation covers the core API (ContentRepository, ContentSession, Root, and Tree), the oak-blob module for binary data management, and detailed guides on running and implementing micro-benchmarks and scalability suites, including Elasticsearch integration benchmarks.

Tokens
234.6K
Snippets
406
Records
896
Agent score
64%

What's inside Apache Jackrabbit Oak

  1. Overview of Jackrabbit Oak components

    trunk

    The Jackrabbit Oak project is composed of several modules providing different functionalities, APIs, and integrations:

    • oak-parent: Parent POM.
    • oak-doc: Oak documentation.
    • oak-commons: Shared utility code.
    • oak-core: Oak repository API and implementation.
    • oak-jcr: JCR (Java Content Repository) binding for the Oak repository.
    • oak-sling: Integration with Apache Sling.
    • oak-http: HTTP binding for Oak.
    • oak-lucene: Lucene-based query index.
    • oak-run: Runnable JAR packaging.
    • oak-pojosr: Integration with PojoSR.
    • oak-segment-tar: TarMK API and implementation.
    • oak-upgrade: Tooling for upgrading Jackrabbit repositories to Oak.
    • oak-it: Integration tests (including oak-it/osgi for OSGi tests).
    • oak-exercise: Oak training material.
  2. Overview of Oak Runnable Jar runmodes

    trunk

    The oak-run-*.jar is a utility containing various runmodes for managing, maintaining, and inspecting Oak repositories. Common runmodes include:

    • Maintenance: backup, compact, checkpoints, datastore, garbage, revisions, tika.
    • Inspection & Debugging: console, debug, explore, history, iotrace, documentstore-check.
    • Migration & Upgrades: upgrade (Jackrabbit 2.x to Oak), datastorecacheupgrade, unlockUpgrade.
    • Data Operations: export (to JSON), restore, recovery.
    • Specialized Scanning: frozennoderefsbyscanning, frozennoderefsusingindex (for nt:frozenNode references).

    Note: Features specifically for Jackrabbit 2.x are provided in the oak-run-jr2 jar.

  3. Overview of Jackrabbit Oak

    trunk

    Jackrabbit Oak is a scalable and performant hierarchical content repository designed to serve as a foundation for modern, high-demand content applications and websites. It is part of the Apache Jackrabbit project and is engineered to address the needs of distributed, loosely coupled, and multi-platform architectures that require horizontal scaling.

    Key characteristics include:

    • Standard Compliance: Implements standards such as JCR (Content Repository API), WebDAV, and CMIS.
    • Accessibility: Designed to be easily accessible from various platforms, with specific support for JavaScript clients in modern browser environments.
    • Performance: Aims to provide more out-of-the-box functionality than typical NoSQL databases while maintaining comparable levels of scalability and performance.
  4. Overview of repository migration tools in Oak

    trunk

    Apache Jackrabbit Oak provides specialized tools for migrating legacy Jackrabbit 2 repositories and moving content between Oak instances:

    • oak-upgrade: A versatile tool designed for copying content between virtually any repository types.
    • SplitBlobStore: A tool used to copy binaries gradually from one blob store to another. This approach is intended to minimize repository downtime during the migration process.
  5. Overview of the Oak Blob module

    trunk
    The oak-blob module provides the core interfaces and common base functionality for managing large binary data (blobs) within the Jackrabbit Oak content repository. It defines how binaries are read from and written to various blob store implementations, ensuring a consistent abstraction for handling large files across different storage backends.
  6. Overview of Oak project components

    trunk

    The Oak project is organized into several functional modules:

    Core API & Implementation

    • oak-parent: Parent POM
    • oak-api: Oak repository API
    • oak-core: Oak repository implementation
    • oak-core-spi: Oak repository extensions
    • oak-jcr: JCR binding for the Oak repository
    • oak-commons: Shared utility code
    • oak-lucene: Lucene-based query index

    Authentication & Authorization

    • oak-auth-external: External authentication support
    • oak-auth-ldap: LDAP implementation of external authentication
    • oak-authorization-cug: Authorization model for closed user groups (CUG)

    Blob Storage

    • oak-blob: Oak Blob Store API
    • oak-blob-plugins: Oak Blob extensions and base implementations
    • oak-blob-cloud: S3 cloud blob store implementation
    • oak-blob-cloud-azure: Azure cloud blob store implementation

    NodeStore & Storage SPI

    • oak-store-spi: Oak NodeStore and Commit SPI
    • oak-segment-tar: TarMK API and nodestore implementation
    • oak-store-document: Oak DocumentNodeStore implementation on MongoDB and RDB
    • oak-store-composite: CompositeNodeStore implementation

    Tooling, Running & Benchmarking

    • oak-upgrade: Tooling for upgrading Jackrabbit repositories to Oak and sidegrading Oak to Oak
    • oak-run: Runnable jar packaging
    • oak-run-commons: Utilities shared by oak-run and oak-benchmarks
    • oak-benchmarks: Benchmark tests
    • oak-it: Integration tests
    • oak-it-osgi: Integration tests for OSGi
    • oak-http: HTTP binding for Oak
    • oak-pojosr: POJO-based repository access

    Learning & Examples

    • oak-exercise: Oak training material
    • oak-examples: Oak examples (webapp and standalone)
  7. Access Jackrabbit repositories via servlets

    trunk

    The Jackrabbit Web Application component provides several servlets to interact with a Jackrabbit repository. These include:

    • RepositoryAccessServlet.java: Used for general repository access.
    • LoggingServlet.java: Provides logging capabilities.
    • RepositoryStartupServlet.java: Handles repository startup processes.
  8. Use Oak Jackrabbit API for implementation-specific functionality

    trunk
    The oak-jackrabbit-api component provides interface extensions that Apache Jackrabbit and Jackrabbit Oak support beyond the standard JCR (Java Content Repository) API. Use these interfaces when you need to access features or functionality that are specific to the Jackrabbit/Oak implementations and are not covered by the standard JCR specification.
  9. Understand the Oak Security Layer architecture

    trunk

    The Oak Security Layer is composed of several distinct functional areas that manage how users access the content repository. To implement a secure system, you must configure and understand four primary pillars:

    1. Authentication: Verifying the identity of a user (e.g., via tokens, LDAP, or external login modules).
    2. Authorization: Determining if an authenticated user has permission to perform specific actions on repository items.
    3. Principal Management: Managing the identities (users and groups) that can be authenticated.
    4. User Management: Handling user lifecycles, including group memberships, password policies (expiry, history), and searching for users/groups.

    Security can be extended via custom implementations for token management, external identity synchronization (LDAP), and advanced authorization models like Closed User Groups (CUG) or Principal-based access.

  10. Run Oak in a POJO environment using Oak PojoSR

    trunk

    Oak PojoSR allows you to run Apache Jackrabbit Oak outside of a full OSGi environment while still leveraging OSGi-style configuration for Oak components. It uses PojoSR to provide the necessary OSGi framework support.

    Required Dependencies

    To use this module, you must include the following dependencies in your project:

    1. PojoSR: Provides the OSGi framework support.
    2. Apache Felix SCR: Service Component Runtime.
    3. Apache Felix Config Admin: Configuration Administration.
    4. Apache Felix Fileinstall: For provisioning configuration files.
  11. Understand the Oak Cache API Migration Plan

    trunk

    The Oak Cache API migration aims to decouple Jackrabbit Oak from direct dependencies on Guava and Caffeine. The goal is to introduce an Oak-owned cache API within oak-core-spi that abstracts all implementation details (such as CacheLIRS or Caffeine).

    Key architectural principles include:

    • Abstraction: No module outside oak-core-spi should reference Caffeine or Guava cache types directly.
    • Uniformity: Both CacheLIRS (via asOakCache()) and CaffeineCacheAdapter (via CacheBuilder) implement the Cache interface, allowing call sites to remain uniform regardless of the backend.
    • Implementation: CacheBuilder is the primary way to create new caches, and it currently creates Caffeine-backed instances.
    • Migration Strategy: Modules migrate to the org.apache.jackrabbit.oak.cache.api package. Test code must be migrated alongside production code to ensure no org.apache.jackrabbit.guava.common.cache references remain in a module.