<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BPMN 2.0, NoSQL &amp; POJO questions in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28689#M14593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not aware of any work being done in this area recently.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We don't have plans to support Activiti on a MongoDB backend.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Within Alfresco we're doing stuff with MongoDB and we like it a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Sep 2011 13:55:23 GMT</pubDate>
    <dc:creator>trademak</dc:creator>
    <dc:date>2011-09-28T13:55:23Z</dc:date>
    <item>
      <title>BPMN 2.0, NoSQL &amp; POJO questions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28685#M14589</link>
      <description>Guys,I love what you have done here so far. I have a few questions&amp;nbsp; that are mostly necessitated by using a NoSQL backend (Mongo) rather then a traditional SQL repository. I have a number of business processes I want to implement and support and BPMN 2.0 seems a natural way to do so. That means that</description>
      <pubDate>Sun, 06 Jun 2010 15:18:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28685#M14589</guid>
      <dc:creator>activiti-admin</dc:creator>
      <dc:date>2010-06-06T15:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: BPMN 2.0, NoSQL &amp; POJO questions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28686#M14590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cool!&amp;nbsp; Really interesting for us.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We do target to ensure that our architecture allows for NoSQL databases as well.&amp;nbsp; Thought that work needs to start and your input is very welcome. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's our ideas on the topic:&amp;nbsp; The PersistenceSession should be refactored (if necessary) so that e.g. a MongoDbPersistenceSession can be implemented.&amp;nbsp;&amp;nbsp;&amp;nbsp; The first step that we should do is to implement a JSON serialization of the runtime process instance data structures.&amp;nbsp; There is some work started on that in package org.activiti.json Then the mongo db persistence session can serialize a whole process instance as a text string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To what extend can Mongo DB give concurrency control?&amp;nbsp; Currently we delegate concurrency control to the DB as well.&amp;nbsp; All runtime updates are guarded with optimistic locking.&amp;nbsp; That way processes executed on Activiti can be seen as specifying transactional control flow.&amp;nbsp;&amp;nbsp;&amp;nbsp; The process executes in discrete steps (=transactions) form one state to the another.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So we need to figure out how we want to deal with situations like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When a job needs to be executed, we currently use optimistic locking to prevent that multiple job executors start executing the same job.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Another example: if two operations occur on different nodes in the cloud, (potentially in concurrent paths of execution), how would that conflict be resolved when those updates meet each other in the cloud.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know what options we have in that respect on MongoDB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We also have been thinking about an in-memory locking server/cluster.&amp;nbsp; The function would be to obtain a global lock on a certain process instance.&amp;nbsp; Because all locked process instances are kept in memory, it could make sure that it's fast and still scales.&amp;nbsp; Making that a cluster of e.g. 3 nodes could provide failover.&amp;nbsp; All commands in the Activiti API that operate on a process instance could obtain a lock for the duration of the command.&amp;nbsp;&amp;nbsp; This could be combined with storing the JSON serialized process instances in a big-table like cloud persistence solution.&amp;nbsp; That way users would still get transactional control flow semantics from Activiti.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;WDYT?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jun 2010 08:35:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28686#M14590</guid>
      <dc:creator>tombaeyens</dc:creator>
      <dc:date>2010-06-09T08:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: BPMN 2.0, NoSQL &amp; POJO questions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28687#M14591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Here's our ideas on the topic:&amp;nbsp; The PersistenceSession should be refactored (if necessary) so that e.g. a MongoDbPersistenceSession can be implemented.&amp;nbsp;&amp;nbsp;&amp;nbsp; The first step that we should do is to implement a JSON serialization of the runtime process instance data structures.&amp;nbsp; There is some work started on that in package org.activiti.json Then the mongo db persistence session can serialize a whole process instance as a text string.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I like the thinking here. In general, with NoSQL, you want single complex objects rather then normalized single tables. I do think most of your thinking here is targeted around CouchDB rather then MongoDB. CouchDB uses JSON, Mongo uses Java annotations and simple objects to communicate (although it also can serialize objects to JSON, but de-serializing is more dicey). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think both should be supported, but will also be honest and say that the performance of CouchDB is extremely poor, and may not be a good choice for this technology.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;To what extend can Mongo DB give concurrency control?&amp;nbsp; Currently we delegate concurrency control to the DB as well.&amp;nbsp; All runtime updates are guarded with optimistic locking.&amp;nbsp; That way processes executed on Activiti can be seen as specifying transactional control flow.&amp;nbsp;&amp;nbsp;&amp;nbsp; The process executes in discrete steps (=transactions) form one state to the another.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;In a single node configuration, concurrency control is fairly solid if you think about it before. You can also use optimistic locking on fields, and there are a ton of atomic options you can use to append data/upsert data. However, once you start to scale out, the concept of eventual consistency is the mortal enemy of strict SQL style locking. Mongo only supports master-slave replica's so there isn't a issue where you could overwrite by accident, but it's always possible that a replicated slave could read a incomplete (not updated yet) object. The newest version of Mongo permits you to block on a write until it's propagated out to the boonies. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is a bit different with Couch since couch uses MVCC, and all nodes can be master or slave. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In general, I think a approach of appending the work flow may work better then changing state on a object. Basically you would have something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;{"Session":"SessionKey",&lt;BR /&gt;"Flow":"requestNewFeature"&lt;BR /&gt;" Roles": ["user":"Josh", "Role"requestFeature", "activitiesCompleted" : [{"start":infoOnStart},{"ThinkAboutANewFeature":"NoSQL rocks"}, {"registerAccountOnForum":"account:JoshuaP, post ="Let's do cool new things"}, {"postOnBoard":"think about mongo"},&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "user":"tombaeyens", "Role"CreatorOfActiviti", "activitiesCompleted" : [{"postOnBoard":"whatAboutLocking?"}]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ] &lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In this scenario, you would need a globally meaningful session key that would encapsulate all information regarding a particular session. It might be as simple as "user-process" but it might need to be more complex depending on what scenario's you want to use. &lt;BR /&gt;&lt;BR /&gt;Why use this type of structure?&lt;BR /&gt;1) Get everything we need to know about a session in a single I/O call.&lt;BR /&gt;2) Can append to nested structures (for example, Session.Roles.Josh.activitiesCompleted[]) dynamically. &lt;BR /&gt;3) Append only is lock friendly.&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So we need to figure out how we want to deal with situations like this:&lt;BR /&gt;When a job needs to be executed, we currently use optimistic locking to prevent that multiple job executors start executing the same job.&amp;nbsp; &lt;BR /&gt;Another example: if two operations occur on different nodes in the cloud, (potentially in concurrent paths of execution), how would that conflict be resolved when those updates meet each other in the cloud.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;With Mongo, you only have a single master. You can do a check to make sure that a similar process doesn't exit prior to running:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;db.sessions.update({sessionKey: 15, {$not:{$exists:{status:1}}}}, { $set : {status : "start" } }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;Again, you can also do a append to a existing object, which I think is a bit cleaner.&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;We also have been thinking about an in-memory locking server/cluster.&amp;nbsp; The function would be to obtain a global lock on a certain process instance.&amp;nbsp; Because all locked process instances are kept in memory, it could make sure that it's fast and still scales.&amp;nbsp; Making that a cluster of e.g. 3 nodes could provide failover.&amp;nbsp; All commands in the Activiti API that operate on a process instance could obtain a lock for the duration of the command.&amp;nbsp;&amp;nbsp; This could be combined with storing the JSON serialized process instances in a big-table like cloud persistence solution.&amp;nbsp; That way users would still get transactional control flow semantics from Activiti.&lt;BR /&gt;WDYT?&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Yeah, we took this approach on a very large scale (10k TPS+) system that we built. We didn't actually hard locked, but instead shared a sessionKey structure that was locked that prevented us from making changes to the same key at the same time. I would pull a Knuth here and say that locks are a bit symptomatic about of a failure to figure out a good algorithm.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jun 2010 15:31:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28687#M14591</guid>
      <dc:creator>joshuap</dc:creator>
      <dc:date>2010-06-09T15:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: BPMN 2.0, NoSQL &amp; POJO questions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28688#M14592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@ Joshua,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;we are looking at implementing Activiti with a MongoDB backend. Did you get any further in this regard since last year?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@Tom Baeyens,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any statement of direction since last year from your point of view?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greatly appreciated,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ronald&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 12:39:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28688#M14592</guid>
      <dc:creator>ronaldbrinkerin</dc:creator>
      <dc:date>2011-09-28T12:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: BPMN 2.0, NoSQL &amp; POJO questions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28689#M14593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not aware of any work being done in this area recently.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We don't have plans to support Activiti on a MongoDB backend.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Within Alfresco we're doing stuff with MongoDB and we like it a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 13:55:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpmn-2-0-nosql-pojo-questions/m-p/28689#M14593</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2011-09-28T13:55:23Z</dc:date>
    </item>
  </channel>
</rss>

