Re: [nodejs] Loadbalancing multiple MySQL connections

288 views
Skip to first unread message

Fadrizul H

unread,
Feb 6, 2013, 10:07:22 AM2/6/13
to nod...@googlegroups.com

Hi Ian,  have a look at this module called generic-pool.

https://github.com/coopernurse/node-pool

You can use it to store MySQL connections.

On Feb 6, 2013 10:55 PM, "lancore" <lanc...@gmx.net> wrote:
Hi,

I need to create a pool of connections to multiple MySQL DBs (some of them read-only), and balance the load between them.
MySQL Proxy (http://dev.mysql.com/downloads/mysql-proxy/) pretty much sounds exactly like the tool I need, but for various reasons I can't use it.

Before I implement my own solution now, I thought I'm just going to ask if there already is something similar out there I could use in node.js?

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Diogo Resende

unread,
Feb 6, 2013, 10:08:17 AM2/6/13
to nod...@googlegroups.com
A Pool feature just landed mysql module a few days ago. You can start there :)

-- 
Diogo Resende

Envy

unread,
Feb 6, 2013, 10:36:40 AM2/6/13
to nod...@googlegroups.com
The pooling will certainly help. But for the "multiple server" part I guess I have to write my own loadbalancer, at least if I want to distinguish between read-only and writable connections

Ruben Tan

unread,
Feb 7, 2013, 1:14:57 AM2/7/13
to nod...@googlegroups.com
Does it make sense to leverage existing messaging technologies like 0MQ or something instead, since most of them have built-in load-balancing?

Envy

unread,
Feb 7, 2013, 10:18:11 AM2/7/13
to nod...@googlegroups.com
That's a great start, I'll probably build on top of that! Thanks!

On Thursday, February 7, 2013 2:26:29 AM UTC+1, Bartosz Raciborski wrote:
You just inspired me to write a module for this: https://github.com/racbart/node-clusterpool

It's basically a cluster of pools. You put multiple slave servers into the cluster and there is a separate connection pool created for each server. Cluster-pool manages this and rotates requests for slave servers for you to balance load.

I am just starting with node and this is my first module, so I'd appreciate some feedback.

-- 
Bartosz Raciborski

Bartosz Raciborski

unread,
Feb 7, 2013, 8:12:29 PM2/7/13
to nod...@googlegroups.com
You should check it now. I just upgraded it to include simple load balancing (instead of round-robin rotation): https://github.com/racbart/node-clusterpool


-- 
Bartosz Raciborski

Reply all
Reply to author
Forward
0 new messages