简体   繁体   English

我应该使用哪个连接池?

[英]Which Connection Pool should I Use?

I have web service designed for Mobile applications. 我有专为移动应用程序设计的Web服务。 This web service accesses the MySQL database. 该Web服务访问MySQL数据库。

There may be many users who runs the mobile app say 100000 concurrent. 可能有许多运行该移动应用程序的用户说100000个并发。

I am very much in confusing that which Connection Pool should I use for MySQL database connectivity in JDBC. 我非常困惑应该为JDBC中的MySQL数据库连接使用哪个连接池。 Please guys suggest me reliable, faster, easier and efficient connection pool to be used. 大家建议我使用可靠,更快,更轻松和有效的连接池。

Thanks in advance. 提前致谢。

100k concurrent mobile application users usually does not mean 100k concurrent database connections. 10万个并发移动应用程序用户通常并不意味着10万个并发数据库连接。 In fact, that is almost never the case for a web service. 实际上,Web服务几乎绝不是这种情况。 The reason for having a pool is so that connections can be shared efficiently between users/sessions (or between multiple service requests to the database.) 拥有池的原因是,可以在用户/会话之间(或对数据库的多个服务请求之间)有效地共享连接。

Usually, the database connection pooling built-in to your application server is the easiest, and an often sufficient, solution. 通常,内置到应用程序服务器的数据库连接池是最简单且通常是足够的解决方案。 In the case of Tomcat 6/7, that would be the newer " Tomcat JDBC Connection Pool ". 在Tomcat 6/7的情况下,它将是较新的“ Tomcat JDBC连接池 ”。

Well-known standalone options included Commons-DBCP and c3p0 . 众所周知的独立选项包括Commons-DBCPc3p0 However, there have been issues with both libraries. 但是,两个库都存在问题。 These days if you need a standalone connection pooling library, I would recommend trying the " Tomcat JDBC Connection Pool ". 这些天,如果您需要独立的连接池库,建议您尝试使用“ Tomcat JDBC连接池 ”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM