I have recently been asked to add connection pooling to node-db. While I confess it crossed my mind to add it as part of the generic framework, I then decided to remain true to node-db’s purpose: to provide a common framework for writing C++ based database bindings for Node.js. Therefore I’d like to show through this post just how easy it is to pool node-db connections using existing Node.js solutions. For this example, I chose generic-pool , a generic pooling solution for node.js that looks so simple yet so elegant. We wish to create an HTTP server that listens for requests, and on each request performs a database query and outputs the results back to the client.
In a previous post , we discussed how we test LinkedIn's mobile stack, including our Node.js mobile server.
Method to load a Node.js site using nginx per the gist below. The blog post contains a full walk-through of the configuration. The config proxies the HTTP traffic from the Node processes, directly handles static files so that Express doesn't have to do it, uses the nginx built-in caching, and turns on gzip. All this could be done in Node/Express, but is going to be more efficient to let Nginx do it. http://blog.argteam.com/coding/hardening-node-js-for-production-part-2-using-nginx-to-avoid-node-js-load/ https://gist.github.com/3072833
Posted by Cian Clarke on Wednesday, July 25, 2012 Back in December of 2011, our CTO Mícheál had an interesting concept: What if we tried building a developer studio on top of our Node.js Module, FHC? Here’s how we went about doing just that. Some background: Since November 2011, FeedHenry has had a Node.js module that interfaces with the FeedHenry platform.
I recently started using Node.js for a project and decided to write tests to speed up my development. After looking at a few of the testing modules I decided on Mocha and SuperTest. SuperTest makes it very easy to test HTTP endpoints and Mocha makes writing tests in general very easy.
I’m involved with a project where our ruby/rails developer dropped out, so I decided to take on the job using node.js (rather than learn rails). We initially were using services from dotCloud, but it was too flakey from day to day and our demo was coming up. For hosting, Amazon’s EC2 was the obvious candidate, but I’d have to setup and provision the entire server from scratch.
Update: There is now a follow up to this post which deals with the differences between nginx and Apache , it is recommended reading if you come from Apache: Nginx is a fairly simple HTTP server, though there are a few gotchas people need to be aware of before they start using this 8th wonder. The most important is that nginx is a reverse proxy first and HTTP server second, it does not necessarily have a concept of file, this will change the way we handle our configuration a bit.