Does node.js support 2 phase commit for multiple data sources(such as 2 MySQL instances)?

Skip to first unread message

Feb 23, 2014, 11:06:08 AM2/23/14
  I wonder whether node.js support two phase commit(we have to split data in different Database due to the data size or not). I saw Sequelize has supported transaction. If not, is there a plan when it will be supported?


Aria Stewart

Feb 23, 2014, 11:25:16 AM2/23/14
That's not exactly something node provides itself: That's a protocol between
you and the databases.

MySQL supports this with its XA Transactions, purely within the MySQL command
language itself; other databases vary.

I don't know of many (any, but I've not looked hard) layers on top of databases
that support it -- but you can usually make it work if you can get access to
the low-level database handles for those fancier layers.


fred wang

Feb 23, 2014, 11:08:23 PM2/23/14
Aria, You might be right,  transaction manager to support XA might not something node.js provide but I would like to know where to support in Javascript stack.
Let me be more specific, because we have to use different data sources(you can image one is MySQL, the other one is PG) when we want to use Nodes.js , so distributed transaction support is important and single Database driver is not sufficient. I saw Serialize support transaction but my understanding is that it only support one data source.  I am looking for something in Javascript which is some container supporting JTA in Java.
Thanks anyway for the help. Any others have any insights to share?


Feb 24, 2014, 2:39:36 PM2/24/14
Hey Fred,

Yes you're right, not just node but just about languages/platforms that have some form of transaction management is single source oriented.  2PC continues to be a beast and the use case becomes even more visited with needing to coordinate between different data stores.  At StrongLoop we have a "modern" ODM (datasource juggler) that abstracts data into models (value objects) across multiple data sources (rdbms, nosql, etc...) and we have transaction management as a feature for consideration on our roadmap.  Would you have some time to connect and chat about your use case?


StrongLoop makes it easy to develop APIs in Node and gain valuable insights into your apps. Getting started is easy via an npm install.

fred wang

Feb 25, 2014, 2:05:23 AM2/25/14
   It is real-time transaction system like banking money transfer from account A to B. Because the sizing of accounts, it couldn't be put in a single DB so we could not use serialize to achieve the goal.  Java/J2EE seems to support this, SOA and enterprise development requirement better. Sure, we can connect and talk on gtalk.

Job Board:
Posting guidelines:
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit
To unsubscribe from this group and all its topics, send an email to
For more options, visit


Feb 27, 2014, 10:15:59 PM2/27/14
awesome - pls send me your GTalk/Mail id to al @  look forward to chatting with you, thanks Fred!


Aug 3, 2020, 5:34:42 PM8/3/20
to nodejs
Does nodejs support two phase commit?
Does anyone has any repo to look for XA transactions? 
Reply all
Reply to author
0 new messages