Oracle: difference between unconnected connections and DRCP

I am really reading an Oracle-cx_Oracle tutorial .

There, I came across loose connections and DRCP. Basically, I am not a database administrator, so I searched on Google but couldn't find anything.

So can someone help me understand what it is and how they differ from each other.

Thanks.

+5
source share
3 answers

Web and mid-tier applications typically have many threads that take turns using RDBMS resources. Currently, multi-threaded applications can efficiently use database connections, providing greater mid-level scalability. Starting with Oracle 11g, application developers and database administrators and administrators can use the database connection pool to achieve this scalability by sharing connections between multiprocessor and multithreaded applications that can span mid-tier systems.

DRCP provides a connection pool on a database server for typical web application use cases where an application acquires a database connection, runs on it for a relatively short duration, and then releases it. DRCP pool of "dedicated" servers. A federated server is the equivalent of a server foreground process and a combined database session.

DRCP complements intermediate-level connection pools that exchange connections between threads in a mid-level process. In addition, DRCP allows you to exchange database connections between mid-level processes on the same intermediate level node and even between intermediate level nodes. This leads to a significant reduction in the key database resources needed to support a large number of client connections, thereby reducing the amount of database memory and increasing the scalability of both mid-tier and database tiers. Having a pool of readily available servers also has the added benefit of lowering the cost of creating and breaking client connections.

DRCP is especially important for architectures with multi-processor single-threaded application servers (such as PHP / Apache ) that cannot perform middle tier pooling. The database can scale to tens of thousands of concurrent DRCP connections.

+1
source

DRCP stands for "Database Pooling " as opposed to "unconnected" connections

In short, using DRCP, Oracle will cache all open connections, selecting a pool from them, and will use the connections in the pool for future requests.

The purpose of this is to avoid opening new connections if some of the existing connections are available / free, and therefore to safely store database resources and retrieval time (time to open a new connection).

If all connections in the pool are used, then a new connection is automatically created (by Oracle) and added to the pool.

In unconnected connections, the connection is created and (theoretically) closed by the application requesting the database.

For example, on a static PHP page requesting a database, you always have the same scheme:

  • Open database connection
  • Database Queries
  • Close connection to DB

And you know what your circuit will be.

Now suppose you have a dynamic PHP page (with AJAX or something else) that will only query the database if the user does some specific action, the scheme becomes unpredictable. There, DRCP can become healthy for your database, especially if you have many users and possible queries.

This quote from an official document summarizes the concept enough and when it should be used:

A database backup connection pool (DRCP) is a server connection pool common to many clients. You should use DRCP in connection pools, where the number of active connections is quite less than the number of open connections. As the number of connection pool instances that can share connections from the DRCP pool increases, the benefits of using DRCP increase. DRCP improves the scalability of the database server and decides which is related to the interconnection of the intermediate layer channels.

+1
source

DRCP increases the level of centralization for pools:

  • The classic connection pool is managed in client middleware. This means that, for example, if you have several independent web servers, each of them will have its own server-managed connection pool. There is a pool on the server, and the server is responsible for managing it. For example, you can have 3 separate pools with a limit of 50 connections per pool. Depending on usage patterns, this can be a waste, because you can end up using a common connection of 150 very rarely, and on the other hand, you may encounter an individual limit of 50 connections very often.
  • DRCP is the only pool managed by the database server, not client servers. This can lead to a more efficient distribution of compounds. In the above example, three servers can share the same database-driven pool of less than 150 connections, such as 100 connections. And if two servers are idle, the third server can accept all 100 connections, if necessary.

See Oracle Database 11g: Best New Features for Database Administrators and Developers for more information and Database Backup Connection Pool Information :

This leads to a significant reduction in the basic database resources needed to support a large number of client connections, thereby reducing the amount of database memory and increasing the scalability of both mid-tier and database tiers

In addition, DRCP compensates for the complete absence of middleware connection pools in certain technologies (again cited from About the connection pool with the backup database storage ):

DRCP is especially important for architectures with multi-processor single-threaded application servers (such as PHP / Apache) that cannot perform middle tier pooling. The database can scale to tens of thousands of concurrent DRCP connections.

For an additional reference, see, for example, Connection Pooling in PHP - Stack Overflow , for example.

+1
source

Source: https://habr.com/ru/post/1259138/


All Articles