Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "CDO/MongoDB Store"

< CDO
(cdo-server.xml)
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
The CDO MongoDB store is an implementation of a CDO Store that allows to store models and meta models to [http://www.mongodb.org/ MongoDB] databases.
 
The CDO MongoDB store is an implementation of a CDO Store that allows to store models and meta models to [http://www.mongodb.org/ MongoDB] databases.
  
The current implementation supports all [http://www.eclipse.org/cdo/documentation/relnotes_40/relnotes-4.0.html CDO 4.0] features with the following exceptions:
+
The current implementation has been developed and tested with MongoDB 1.6.5. It supports all [http://www.eclipse.org/cdo/documentation/relnotes_40/relnotes-4.0.html CDO 4.0] features with the following exceptions:
  
 
* NoExternalReferences (hence no meta references)
 
* NoExternalReferences (hence no meta references)
Line 7: Line 7:
 
* NoLargeObjects
 
* NoLargeObjects
 
* NoFeatureMaps
 
* NoFeatureMaps
* NoHandleRevisions
+
* NoHandleRevisions (hence no OCL support)
 
* NoRawAccess (hence no offline support)
 
* NoRawAccess (hence no offline support)
 
* NoBranching
 
* NoBranching
 
* NoCrashRecovery
 
* NoCrashRecovery
  
This document will help users setup their environment and configure CDO to work with MongoDB.
+
Due to the lack of transactionality in MongoDB CDO's MongoDB store is implemented as a ''delta store''. This means that a single CDO commit with all its change deltas is stored in a single MongoDB document. It may result in unexpected DB size and performance characteristics, e.g., the DB never shrinks (all history is kept) and write access is faster than read access (the state of a single object is assembled from the changes of multiple commit documents).
 +
 
 +
The remainder of this document will help users setup their environment and configure CDO to work with MongoDB.
 +
 
 +
== Database Server ==
 +
 
 +
Windows Example:
 +
 
 +
    C:\Programs\MongoDB\bin\mongod.exe --dbpath "C:\develop\ws\cdo\databases\specificDB" --noauth --rest
 +
 
 +
== Driver Bundle ==
 +
 
 +
The MongoDB driver bundle that is shipped with CDO is '''not identical''' to the one that is originally distributed via [http://www.mongodb.com mongodb.com]. The [http://dev.eclipse.org/svnroot/modeling/org.eclipse.emf.cdo/trunk/plugins/com.mongodb/src/org/bson/io/UTF8Encoding.java UTF-8 conversion class] had to be replaced by a version that uses the JRE mechanism to fulfill the legal requirements of the Eclipse Foundation. Performance degradation or misbehaviour may result. It is highly recommended that you download and deploy the original version of the MongoDB driver via
 +
[http://www.mongodb.org/display/DOCS/Java+Language+Center MongoDB Java Language Center].
  
 
== cdo-server.xml ==
 
== cdo-server.xml ==
  
    <store type="mongodb">
+
The <code>type</code> identifier of the [[CDO/Server Configuration Reference#Element_store|store configuration]] is <code>"mongodb"</code>:
<property name="uri" value="mongodb://localhost"/>
+
 
<property name="db" value="specificDB"/>
+
  <store type="mongodb">
<property name="drop" value="false"/>
+
    <property name="uri" value="mongodb://localhost"/>
    </store>
+
    <property name="db" value="specificDB"/>
 +
    <property name="drop" value="false"/>
 +
  </store>
 +
 
 +
The <code>"db"</code> property is optional. If omitted, the repository name is used as MongoDB database name.
 +
 
 +
The <code>"drop"</code> property is optional. If the value is <code>"true"</code> the MongoDB database is dropped before the store is activated.
  
  
 
----
 
----
 
Wikis: [[CDO]] | [[Net4j]] | [[EMF]] | [[Eclipse]]
 
Wikis: [[CDO]] | [[Net4j]] | [[EMF]] | [[Eclipse]]

Latest revision as of 02:50, 10 May 2017

The CDO MongoDB store is an implementation of a CDO Store that allows to store models and meta models to MongoDB databases.

The current implementation has been developed and tested with MongoDB 1.6.5. It supports all CDO 4.0 features with the following exceptions:

  • NoExternalReferences (hence no meta references)
  • NoQueryXRefs (hence no ensureReferentialIntegrity)
  • NoLargeObjects
  • NoFeatureMaps
  • NoHandleRevisions (hence no OCL support)
  • NoRawAccess (hence no offline support)
  • NoBranching
  • NoCrashRecovery

Due to the lack of transactionality in MongoDB CDO's MongoDB store is implemented as a delta store. This means that a single CDO commit with all its change deltas is stored in a single MongoDB document. It may result in unexpected DB size and performance characteristics, e.g., the DB never shrinks (all history is kept) and write access is faster than read access (the state of a single object is assembled from the changes of multiple commit documents).

The remainder of this document will help users setup their environment and configure CDO to work with MongoDB.

Database Server

Windows Example:

   C:\Programs\MongoDB\bin\mongod.exe --dbpath "C:\develop\ws\cdo\databases\specificDB" --noauth --rest

Driver Bundle

The MongoDB driver bundle that is shipped with CDO is not identical to the one that is originally distributed via mongodb.com. The UTF-8 conversion class had to be replaced by a version that uses the JRE mechanism to fulfill the legal requirements of the Eclipse Foundation. Performance degradation or misbehaviour may result. It is highly recommended that you download and deploy the original version of the MongoDB driver via MongoDB Java Language Center.

cdo-server.xml

The type identifier of the store configuration is "mongodb":

 <store type="mongodb">
   <property name="uri" value="mongodb://localhost"/>
   <property name="db" value="specificDB"/>
   <property name="drop" value="false"/>
 </store>

The "db" property is optional. If omitted, the repository name is used as MongoDB database name.

The "drop" property is optional. If the value is "true" the MongoDB database is dropped before the store is activated.



Wikis: CDO | Net4j | EMF | Eclipse

Back to the top