Document-Based Storage is an architectural abstraction in the Nuxeo Platform that allows the storage of documents in a document-oriented store, for instance NoSQL databases.

An implementation is available for MongoDB.

Nuxeo supports the following MongoDB version:

MongoDB 3.2

Installation

When using MongoDB 3.0 or higher we recommend that you configure the WiredTiger storage engine for better performance of write operations. Please follow this documentation to activate this storage engine.

Nuxeo stores its data in a MongoDB database under the default collection. The name of the collection is the Nuxeo repository name. If you have more than one repository configured, other collections with the names of these repositories will be used for storage.

By default MongoDB doesn't require authentication, but you can enable the client access control and create a user with the dbOwner role.

User Creation with Nuxeo 8.1 and MongoDB 3.x

If you are using a version 3.x of MongoDB on Nuxeo 8.1, you have to change the authentication schema before creating the users in the database. In these MongoDB versions, the default authentication mechanism is SCRAM-SHA-1 which is not supported by Nuxeo 8.1 where the MongoDB driver only supports MONGO-CR.

Note that if you are upgrading from a MongoDB 2.8 databases, you will be fine as the MONGO-CR credentials were previously created.

For new MongoDB instance use the following commands:

mongo
use admin
db.system.version.insert({ "_id" : "authSchema", "currentVersion" : 3 })

For existing MongoDB instance with users, you need to remove the user first (make sure you don't need them before) then change the authentication schema using the following commands:

mongo
use admin
db.system.users.remove({})
db.system.version.remove({})
db.system.version.insert({ "_id" : "authSchema", "currentVersion" : 3 })

Then restart the server and recreate users.

Nuxeo Configuration

To activate MongoDB document storage, add the mongodb template to your existing list of templates (nuxeo.templates) in nuxeo.conf.

If you also want to activate audit and directories storage, you need to install the MongoDB extension addon. This addon includes mongodb-audit and mongodb-directory templates in order to store respectively audit or directories data in MongoDB. For example:

 nuxeo.templates=default,mongodb,mongodb-audit,mongodb-directory

If you are not using the MongoDB extension addon, you must keep the template corresponding to your SQL database in nuxeo.templates. For instance you could have:

nuxeo.templates=postgresql,mongodb

or

nuxeo.templates=default,mongodb

The following properties are available in nuxeo.conf:

  • nuxeo.mongodb.server: The MongoDB server, either a hostname or a hostname with port or a full mongodb:// URI if you have an authentication, the pattern is: mongodb://[username:[email protected]]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] (defaults to localhost:27017)
  • nuxeo.mongodb.dbname: The MongoDB database. (defaults to nuxeo)

Using the full mongodb:// URI syntax you can configure the connection options, like the pool size, the write concern or the read preference, for instance:

nuxeo.mongodb.server=mongodb://example1.com,example2.com,example3.com/?maxPoolSize=200

See the MongoDB Connection String URI Format for the list of options.

GridFS

It is possible to use MongoDB's GridFS mechanism to store binary files inside MongoDB instead of the default filesystem mechanism of Nuxeo. This is activated by adding gridfsbinaries to the templates, for instance:

nuxeo.templates=postgresql,mongodb,gridfsbinaries

When doing this, binaries will be stored in the default.fs GridFS bucket, which means that in native MongoDB the collections default.fs.files and default.fs.chunks will be used. See the GridFS Reference for more details about MongoDB's GridFS implementation.


Related pages in current documentation
 
2 months ago Manon Lumeau Fix typo on HTTPs
3 years ago Florent Guillaume 39 | ongodb-quartz-cluste
3 years ago Solen Guitter 38
3 years ago Solen Guitter 37
4 years ago Solen Guitter 36
4 years ago Solen Guitter 35
4 years ago Benoit Delbosc 34
4 years ago Benoit Delbosc 33
4 years ago Benoit Delbosc 32
4 years ago Benoit Delbosc 31
4 years ago Solen Guitter 30 | Move warning about user creation in Confiiguration section
4 years ago Solen Guitter 29 | Update supported versions
4 years ago Benoit Delbosc 28 | 8.2 support mongo 3.2
4 years ago Gildas Lefevre 27
4 years ago Gildas Lefevre 26
4 years ago Gildas Lefevre 25
4 years ago Solen Guitter 24
4 years ago Julien Carsique 23 | NXP-18773: restored MongoDB parameters
4 years ago Julien Carsique 22 | Reverted from v. 20
4 years ago Julien Carsique 21 | NXP-18773: changed MongoDB parameters
4 years ago Florent Guillaume 20 | added gridfs
4 years ago Alain Escaffre 19
4 years ago Alain Escaffre 18
4 years ago Solen Guitter 17 | Update link, cleanup page format, update related pages
4 years ago Manon Lumeau 16
4 years ago Florent Guillaume 15
4 years ago Benoit Delbosc 14
4 years ago Benoit Delbosc 13 | Emphasis on the URI connection options
4 years ago Florent Guillaume 12
4 years ago Florent Guillaume 11 | Added nuxeo.mongodb.dbname and detailed server syntax
5 years ago Manon Lumeau 10
5 years ago RĂ©mi Cattiau 9 | As requested by Brendan
5 years ago Florent Guillaume 8
5 years ago Florent Guillaume 7
5 years ago Solen Guitter 6
5 years ago Florent Guillaume 5
5 years ago Florent Guillaume 4
5 years ago Florent Guillaume 3
5 years ago Florent Guillaume 2
5 years ago Florent Guillaume 1
History: Created by Florent Guillaume

We'd love to hear your thoughts!

All fields required