开发者

DBSlayer - what does it actually do?

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?


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜