tags:

views:

101

answers:

2

I recently stumbled across DBslayer (http://code.nytimes.com/projects/dbslayer/wiki/WhyUseIt) and wondered what is the actual benefit of using it as an interface to mysql.

As far as I understand, it runs as some kind of proxy for mysql and offers a HTTP / JSON interface. So? Why should I use this setup instead of connecting directly to mysql?

A: 

It sits in front of a mysql server and gives you the chance to execute queries through a REST api - so you can use it from any application without going through the headache of establishing database connections and using a driver.

It makes more sense when you need to use the database as a service that multiple apps will use or when you use something like nodejs, which makes it really easy to read and write the json that dbslayer works with.

Check out the why use it link.

Sudhir Jonathan
A: 

MySQL API call is a blocking call. What that means is your thread will wait until your db finished processing.

Such behavior is not desirable for non-blocking network framework such as node.js or Tornado Web.

One real life example of DbSlayer deployment is http://plurk.com

didip
Interesting, but how exactly is a call to DB Slayer not blocking the curren thread? I am really interested in this topic and would be happy if you could explain it to me further as you seem to have knowledge in this particular area.
Max