OrientDB News: Parallel Transactions

68 views
Skip to first unread message

Luca Garulli

unread,
Jul 20, 2016, 11:34:31 AM7/20/16
to orient-...@googlegroups.com
Hi guys,

This email is to keep you posted about the news on the development of OrientDB. 

Starting from v2.2.4 we introduced parallel transactions.

Before v2.2.4, transactions acquire an exclusive lock on the storage, so no matter if you have 1 or 100 cores, the execution was serialized. Now transactions are executed in parallel only if they involve different clusters (files).

So, having 16 cores, you could set ALTER DATABASE MINIMUMCLUSTERS 16, so all the classes that you create after this command will have 16 clusters (files) per class. Now, if you have 16 threads, or 16 clients (if you are working with remote protocol and any non Java/Scala driver) you could bind the thread/client to a cluster id. Example:

Client 1:

BEGIN
LET v1 = CREATE VERTEX V CLUSTER v_1 SET name = 'Luca'
LET v2 = CREATE VERTEX V CLUSTER v_1 SET name = 'Austin'
CREATE EDGE e CLUSTER e_1 FROM $v1 TO $v2
COMMIT RETRY 10

Client 2:

BEGIN
LET v1 = CREATE VERTEX V CLUSTER v_2 SET name = 'Luca'
LET v2 = CREATE VERTEX V CLUSTER v_2 SET name = 'Austin'
CREATE EDGE e CLUSTER e_2 FROM $v1 TO $v2
COMMIT RETRY 10

In this case the 2 transactions go in parallel, because they work on different clusters: _1 for the 1st client and _2 for the 2nd.

If you have experienced poor performance with transaction, it's time to use this powerful enhancement!


Best Regards,

Luca Garulli
Founder & CEO

scott molinari

unread,
Jul 21, 2016, 1:22:22 AM7/21/16
to OrientDB
Does this mean the machines running in a distributed cluster will all need to be the same in terms of cores for ODB to work right and fast?

Scott

Luca Garulli

unread,
Jul 21, 2016, 2:13:07 AM7/21/16
to OrientDB
In order to run fast and use the parallelism yes. But you can still have different machines with 4-8-16 cores, but the machine with less core could be the bottleneck.

Best Regards,

Luca Garulli
Founder & CEO


On 21 July 2016 at 00:22, 'scott molinari' via OrientDB <orient-...@googlegroups.com> wrote:
Does this mean the machines running in a distributed cluster will all need to be the same in terms of cores for ODB to work right and fast?

Scott

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

scott molinari

unread,
Jul 21, 2016, 2:40:30 AM7/21/16
to OrientDB
In the world of VMs and IaaS, I don't think putting up exact nodes should be an issue. 

However, what happens, if a class created with 8 clusters, is moved to a new VM with more cores? Is the class then stuck on 8 clusters? Or can ODB create and redistribute the data into any new clusters automatically? 

Scott

Luca Garulli

unread,
Jul 21, 2016, 10:08:28 AM7/21/16
to OrientDB
Once the class is created, the cluster are created under the hood, so no matter if you copy the database on a Raspberry PI device: the cluster count is done and they never change unless you add new clusters manually.

About the version it's 2.2.5 and not 2.2.4, sorry for the typo.

Best Regards,

Luca Garulli
Founder & CEO


--
Reply all
Reply to author
Forward
0 new messages