New driver considerations
Since pg-promise is now the underlying driver, I wanted to make a quick list of useful considerations.
Monitoring Queries
As Massive
constructor accepts the third parameter to configure pg-promise
, it means you have access to lots of useful options that can be set there. More interestingly, one can now attach pg-monitor to the object and see all the queries that Massive
executes in a nice way.
Stack Tracing
One of the most important aspects of development with promises - Long Stack Traces, necessary to be able to pinpoint any issue in the application. Without Long Stack Traces it is often impossible. Bluebird is the best library for that today, see Long Stack Traces. You can set Bluebird as the promise library of choice for the pg-promise driver, see option promiseLib.
Version 6.x
Version 6.x of pg-promise has been in active development recently, to allow use of the new pool strategies supported by node-postgres 6.x. And the current Beta 6.0.10 is already quite stable.
One of the best examples of the advantages provided by this version is that you can configure your database layer according to the design / business requirements for the access priority, like this:
var dbLowPriority = pgp({....poolSize: 2});
var dbMediumPriority = pgp({....poolSize: 5});
var dbHighPriority = pgp({....poolSize: 10});
This can really change things in a busy environment, setting the pool size according to the requirements for the load / priority.