Content Repository

DBS - MongoDB

Updated: July 17, 2023

DBS (Document-Based Storage) allows storage of Nuxeo documents inside a document-oriented store, like MongoDB.

 

Basic Storage

When configured for use with MongoDB, each Nuxeo document is stored as a single MongoDB document.

A sample document could look like:

{
    "_id" : ObjectId("542e9bd23004722355960895"),
    "ecm:id" : "612d0632-e12a-4374-88de-d6bd005bdcdc",
    "ecm:parentId" : "399afabc-1eb5-4650-9049-b59d6da8d989",
    "ecm:primaryType" : "Workspace",
    "ecm:name" : "Records",
    "ecm:lifeCyclePolicy" : "default",
    "ecm:lifeCycleState" : "project",
    "ecm:majorVersion" : NumberLong(0),
    "ecm:minorVersion" : NumberLong(0),
    "ecm:acp" : [
        {
            "name" : "local",
            "acl" : [
                {
                    "grant" : true,
                    "perm" : "Everything",
                    "user" : "Administrator"
                },
                {
                    "grant" : true,
                    "perm" : "Read",
                    "user" : "members"
                }
            ]
        }
    ],
    "ecm:ancestorIds" : [
        "00000000-0000-0000-0000-000000000000",
        "1506bf11-4cb0-4ad4-94e3-ab0c1672c6c0",
        "399afabc-1eb5-4650-9049-b59d6da8d989"
    ],
    "ecm:racl" : [
        "Administrator",
        "members"
    ],
    "ecm:fulltextSimple" : "img folder green png administrator administrator records administrator records",
    "ecm:fulltextBinary" : "toto",
    "icon" : "/img/folder_green.png",
    "dc:title" : "Records",
    "dc:description" : "",
    "dc:created" : ISODate("2014-10-03T12:51:30.542Z"),
    "dc:creator" : "Administrator",
    "dc:modified" : ISODate("2014-10-03T12:51:30.542Z"),
    "dc:lastContributor" : "Administrator",
    "dc:contributors" : [
        "Administrator"
    ],
    "my:attachedFile" : {
        "vignettes" : [
            {
                "content" : {
                    "length" : NumberLong(4),
                    "data" : "c30e7a7827dd9a8c9dd62af48e67c846",
                    "mime-type" : "plain/text",
                    "name" : "file.txt"
                },
                "height" : NumberLong(0),
                "width" : NumberLong(0),
                "label" : "vignettelabel"
            }
        ],
        "name" : "somename"
    }
}

Schema Properties

For user-defined schemas (and regular Nuxeo schemas, like dublincore), properties are stored as you would expect in JSON:

  • Regular properties directly (like dc:title).
  • List properties as lists (like dc:contributors).
  • Complex properties as JSON sub-document (like my:attachedFile).
  • Lists of complex properties as lists of JSON sub-documents (like my:attachedFile.vignettes).
  • Binaries as a JSON sub-document containing a digest value or a Blob Provider key (like content.data) and other metadata (content.mime-type, etc.).

System Properties

A number of expected system properties are also present: ecm:id, ecm:parentId, ecm:name, ecm:posecm:primaryType, ecm:majorVersion, etc. You'll find a full list as constants in the DBSDocument class.

The ecm:acp complex property represents the ACP defined on the document.

There are also some fulltext-related properties: ecm:fulltextSimple and ecm:fulltextBinary, which are tied to a MongoDB text index.

A few system properties are computed from others in order to get efficient subtree searches and efficient security checks. They are:

  • ecm:ancestorIds: the list of ancestors for the document
  • ecm:racl: the list of identities having read access to the document

Proxies

Proxies cannot be queried and retrieved with a JOIN (contrary to VCS), so they are stored as copies of the documents they point to, and are updated every time their target changes. In order to do this, some properties are maintained on proxies and proxy targets:

  • ecm:proxyTargetId: the target of the proxy

  • ecm:proxyIds: the proxies that target this document

Storage Restrictions

Due to the nature of the MongoDB storage, we use a transaction model equivalent to Read Uncommitted, which means that a transaction may read data written but not yet committed by another transaction. This is unavoidable in most Document-Based stores, and should be taken into account by applications.

Full-text configuration is fixed to a default useful for evaluation (all textual fields and blobs are indexed), but a production instance should use Elasticsearch with a suitable full-text configuration.

Not Yet Implemented

The following features are planned but are not yet implemented as of Nuxeo Platform 7.10:

 


Related Documentation