| Lesson 7 | Designing Web applications for high performance |
| Objective | Design web-based Oracle applications for high performance. |
Designing web applications for high performance against Oracle 23ai involves architecture decisions across multiple tiers — network, middleware, and database. The main bottlenecks in a web-to-Oracle 23ai architecture typically lie not in the database engine itself, but in the layers between the client and the cloud infrastructure entry point. The recommended architecture for high-performance Oracle 23ai web applications follows a layered model that allows independent scaling of each tier:
Client → CDN / Edge → OCI Load Balancer / API Gateway → ORDS Cluster → Oracle Database 23ai
The following table ranks the most common bottlenecks by frequency and impact, with the highest-priority fixes that address each:
| Rank | Bottleneck Area | Typical Impact | Priority Fix |
|---|---|---|---|
| 1 | Network latency / round-trips | Very High | Region proximity + API design |
| 2 | Connection creation overhead | High | ORDS pooling + DRCP |
| 3 | Load Balancer / ORDS scaling | High | Proper sizing + horizontal scale |
| 4 | TLS and HTTP overhead | Medium-High | HTTP/2 + keep-alive + TLS resumption |
| 5 | Query / payload efficiency | Medium | Indexing, pagination, caching |
Network latency between the client and the OCI region hosting Oracle 23ai is frequently the primary bottleneck. Contributing factors include geographic distance, internet congestion, chatty APIs that generate many small HTTP requests, and TLS/SSL handshake overhead on short-lived connections that do not reuse TLS sessions.
Mitigations for network latency:
Repeated creation of TCP, TLS, and Oracle Net connections is the second most common bottleneck. Each new ORDS-to-database connection requires Oracle Net handshake, authentication, and session establishment — significant overhead for short-duration web requests.
The ORDS JDBC connection pool is the most impactful tuning lever for web-facing Oracle applications. Key parameters:
jdbc.MaxLimit — maximum pooled connections. Too low causes request
queuing; too high exhausts database sessions. Use the Oracle database
SESSIONS init parameter as the practical upper bound.jdbc.MinLimit — minimum connections kept open at idle. Prevents
cold-start latency after idle periods.jdbc.InitialLimit — connections created at ORDS startup. Set equal
to jdbc.MinLimit for consistent startup behavior.DRCP is Oracle's server-side connection pooling mechanism, ideal for deployments with multiple ORDS instances each maintaining their own JDBC pool. DRCP shares a pool of database server processes across all ORDS instances rather than each instance holding dedicated sessions. For Oracle 23ai with multiple ORDS nodes behind a load balancer, DRCP significantly reduces the total session count at the database tier — a common bottleneck in horizontally-scaled ORDS deployments.
For Java applications connecting directly to Oracle 23ai without ORDS, Oracle's Universal Connection Pool provides JDBC connection pooling with Fast Application Notification (FAN), Application Continuity, and Oracle RAC transaction affinity support.
The OCI Load Balancer and API Gateway become bottlenecks if under-provisioned or misconfigured. DNS resolution delays and WAF policy processing also add measurable latency to every request.
Schema and index design decisions made at development time have the largest long-term impact on Oracle 23ai web application performance:
RESULT_CACHE hint or
CREATE RESULT CACHE for PL/SQL functions returning reference data
consumed by multiple concurrent ORDS requests.FORALL for
INSERT/UPDATE/DELETE operations from web form submissions — reduces round-trips
between ORDS and the database.BULK COLLECT to fetch multiple
rows into a PL/SQL collection for faster retrieval when processing result sets in
stored procedures.FETCH NEXT or the ORDS built-in ?offset= and
?limit= parameters for AutoREST endpoints. Unbounded result sets are
the most common web application performance anti-pattern.One of the real problems that emerged from using the web as a front-end is that a web page is a scrolling document rather than a fixed-height screen. Unlike a traditional client-server application that maps database output to a non-scrolling terminal window, a web application can generate an HTML page spanning hundreds of rows of Oracle output — all of which must be fetched, serialized, transmitted, and rendered before the user sees any data.
The solution is pagination implemented at the SQL level — not at the application
layer after a full result set fetch. Fetching all rows and then discarding most of
them in the application wastes Oracle I/O, ORDS serialization time, and network
bandwidth. Implement pagination in the SQL itself using
OFFSET n ROWS FETCH NEXT n ROWS ONLY, or use ORDS AutoREST pagination
via the ?offset= and ?limit= query parameters.
The following table summarizes the most important design tips for Oracle 23ai web applications, updated for modern ORDS and cloud-native deployments:
| Tip | Suggestions for Implementation |
|---|---|
| Gather only as much data as the end-user requires | Paginate results at the SQL level using FETCH NEXT or the ORDS
?limit= parameter. Never return unbounded result sets to a web client.
Implement a next-page function so users can access additional rows on demand. |
| Use links conservatively | Too many links make the application confusing and hard to maintain. Use top-down navigation with return links. Minimize links to screens that require live Oracle data queries. Avoid cross-screen links that trigger multiple round-trips. |
| Separate the ORDS host from the database server | Deploy ORDS on separate compute instances from Oracle Database 23ai. High CPU load on the ORDS tier must not starve the database server of OS resources. In OCI, place ORDS instances in a separate subnet from the database tier. |
| Participate in the web interface design | Work with developers to design screens that access Oracle 23ai efficiently —
filter early, paginate results, cache reference data with True Cache or Result
Cache, and avoid SELECT * patterns that transfer unnecessary
columns. |
| Use aggregate tables for summary information | Pre-compute SUM, AVG, and COUNT
aggregates into materialized views or aggregate tables. Relieve real-time
aggregation pressure on the OLTP database and provide sub-millisecond access to
summary data for web dashboards. |
| Use alternative locking mechanisms | Never allow SELECT FOR UPDATE or any SQL directive that holds
locks across HTTP requests. Web sessions are stateless — database locks held
across requests block concurrent users and cause contention. Use optimistic locking
or Oracle 23ai lock-free reservations instead. The next lesson covers alternative
concurrency mechanisms in detail. |