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

て烟熏妆下的殇ゞ 提交于 2020-01-03 04:43:12

问题


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:


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.



来源:https://stackoverflow.com/questions/30522999/best-practice-for-managing-orientdb-connections-in-express-js-web-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!