SlideShare a Scribd company logo
Tarik R. Essawi
VeriSign
Session 116
Secrets of Highly Scalable OLTP
Architectures
Introduction
• Provides real-world best practices for a mission-critical
OLTP system.
• Focused tuning of the application to database interface
can yield a 50% reduction in response time.
• Secrets and best practices that every developer can
use for tuning an already tuned system.
Background
• New SLA’s required that
we tune the system.
• Project is very large
• Waterfall development
lifecycle.
• One application engineer
and one database
engineer performed the
majority of the work.
• Originally tuned using
traditional methods.
• 75% of the time was spent
in the database.
Command SLA Response
Times
CHECK-
DOMAIN
25 milliseconds
ADD-
DOMAIN
50 milliseconds
MODIFY-
DOMAIN
100
milliseconds
DELETE-
DOMAIN
100
milliseconds
First Secret Discovered
Challenge: Identify where time is actually being spent.
How:
1.) Traced the database sessions.
2.) Identified what database calls were being made
and how many milliseconds each individual call took.
3.) Used Trace Analyzer from Oracle to parse the
trace files.
Result: For example, we found two business rules calling
the same operation to retrieve customer data. By
removing the redundant call we saved 8 milliseconds.
Lesson Learned: Every database call counts.
Second Secret Discovered
Challenge: Reduce round trips between the database and application.
• Most important item we found.
• Every database round trip involves additional overhead due to the
network latency.
How: Pass data in an object form using arrays.
Use Arrays
• Consider the sample Orders schema above.
• An order for a computer is a good example. A single order
contains order items such as the computer, monitor, keyboard,
and mouse.
Traditional Versus Array
• Traditional Method
–Call a procedure to insert an Order into the Orders table.
–Loop through the Order Items, passing them individually to a
procedure to be inserted into the Order Items table.
In the previous example a total of five database calls occur.
• Array Method
–Call a procedure to add the Order and an array of Order Items
in one procedure call.
• Internally insert the Order into the Orders table and its
associated Order Items into the Order Items table.
Using this method, five database calls are replaced by one.
Using Arrays
Below is an example of how to start using arrays.
1.) A schema level type needs to be created:
CREATE TYPE OrderItemsType AS object (Order_Id NUMBER(12),
Line_Item_Id NUMBER(3), ……..);
2.) Create a table of the type:
CREATE TYPE OrderItemsTab AS table OF OrderItemsType;
3.) Create a procedure that includes both the order and an array of the
order items:
CREATE PROCEDURE Add_Order_and_Items(
pOrder_Id IN Orders.Order_id%TYPE,
pOrder_Date IN Orders.Order_Date%TYPE,
……..
pOrder_Items IN OrderItemsTab);
Lesson Learned: The overhead of making database calls is expensive.
Third Secret Discovered
Challenge: Process Data in Bulk.
How: Forall, Bulk Collect, or the example below:
Result: Using one insert statement we were able to insert
multiple records without a looping control structure.
INSERT INTO order_items (order_id, line_item_id,….)
SELECT order_id, line_item_id,…….
FROM TABLE (CAST (pOrder_Items AS OrderItemsTab));
Lesson Learned: Processing in Bulk increases performance.
Fourth Secret Discovered
Challenge: Return less data.
How: Identify data not being used by the application.
Result: In our case a system generated sequence value was
returned but never used. We were able to stop returning
the value and saw a performance increase.
Lesson Learned: The process of returning even a single
value can make a difference.
Best Practices
Fastest Way to Pass Data
Identify the fastest way to pass data to the application.
• Three mainstream ways are:
– Primitive Data Types
– In/Out Parameters in PL/SQL
– Result Sets
• Primitive Data Types: fastest way to pass back a
single data value.
• In/Out Parameters: fastest way to pass back multiple
single data values.
• Result Sets: fastest way to pass back record sets but
are not best suited to returning single records.
NOCOPY
• By default Oracle creates temporary copies of
IN/OUT and OUT variable data within stored
procedures.
• The NOCOPY hint passes only a reference to the
object instead of the entire object.
• NOCOPY hint is added to a prodecures signature for
each IN/OUT and OUT variable.
Pro: Speeds up execution.
Con: Partial data can be returned back to the client
during error conditions.
Locking Strategies
• The locking strategies concentrate on updating or
deleting records.
• Inserts do not require locking because the object never
exists until the insert.
• Two main ways to lock data:
For short user or API transactions in B2B environments:
1. Lock and get the data.
2. Update or delete the data.
3. Commit the transaction.
Locking Strategies Cont’d
Longer user interface type transactions:
1. Get the data.
2. When the data is updated use a version identifier to
ensure that the record has not been updated by
someone else.
• Include the version identifier in the where clause of the
update statement.
3. Verify the transaction.
a. If the statement updates zero rows then the
record was already modified and the transaction
should be rolled back.
b. If the statement updates the proper number of
rows then the record updated successfully.
JDBC
JDBC features are constantly evolving, so become
aware of the latest features.
• JDBC Arrays.
– Tighter integration.
– Can send objects to pl/sql.
• JDBC Batching.
– Greatly increases performance.
– Reduces Round Trips.
– Client sends a group of statements in a batch.
JDBC Cont’d
Setting the row prefetch
• When retrieving large amounts of data setting the
setDefaultRowPrefetch() attribute in the application
code can move more data with each call.
Use the latest JDBC driver provided by the database
vendor.
• Upgraded to the Oracle 10g database driver and saw
a 10 millisecond improvement.
• New driver also had new features.
Lessons Learned
• Writing code the right way takes the same
amount of effort as writing it the wrong way.
• It should not be assumed that the
communication between the application and
database is as efficient as possible.
• In our experience tuning the application to
database interface yielded a 50% reduction in
response time.
Lessons Learned Cont’d
• When passing data use primitive data types
whenever possible. Use result sets only when
required.
• Use JDBC Array and Batching features if
possible.
• Use the fastest JDBC driver available, don’t
assume you have the fastest.
Final Thoughts
• Knowing the secrets and best practices listed
today will make any application more scalable
by virtue of using fewer scarce resources.
• These best practices should be incorporated
in a standard development lifecycle to ensure
your system is always operating as efficiently
as possible.
Questions?
Thank You
Please complete your evaluation forms.
Speaker Name: Tarik R. Essawi
Session name: Secrets of Highly Scalable OLTP
Architectures
Session#: 116
Contact Info: tessawi@verisign.com

More Related Content

What's hot

Kafka to Hadoop Ingest with Parsing, Dedup and other Big Data Transformations
Kafka to Hadoop Ingest with Parsing, Dedup and other Big Data TransformationsKafka to Hadoop Ingest with Parsing, Dedup and other Big Data Transformations
Kafka to Hadoop Ingest with Parsing, Dedup and other Big Data Transformations
Apache Apex
 
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Apache Apex
 
SQL in the Hybrid World
SQL in the Hybrid WorldSQL in the Hybrid World
SQL in the Hybrid World
Tanel Poder
 
Apache Big Data EU 2016: Next Gen Big Data Analytics with Apache Apex
Apache Big Data EU 2016: Next Gen Big Data Analytics with Apache ApexApache Big Data EU 2016: Next Gen Big Data Analytics with Apache Apex
Apache Big Data EU 2016: Next Gen Big Data Analytics with Apache Apex
Apache Apex
 
Stored procedure tuning and optimization t sql
Stored procedure tuning and optimization t sqlStored procedure tuning and optimization t sql
Stored procedure tuning and optimization t sql
nishantdavid9
 
Query optimizer vivek sharma
Query optimizer vivek sharmaQuery optimizer vivek sharma
Query optimizer vivek sharma
aioughydchapter
 
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and TransformIntro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
Apache Apex
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
BIOVIA
 
University program - writing an apache apex application
University program  - writing an apache apex applicationUniversity program  - writing an apache apex application
University program - writing an apache apex application
Akshay Gore
 
Inside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTPInside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTP
Bob Ward
 
Apache Apex: Stream Processing Architecture and Applications
Apache Apex: Stream Processing Architecture and ApplicationsApache Apex: Stream Processing Architecture and Applications
Apache Apex: Stream Processing Architecture and Applications
Thomas Weise
 
Apache Apex Fault Tolerance and Processing Semantics
Apache Apex Fault Tolerance and Processing SemanticsApache Apex Fault Tolerance and Processing Semantics
Apache Apex Fault Tolerance and Processing Semantics
Apache Apex
 
Faceted search with Oracle InMemory option
Faceted search with Oracle InMemory optionFaceted search with Oracle InMemory option
Faceted search with Oracle InMemory option
Alexander Tokarev
 
Dependency Injection in Apache Spark Applications
Dependency Injection in Apache Spark ApplicationsDependency Injection in Apache Spark Applications
Dependency Injection in Apache Spark Applications
Databricks
 
Proactive performance monitoring with adaptive thresholds
Proactive performance monitoring with adaptive thresholdsProactive performance monitoring with adaptive thresholds
Proactive performance monitoring with adaptive thresholds
John Beresniewicz
 
The Stream Processor as a Database Apache Flink
The Stream Processor as a Database Apache FlinkThe Stream Processor as a Database Apache Flink
The Stream Processor as a Database Apache Flink
DataWorks Summit/Hadoop Summit
 
Introduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizerIntroduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizer
Mydbops
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL Server
Rajesh Gunasundaram
 
Spring batch for large enterprises operations
Spring batch for large enterprises operations Spring batch for large enterprises operations
Spring batch for large enterprises operations
Ignasi González
 
Building Your First Apache Apex (Next Gen Big Data/Hadoop) Application
Building Your First Apache Apex (Next Gen Big Data/Hadoop) ApplicationBuilding Your First Apache Apex (Next Gen Big Data/Hadoop) Application
Building Your First Apache Apex (Next Gen Big Data/Hadoop) Application
Apache Apex
 

What's hot (20)

Kafka to Hadoop Ingest with Parsing, Dedup and other Big Data Transformations
Kafka to Hadoop Ingest with Parsing, Dedup and other Big Data TransformationsKafka to Hadoop Ingest with Parsing, Dedup and other Big Data Transformations
Kafka to Hadoop Ingest with Parsing, Dedup and other Big Data Transformations
 
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
 
SQL in the Hybrid World
SQL in the Hybrid WorldSQL in the Hybrid World
SQL in the Hybrid World
 
Apache Big Data EU 2016: Next Gen Big Data Analytics with Apache Apex
Apache Big Data EU 2016: Next Gen Big Data Analytics with Apache ApexApache Big Data EU 2016: Next Gen Big Data Analytics with Apache Apex
Apache Big Data EU 2016: Next Gen Big Data Analytics with Apache Apex
 
Stored procedure tuning and optimization t sql
Stored procedure tuning and optimization t sqlStored procedure tuning and optimization t sql
Stored procedure tuning and optimization t sql
 
Query optimizer vivek sharma
Query optimizer vivek sharmaQuery optimizer vivek sharma
Query optimizer vivek sharma
 
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and TransformIntro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
 
University program - writing an apache apex application
University program  - writing an apache apex applicationUniversity program  - writing an apache apex application
University program - writing an apache apex application
 
Inside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTPInside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTP
 
Apache Apex: Stream Processing Architecture and Applications
Apache Apex: Stream Processing Architecture and ApplicationsApache Apex: Stream Processing Architecture and Applications
Apache Apex: Stream Processing Architecture and Applications
 
Apache Apex Fault Tolerance and Processing Semantics
Apache Apex Fault Tolerance and Processing SemanticsApache Apex Fault Tolerance and Processing Semantics
Apache Apex Fault Tolerance and Processing Semantics
 
Faceted search with Oracle InMemory option
Faceted search with Oracle InMemory optionFaceted search with Oracle InMemory option
Faceted search with Oracle InMemory option
 
Dependency Injection in Apache Spark Applications
Dependency Injection in Apache Spark ApplicationsDependency Injection in Apache Spark Applications
Dependency Injection in Apache Spark Applications
 
Proactive performance monitoring with adaptive thresholds
Proactive performance monitoring with adaptive thresholdsProactive performance monitoring with adaptive thresholds
Proactive performance monitoring with adaptive thresholds
 
The Stream Processor as a Database Apache Flink
The Stream Processor as a Database Apache FlinkThe Stream Processor as a Database Apache Flink
The Stream Processor as a Database Apache Flink
 
Introduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizerIntroduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizer
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL Server
 
Spring batch for large enterprises operations
Spring batch for large enterprises operations Spring batch for large enterprises operations
Spring batch for large enterprises operations
 
Building Your First Apache Apex (Next Gen Big Data/Hadoop) Application
Building Your First Apache Apex (Next Gen Big Data/Hadoop) ApplicationBuilding Your First Apache Apex (Next Gen Big Data/Hadoop) Application
Building Your First Apache Apex (Next Gen Big Data/Hadoop) Application
 

Viewers also liked

Agile db testing_techniques
Agile db testing_techniquesAgile db testing_techniques
Agile db testing_techniquesTarik Essawi
 
Visual Resume
Visual ResumeVisual Resume
Visual Resume
hannahb31092
 
Ldv tour
Ldv tourLdv tour
Tiffany christensen chore chart
Tiffany christensen chore chartTiffany christensen chore chart
Tiffany christensen chore chart
Tiffany Christensen
 
The Science Of Networking
The Science Of Networking The Science Of Networking
The Science Of Networking
Brittany Irvin
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
 

Viewers also liked (7)

Agile db testing_techniques
Agile db testing_techniquesAgile db testing_techniques
Agile db testing_techniques
 
Visual Resume
Visual ResumeVisual Resume
Visual Resume
 
Ldv tour
Ldv tourLdv tour
Ldv tour
 
Tiffany christensen chore chart
Tiffany christensen chore chartTiffany christensen chore chart
Tiffany christensen chore chart
 
The Science Of Networking
The Science Of Networking The Science Of Networking
The Science Of Networking
 
Pak
PakPak
Pak
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similar to Secrets of highly_avail_oltp_archs

Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails Apps
Matt Kuklinski
 
Breaking data
Breaking dataBreaking data
Breaking data
Terry Bunio
 
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Databricks
 
My Database Skills Killed the Server
My Database Skills Killed the ServerMy Database Skills Killed the Server
My Database Skills Killed the Server
ColdFusionConference
 
Using Couchbase and Elasticsearch as data layers
Using Couchbase and Elasticsearch as data layersUsing Couchbase and Elasticsearch as data layers
Using Couchbase and Elasticsearch as data layers
Tal Maayani
 
SPL_ALL_EN.pptx
SPL_ALL_EN.pptxSPL_ALL_EN.pptx
SPL_ALL_EN.pptx
政宏 张
 
Multi-tier-performance-analysis-of-ADF-applications.pptx
Multi-tier-performance-analysis-of-ADF-applications.pptxMulti-tier-performance-analysis-of-ADF-applications.pptx
Multi-tier-performance-analysis-of-ADF-applications.pptx
Kuncoro21
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)
Lucas Jellema
 
Real World Performance - Data Warehouses
Real World Performance - Data WarehousesReal World Performance - Data Warehouses
Real World Performance - Data Warehouses
Connor McDonald
 
Database Core performance principles
Database Core performance principlesDatabase Core performance principles
Database Core performance principles
Koppelaars
 
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
AboutYouGmbH
 
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Codemotion
 
IBM Insight 2013 - Aetna's production experience using IBM DB2 Analytics Acce...
IBM Insight 2013 - Aetna's production experience using IBM DB2 Analytics Acce...IBM Insight 2013 - Aetna's production experience using IBM DB2 Analytics Acce...
IBM Insight 2013 - Aetna's production experience using IBM DB2 Analytics Acce...
Daniel Martin
 
Sql azure cluster dashboard public.ppt
Sql azure cluster dashboard public.pptSql azure cluster dashboard public.ppt
Sql azure cluster dashboard public.ppt
Qingsong Yao
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Ronald Francisco Vargas Quesada
 
Sql Server
Sql ServerSql Server
Sql Server
SandyShin
 
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Jim Czuprynski
 
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevMigration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Altinity Ltd
 
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive MetastoreOracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
DataWorks Summit
 
An AMIS overview of database 12c
An AMIS overview of database 12cAn AMIS overview of database 12c

Similar to Secrets of highly_avail_oltp_archs (20)

Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails Apps
 
Breaking data
Breaking dataBreaking data
Breaking data
 
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
 
My Database Skills Killed the Server
My Database Skills Killed the ServerMy Database Skills Killed the Server
My Database Skills Killed the Server
 
Using Couchbase and Elasticsearch as data layers
Using Couchbase and Elasticsearch as data layersUsing Couchbase and Elasticsearch as data layers
Using Couchbase and Elasticsearch as data layers
 
SPL_ALL_EN.pptx
SPL_ALL_EN.pptxSPL_ALL_EN.pptx
SPL_ALL_EN.pptx
 
Multi-tier-performance-analysis-of-ADF-applications.pptx
Multi-tier-performance-analysis-of-ADF-applications.pptxMulti-tier-performance-analysis-of-ADF-applications.pptx
Multi-tier-performance-analysis-of-ADF-applications.pptx
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)
 
Real World Performance - Data Warehouses
Real World Performance - Data WarehousesReal World Performance - Data Warehouses
Real World Performance - Data Warehouses
 
Database Core performance principles
Database Core performance principlesDatabase Core performance principles
Database Core performance principles
 
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
 
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
 
IBM Insight 2013 - Aetna's production experience using IBM DB2 Analytics Acce...
IBM Insight 2013 - Aetna's production experience using IBM DB2 Analytics Acce...IBM Insight 2013 - Aetna's production experience using IBM DB2 Analytics Acce...
IBM Insight 2013 - Aetna's production experience using IBM DB2 Analytics Acce...
 
Sql azure cluster dashboard public.ppt
Sql azure cluster dashboard public.pptSql azure cluster dashboard public.ppt
Sql azure cluster dashboard public.ppt
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
 
Sql Server
Sql ServerSql Server
Sql Server
 
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
 
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevMigration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
 
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive MetastoreOracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
 
An AMIS overview of database 12c
An AMIS overview of database 12cAn AMIS overview of database 12c
An AMIS overview of database 12c
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 

Secrets of highly_avail_oltp_archs

  • 1. Tarik R. Essawi VeriSign Session 116 Secrets of Highly Scalable OLTP Architectures
  • 2. Introduction • Provides real-world best practices for a mission-critical OLTP system. • Focused tuning of the application to database interface can yield a 50% reduction in response time. • Secrets and best practices that every developer can use for tuning an already tuned system.
  • 3. Background • New SLA’s required that we tune the system. • Project is very large • Waterfall development lifecycle. • One application engineer and one database engineer performed the majority of the work. • Originally tuned using traditional methods. • 75% of the time was spent in the database. Command SLA Response Times CHECK- DOMAIN 25 milliseconds ADD- DOMAIN 50 milliseconds MODIFY- DOMAIN 100 milliseconds DELETE- DOMAIN 100 milliseconds
  • 4. First Secret Discovered Challenge: Identify where time is actually being spent. How: 1.) Traced the database sessions. 2.) Identified what database calls were being made and how many milliseconds each individual call took. 3.) Used Trace Analyzer from Oracle to parse the trace files. Result: For example, we found two business rules calling the same operation to retrieve customer data. By removing the redundant call we saved 8 milliseconds. Lesson Learned: Every database call counts.
  • 5. Second Secret Discovered Challenge: Reduce round trips between the database and application. • Most important item we found. • Every database round trip involves additional overhead due to the network latency.
  • 6. How: Pass data in an object form using arrays. Use Arrays • Consider the sample Orders schema above. • An order for a computer is a good example. A single order contains order items such as the computer, monitor, keyboard, and mouse.
  • 7. Traditional Versus Array • Traditional Method –Call a procedure to insert an Order into the Orders table. –Loop through the Order Items, passing them individually to a procedure to be inserted into the Order Items table. In the previous example a total of five database calls occur. • Array Method –Call a procedure to add the Order and an array of Order Items in one procedure call. • Internally insert the Order into the Orders table and its associated Order Items into the Order Items table. Using this method, five database calls are replaced by one.
  • 8. Using Arrays Below is an example of how to start using arrays. 1.) A schema level type needs to be created: CREATE TYPE OrderItemsType AS object (Order_Id NUMBER(12), Line_Item_Id NUMBER(3), ……..); 2.) Create a table of the type: CREATE TYPE OrderItemsTab AS table OF OrderItemsType; 3.) Create a procedure that includes both the order and an array of the order items: CREATE PROCEDURE Add_Order_and_Items( pOrder_Id IN Orders.Order_id%TYPE, pOrder_Date IN Orders.Order_Date%TYPE, …….. pOrder_Items IN OrderItemsTab); Lesson Learned: The overhead of making database calls is expensive.
  • 9. Third Secret Discovered Challenge: Process Data in Bulk. How: Forall, Bulk Collect, or the example below: Result: Using one insert statement we were able to insert multiple records without a looping control structure. INSERT INTO order_items (order_id, line_item_id,….) SELECT order_id, line_item_id,……. FROM TABLE (CAST (pOrder_Items AS OrderItemsTab)); Lesson Learned: Processing in Bulk increases performance.
  • 10. Fourth Secret Discovered Challenge: Return less data. How: Identify data not being used by the application. Result: In our case a system generated sequence value was returned but never used. We were able to stop returning the value and saw a performance increase. Lesson Learned: The process of returning even a single value can make a difference.
  • 12. Fastest Way to Pass Data Identify the fastest way to pass data to the application. • Three mainstream ways are: – Primitive Data Types – In/Out Parameters in PL/SQL – Result Sets • Primitive Data Types: fastest way to pass back a single data value. • In/Out Parameters: fastest way to pass back multiple single data values. • Result Sets: fastest way to pass back record sets but are not best suited to returning single records.
  • 13. NOCOPY • By default Oracle creates temporary copies of IN/OUT and OUT variable data within stored procedures. • The NOCOPY hint passes only a reference to the object instead of the entire object. • NOCOPY hint is added to a prodecures signature for each IN/OUT and OUT variable. Pro: Speeds up execution. Con: Partial data can be returned back to the client during error conditions.
  • 14. Locking Strategies • The locking strategies concentrate on updating or deleting records. • Inserts do not require locking because the object never exists until the insert. • Two main ways to lock data: For short user or API transactions in B2B environments: 1. Lock and get the data. 2. Update or delete the data. 3. Commit the transaction.
  • 15. Locking Strategies Cont’d Longer user interface type transactions: 1. Get the data. 2. When the data is updated use a version identifier to ensure that the record has not been updated by someone else. • Include the version identifier in the where clause of the update statement. 3. Verify the transaction. a. If the statement updates zero rows then the record was already modified and the transaction should be rolled back. b. If the statement updates the proper number of rows then the record updated successfully.
  • 16. JDBC JDBC features are constantly evolving, so become aware of the latest features. • JDBC Arrays. – Tighter integration. – Can send objects to pl/sql. • JDBC Batching. – Greatly increases performance. – Reduces Round Trips. – Client sends a group of statements in a batch.
  • 17. JDBC Cont’d Setting the row prefetch • When retrieving large amounts of data setting the setDefaultRowPrefetch() attribute in the application code can move more data with each call. Use the latest JDBC driver provided by the database vendor. • Upgraded to the Oracle 10g database driver and saw a 10 millisecond improvement. • New driver also had new features.
  • 18. Lessons Learned • Writing code the right way takes the same amount of effort as writing it the wrong way. • It should not be assumed that the communication between the application and database is as efficient as possible. • In our experience tuning the application to database interface yielded a 50% reduction in response time.
  • 19. Lessons Learned Cont’d • When passing data use primitive data types whenever possible. Use result sets only when required. • Use JDBC Array and Batching features if possible. • Use the fastest JDBC driver available, don’t assume you have the fastest.
  • 20. Final Thoughts • Knowing the secrets and best practices listed today will make any application more scalable by virtue of using fewer scarce resources. • These best practices should be incorporated in a standard development lifecycle to ensure your system is always operating as efficiently as possible.
  • 22. Thank You Please complete your evaluation forms. Speaker Name: Tarik R. Essawi Session name: Secrets of Highly Scalable OLTP Architectures Session#: 116 Contact Info: tessawi@verisign.com