I just pushed node.dbslayer.js to GitHub, a very basic and easy-to-use interface to DBSlayer.
What is DBSlayer?
The DBacesslayer aka DBSlayer is a lightweight database abstraction layer suitable for high-load websites where you need the scalable advantages of connection pooling. Written in C for speed, DBSlayer talks to clients via JSON over HTTP, meaning it’s simple to monitor and can swiftly interoperate with any web framework you choose.
Developed by the New York Times to distribute the load of their MySQL servers, DBSlayer allows us to perform queries in a non-blocking way. Running a SQL query is as simple as:
connection.query("SELECT * FROM TABLE").addCallback(function(result){
for (var i = 0, l = result.ROWS.length; i < l; i++){
var row = result.ROWS[i];
// do something with the data
}
});
Have fun!
if ( comments_open() ) { ?>
22 Comments
Pingback: Accessing a MySQL database from Node.JS « Devthought « Voodoo Tiki God
Pingback: links for 2009-12-10 « Breyten’s Dev Blog
Pingback: What We’re Trolling - Open Blog - NYTimes.com
how can I make mysql connection from a .js file
Pingback: Node.js – стиль и фреймворки « Ме
asdfasdf
Cool :) Does DBSlayer affects performance? Will binary connector to MySQL be much faster?
what about Join Select request? its easy to crash the server with connections like this or does it exist some requestrules in the backend?
Thanks for releasing this.
For anyone looking to use this with the latest version of Node.js (version 0.1.30), I’ve updated Guillermo’s driver to work with the new way events are handled.
To grab my forked version:
git clone git@github.com:shoeman22/node.dbslayer.js.git
having a permission problem cloning that fork…
Thank you to both the original author and Andy Schuler for posting an update. Just got this all set up on my system and I love the potential here.
And this is why I love devthought.com. Increfible post.
is this for real wooo that’s awesome…
Hi, I am mufti from blogfreakz.com, Can you tell me the License please..
wow , really good !
thank you~
thank you~
this is something i was searching for quite some long…
can you pack it all in one single tar.gz so that we can unzip it and run?? would like to see the package with dependencies as well…i would owe you a big favour.
dfsdfsdf
Pingback: DBSlayer – Accessing a MySQL database from Node.JS | codeManiac - Snippets, Templates, API and the best developer content