应用程序与数据库常驻连接池 [英] Application vs Database Resident Connection Pool

查看:90
本文介绍了应用程序与数据库常驻连接池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况: 我需要在使用python连接到Oracle数据库时使用连接池.多个python应用程序将使用我开发的帮助程序连接库.

Situation: I have a requirement to use connection pooling while connecting to Oracle database in python. Multiple python applications would use the helper connection libraries I develop.

我的思考过程: 在这里,我可以想到两种连接池方式: 1)让连接池由数据库本身(由Oracle DRCP提供)来维护和管理,而调用模块只是询问来自Oracle DRCP描述的连接代理的连接.

My Thought Process: Here I can think of two ways of connection pooling: 1) Let connection pool be maintained and managed by database itself (as provided by Oracle's DRCP) and calling modules just ask connections from the connection broker described by Oracle DRCP.

2)拥有一个管理连接池的服务器进程,并且所有调用方模块都从该池中请求连接(例如dbcp?)

2) Have a server process that manages the connection pool and all caller modules ask for connections from this pool (like dbcp?)

我需要什么建议: 选项1)看起来非常简单,因为池不需要由应用程序存储. 但是我想知道除了使用选项1)的简单性之外,我还能获得什么好处? 我试图避免选择2),因为它将要求始终运行一个专用的服务器进程(考虑到连接对象无法搁置). 还有其他办法吗?

What suggestions do I need: option 1) looks very straight forward since pool does not need to be stored by application. But I wanted to know what advantages do I get other than simplicity using option 1)? I am trying to avoid option 2) since it would require a dedicated server process always running (considering shelving is not possible for connection objects). Is there any other way?

推荐答案

让数据库处理池. . .它比您现在要聪明,并且您将利用Oracle的所有已安装基础提供的每个错误修复/性能改进.

Let the database handle the pool. . . it's smarter than you'll be, and you'll leverage every bug fix/performance improvement Oracle's installed base comes up with.

这篇关于应用程序与数据库常驻连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆