Best practice for managing OrientDB connections in Express.js / Web Applications

604 views Asked by At

What is the recommended way to manage OrientDB connections in Express.js or any web application for that matter? Connection per request? Would be using the oriento Node.js driver

1

There are 1 answers

4
Dário On

If you are using Oriento, you can try connection pooling, as per PR #7 you can set it like this:

var server = Oriento({
  user: 'root',
  password: 'foo',
  pool: {
    max: 10 // use a maximum of 10 sockets in the pool
  }
});

Please bear in mind that at some point connection pooling config was hidden from Oriento's README due to issues with thread safety [...] in orientdb (reference). You may want to clear that before using it.