Connection pool for couchdb

限于喜欢 提交于 2019-12-24 17:01:15

问题


I have one couchdb database and I am querying it in parallel. Now, I want to create a connection pool, because I discovered a bottleneck in my design - I was using a single instance of couchd , so parallelization was failing due to that.

I searched the web for connection pool implementations, but I was not able to find a proper java connection pool implementation for couchdb - most of the frameworks support relational databases. I will be appreciated if someone can help me for that.


回答1:


I've never used a couchdb connection pool, but you may have some luck with this:

http://commons.apache.org/pool/

It lets you pool any old object, including connections. It'll take a few lines of code to get it working for you though.

Hope this helps, Nate




回答2:


If you are searching for a simple way to load-balance multiple CouchDB instances, why not use an HTTP load balancer like Varnish? Take a look here on how you can set up a simple round-robin load balancer. You can also disable caching if it's undesirable.



来源:https://stackoverflow.com/questions/10227213/connection-pool-for-couchdb

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