veröffentlicht am : Mo, 18. 01. 2016 geändert am: Mo, 18. 01. 2016
We're working on a completely new Version of Morphium.This version is actually already in Alpha stage and you can download it from github, if you like.
I already wrote in the release notes something about the intention behind it here:
V3.0 is a huge refactoring and is probably not source compatible with code that was written for 2.2.x!
Morphium 3.0 brings a lot improvements and changes, most of them are not really visible to the user, but unfortunately some of them make V3.x incompatible to V2.x.
The changes were triggered by the recent mongodb java driver update to also 3.0, which brings a whole new API. This API is (unfortunately also) not backward compatible[^not quite true, the driver contains both versions actually, but old API is usually marked deprecated]. This made it hard to add the changes in the official driver into morphium. Some of the changes made it also impossible to implement some features in morphium as it was before. So - the current implementation of morphium uses both old and new API - wich will break eventually.
The next step was, to be more independent from the driver, as those changes caused problems almost throughout the whole code of morphium. So, introducing with V3.0 of morphium, the driver is encapsulated deep within morphium.
Unfortunately, even the basic document representation changed[^old version used BasicDBObject, new version uses Document`], which are very similar, but unfortunately represented in a whole new implementation of BSON (binary json - details can be found here).
Also, we had some problems with dependencies in maven, causing to be several version of the mongodb driver being installed on production - which then caused some weird effects, most of them not really good ones ;-)
This made us reduce all dependency to the mongodb driver to a minimum - actually it is only used in the MorphiumDriver implementation for the official mongodb driver. But that also meant, we needed to get rid of all usages of ObjectID and BasicDBDocument and reduce usages of that into the driver implementation within morphium.
The question was - do we need to introduces some new object type for representing a Map<String,Object>? We thought no, so we changed the whole code in morphium, to internally use only standard Java8 API.
Yes, that is one feature also, since Morphium 3.0 we‘re running on java 8.
As you know the motivation now, these are the changes.
Driver encapsulated and configurable - you can now implement your own driver for usage with morphium no usage of MongoDb classes, replaced by type MorphiumId and simple Map<String,Object> - this might actually break your code! (soon) MongoDB Dependency in maven will be set to be provided, so that you can decide, which Version of the driver you want to use (or none...) Morphium 3.0 includes some own implementation of drivers (mainly for testing purpose): - Driver: This is the Implementation of MorphiumDriver using the official Mongodb driver (V3.x) - InMemoryDriver: Not connecting to any mongo instance, just storing into memory. Good for testing. Does not support Aggregation! - SingleConnectDirectDriver: Just connecting to a master node, no failover. Useful if you do not have a replicaset - SingleConnectThreaddedDriver: Same as above, but uses a thread for reading the answers - slightly better performance in multithreaded environments, but only useful if you don't run a replicaSet - MetaDriver: A full featured implementation of the MorphiumDriver Interface, can be used as replacement for the mondogdb driver implementation. It uses a pool of SingleConnectThreaddedDriver to connect to mongodb. Many changes in the internals in references you can now specify the collection the reference should point to. improvements in the internal caches, using the new improved features and performance of Java8 (see also here) complete rewrite of the bulk operation handling code improvements on many places, including some public interfaces (might break your code!)
We're now working performance tuning everything. Thanks to the different drivers, we can exactly tell, what morphium is sending to Mongo and whether that is good or not. And - we can compare times and load! This will be a huge boost for performance, stability and flexibility.
Stay tuned for more updates on Morphium 3.0.0
And yes: there will be releases for the 2.2.x verson of Morphium as well, 2.2.24BETA1 is already available for testing on github.
erstellt Stephan Bösebeck (stephan)