Databases Reference
In-Depth Information
There's more...
In this recipe, we have seen an example of connection management in action. Let's
explore the scenarios, that could occur when we are designing our application, and
database architecture.
Dedicated server versus shared server
There are two types of configurations used to connect to an Oracle database: dedicated server
and shared server, called Multi-Threaded Server (MTS) in previous Oracle database releases.
In dedicated server mode, each client connected to the database will have a separate server
process that executes the requests. In a shared server configuration, when a client initiates
a connection to the database, the listener process chooses a dispatcher process configured
for the database and the dispatcher process passes the request to the least loaded server
process, which is already configured for the database, to execute the client request.
The shared server configuration shares a small number of server processes among many
users, reducing the resources (RAM) required to serve the user requests.
In a dedicated server configuration, a new server process has to be spawned when a client
logs in to the database. However, using a dedicated server is faster than using a shared
server configuration, and with memory becoming less expensive it's better to increase the
amount of RAM on the database server.
The dedicated server configuration is configured by default in most environments. There are
some DBA tasks that cannot be performed with a shared server connection, such as RMAN
backup/restore/recovery. Moreover, when a task uses structures stored in the PGA (Program
Global Area), the session cannot be migrated to another shared server, this situation can lead
to a contention.
Web applications
Web applications pool many users connecting at the same time, and this is the first thing
to consider when designing the connection management of our web application.
There are many tutorials about writing web pages which connect to the database, returning
data to the user or allowing them to modify and store updated information on the database.
These tutorials usually do not consider the correct approach to establishing a database
connection, and beyond the programming language used, we have a typical pattern for a
web page design:
1.
Connect to the database.
2.
Query the data and compose the HTML code.
3.
Close the connection.
 
Search WWH ::




Custom Search