SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
BASLE BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA
HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH
Designing for Performance:
Database Related Worst Practices
Christian Antognini
@ChrisAntognini
Designing for Performance: Database Related Worst Practices2 9/2/2015
Senior principal consultant, trainer and partner
at Trivadis in Zurich (CH)
christian.antognini@trivadis.com
http://antognini.ch
Focus: get the most out of Oracle Database
Logical and physical database design
Query optimizer
Application performance management
Author of Troubleshooting Oracle Performance (Apress, 2008/14)
OakTable Network, Oracle ACE Director
Agenda
Designing for Performance: Database Related Worst Practices3 9/2/2015
1. Introduction
2. Worst Practices
3. Core Messages
Designing for Performance: Database Related Worst Practices4 9/2/2015
Introduction
Where Does This Information Come From?
Designing for Performance: Database Related Worst Practices5 9/2/2015
Personal experience!
I spent most of the last 15 years troubleshooting performance problems.
Hundreds of different projects and applications
A number of industries were involved
According to my experience, most of the database-related performance
problems are caused by a limited number of issues.
In this presentation I cover the top 10
Even though some of them may seem very basic, do not underestimate the number
of systems that are now running and suffering because of them!
Why It’s Important?
Designing for Performance: Database Related Worst Practices6 9/2/2015
Many performance problems can be
avoided with sound planning and
design.
Do the right thing!
There is a widespread lack of
knowledge in our industry!
The same mistakes are made again
and again.
“To err is human, to persist in it, is
diabolical” – Seneca
Designing for Performance: Database Related Worst Practices7 9/2/2015
Source: @peter_berner
It’s not Premature Optimization!
Designing for Performance: Database Related Worst Practices8 9/2/2015
“Premature optimization is the root of all evil” – Donald Knuth
The misconception based on that particular quote is that a developer, while
writing code, should ignore optimization altogether.
In my opinion, this interpretation is wrong!
My take:
Developers should avoid micro optimizations that have local impact.
Developers should care about optimizations that have global impact, like the design
of a system, the algorithms used to implement the required functionality, or in which
layer a specific processing should be performed.
Designing for Performance: Database Related Worst Practices9 9/2/2015
Worst Practices
Lack of Logical Database Design
Designing for Performance: Database Related Worst Practices10 9/2/2015
Once upon a time, it was considered obvious that one should have a data
architect involved in every development project.
Today, unfortunately, too often I see projects in which no formal database
design is done.
The database is considered a dumb device.
The logical database design depends on the target database engine.
Schema-on-write vs schema-on-read
Implementing Generic Tables
Designing for Performance: Database Related Worst Practices11 9/2/2015
In the quest of flexibility, generic database designs are implemented.
Entity-attribute-value models
XML-based designs
Flexibility is tied to performance!
In some situations suboptimal performance might be good enough.
In other situations it might be catastrophic.
Not Using Constraints to Enforce Data Integrity
Designing for Performance: Database Related Worst Practices12 9/2/2015
Constraints are not only fundamental to guarantee data integrity, but they are
also extensively used by query optimizers during the generation of execution
plans.
Cons of checking the constraints at the application level:
More code being written and tested
Potential problems with data integrity
Greater consumption of resources (not always)
Leads to less scalable locking schemes (not always)
Lack of Physical Database Design
Designing for Performance: Database Related Worst Practices13 9/2/2015
It is not uncommon to see projects where the logical design is directly
mapped to the physical design.
The physical database design depends on target database engine.
Heap tables, clustered tables, IOT
Many type of indexes exist
Data partitioning
Do not forget to define and implement a data-archiving concept.
Not Choosing the Right Data Type
Designing for Performance: Database Related Worst Practices14 9/2/2015
In recent years, I have witnessed a disturbing trend in physical database
design: wrong datatype selection.
E.g. VARCHAR2 instead of DATE or TIMESTAMP
There are four main problems related to wrong datatype selection:
Wrong or lacking validation of data
Loss of information
Things do not work as expected
Query optimizer anomalies
Not Using Bind Variables Correctly
Designing for Performance: Database Related Worst Practices15 9/2/2015
From a performance point of view, bind variables introduce both an
advantage and a disadvantage.
Only applies to database engines having a cursor cache.
The advantage of using bind variables is that they allow the sharing of
cursors.
The disadvantage of using bind variables in WHERE clauses, and only in
WHERE clauses, is that crucial information is sometimes hidden from the
query optimizer.
From a security point of view, bind variables prevent the risks associated with
SQL injection.
Not Using Advanced Database Features
Designing for Performance: Database Related Worst Practices16 9/2/2015
High-end database engines provide many advanced features that can
drastically reduce development costs while boosting performance.
E.g. data-centric processing should take place as closely as possible to the data
Leverage your investment by taking advantage of those features as much as
possible.
Most of the time, database-independent applications are not required.
I would recommend to develop a database-independent application only when there
are very good reasons for doing it.
Companies are more likely to change the whole application before changing just the
database engine.
Performing Unnecessary Commits
Designing for Performance: Database Related Worst Practices17 9/2/2015
Commits are operations that call for serialization.
Every operation that leads to serialization inhibits scalability.
Serialization is unwanted and should be minimized as much as possible.
Steadily Opening and Closing Database Connections
Designing for Performance: Database Related Worst Practices18 9/2/2015
Opening a database connection that in turn starts an associated process or
thread on the database server is not a lightweight operation.
Do not underestimate the amount of time and resources required.
A worst-case scenario that I sometimes observe is a web application that opens and
closes a database connection for every request that involves a database access.
Using a pool of connections is of paramount importance.
Opening Too Many Database Connections
Designing for Performance: Database Related Worst Practices19 9/2/2015
A database connection that as an associated process or thread on the
database server is not a lightweight resource.
A processor core cannot efficiently handle many concurrent processes or
threads.
Using a pool of connections of limited size is of paramount importance.
Designing for Performance: Database Related Worst Practices20 9/2/2015
Core Messages
Designing for Performance: Database Related Worst Practices21 9/2/2015
Let’s Face it, Information Technology Is Expensive!
Simple solutions
for simple problems,
elegant solutions
for complex problems.
One Size Fits All?
Designing for Performance: Database Related Worst Practices22 9/2/2015
Use the right tool
for the right job.
Designing for Performance: Database Related Worst Practices23 9/2/2015
Performance Is Not an Option
Optimal performance is not simply a product one can buy
but rather the results of an accurate planning and
a correct implementation.
Questions and Answers
Christian Antognini
Senior Principal Consultant
christian.antognini@trivadis.com
9/2/2015 Designing for Performance: Database Related Worst Practices24

Weitere ähnliche Inhalte

Andere mochten auch

Oracle Database In-Memory
Oracle Database In-MemoryOracle Database In-Memory
Oracle Database In-MemoryTrivadis
 
Database application and design
Database application and designDatabase application and design
Database application and designsieedah
 
JOOX - Java Object Oriented XML
JOOX - Java Object Oriented XMLJOOX - Java Object Oriented XML
JOOX - Java Object Oriented XMLJakub Kubrynski
 
Generating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data ModelerGenerating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data ModelerRob van den Berg
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 
Best Practices for Database Schema Design
Best Practices for Database Schema DesignBest Practices for Database Schema Design
Best Practices for Database Schema DesignIron Speed
 
Online Banking Project
Online Banking ProjectOnline Banking Project
Online Banking ProjectM.Saber
 
Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)Guy Harrison
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering pptshruths2890
 
Database Design Project-Oracle 11g
Database Design  Project-Oracle 11g Database Design  Project-Oracle 11g
Database Design Project-Oracle 11g Sunny U Okoro
 

Andere mochten auch (10)

Oracle Database In-Memory
Oracle Database In-MemoryOracle Database In-Memory
Oracle Database In-Memory
 
Database application and design
Database application and designDatabase application and design
Database application and design
 
JOOX - Java Object Oriented XML
JOOX - Java Object Oriented XMLJOOX - Java Object Oriented XML
JOOX - Java Object Oriented XML
 
Generating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data ModelerGenerating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data Modeler
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Best Practices for Database Schema Design
Best Practices for Database Schema DesignBest Practices for Database Schema Design
Best Practices for Database Schema Design
 
Online Banking Project
Online Banking ProjectOnline Banking Project
Online Banking Project
 
Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering ppt
 
Database Design Project-Oracle 11g
Database Design  Project-Oracle 11g Database Design  Project-Oracle 11g
Database Design Project-Oracle 11g
 

Ähnlich wie Designing for Performance: Database Related Worst Practices

Designing for performance: Database Related Worst Practices
Designing for performance: Database Related Worst PracticesDesigning for performance: Database Related Worst Practices
Designing for performance: Database Related Worst PracticesTrivadis
 
Data kitchen 7 agile steps - big data fest 9-18-2015
Data kitchen   7 agile steps - big data fest 9-18-2015Data kitchen   7 agile steps - big data fest 9-18-2015
Data kitchen 7 agile steps - big data fest 9-18-2015DataKitchen
 
The Evolution of a Scrappy Startup to a Successful Web Service
The Evolution of a Scrappy Startup to a Successful Web ServiceThe Evolution of a Scrappy Startup to a Successful Web Service
The Evolution of a Scrappy Startup to a Successful Web ServicePoornima Vijayashanker
 
The Growth Of Data Centers
The Growth Of Data CentersThe Growth Of Data Centers
The Growth Of Data CentersGina Buck
 
engage 2015 - - 2015 - Infrastructure Assessment - Analyze, Visualize and Op...
engage 2015 -  - 2015 - Infrastructure Assessment - Analyze, Visualize and Op...engage 2015 -  - 2015 - Infrastructure Assessment - Analyze, Visualize and Op...
engage 2015 - - 2015 - Infrastructure Assessment - Analyze, Visualize and Op...Christoph Adler
 
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...Daniel Zivkovic
 
Short reference architecture
Short reference architectureShort reference architecture
Short reference architectureSteve Feldman
 
Thinking Outside the Cube: How In-Memory Bolsters Analytics
Thinking Outside the Cube: How In-Memory Bolsters AnalyticsThinking Outside the Cube: How In-Memory Bolsters Analytics
Thinking Outside the Cube: How In-Memory Bolsters AnalyticsInside Analysis
 
Best Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
Best Laid Plans: Saving Time, Money and Trouble with Optimal ForecastingBest Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
Best Laid Plans: Saving Time, Money and Trouble with Optimal ForecastingEric Kavanagh
 
Understanding DataOps and Its Impact on Application Quality
Understanding DataOps and Its Impact on Application QualityUnderstanding DataOps and Its Impact on Application Quality
Understanding DataOps and Its Impact on Application QualityDevOps.com
 
ICS UserGroup - 2015 - Infrastructure Assessment - Analyze, Visualize and Opt...
ICS UserGroup - 2015 - Infrastructure Assessment - Analyze, Visualize and Opt...ICS UserGroup - 2015 - Infrastructure Assessment - Analyze, Visualize and Opt...
ICS UserGroup - 2015 - Infrastructure Assessment - Analyze, Visualize and Opt...Christoph Adler
 
Matthew Johnston - Big Data Futures Outlook BCM
Matthew Johnston - Big Data Futures Outlook BCMMatthew Johnston - Big Data Futures Outlook BCM
Matthew Johnston - Big Data Futures Outlook BCMHoi Lan Leong
 
From NASA to Startups to Big Commerce
From NASA to Startups to Big CommerceFrom NASA to Startups to Big Commerce
From NASA to Startups to Big CommerceDaniel Greenfeld
 
Data Engineer's Lunch #85: Designing a Modern Data Stack
Data Engineer's Lunch #85: Designing a Modern Data StackData Engineer's Lunch #85: Designing a Modern Data Stack
Data Engineer's Lunch #85: Designing a Modern Data StackAnant Corporation
 
OSTHUS-Allotrope presents "Laboratory Informatics Strategy" at SmartLab 2015
OSTHUS-Allotrope presents "Laboratory Informatics Strategy" at SmartLab 2015OSTHUS-Allotrope presents "Laboratory Informatics Strategy" at SmartLab 2015
OSTHUS-Allotrope presents "Laboratory Informatics Strategy" at SmartLab 2015OSTHUS
 
load speed problems of web resources on the client side classification and ...
 load speed problems of web resources on the client side  classification and ... load speed problems of web resources on the client side  classification and ...
load speed problems of web resources on the client side classification and ...INFOGAIN PUBLICATION
 
Horses for Courses: Database Roundtable
Horses for Courses: Database RoundtableHorses for Courses: Database Roundtable
Horses for Courses: Database RoundtableEric Kavanagh
 
How to choose the best frontend framework in 2022
How to choose the best frontend framework in 2022How to choose the best frontend framework in 2022
How to choose the best frontend framework in 2022Katy Slemon
 

Ähnlich wie Designing for Performance: Database Related Worst Practices (20)

Designing for performance: Database Related Worst Practices
Designing for performance: Database Related Worst PracticesDesigning for performance: Database Related Worst Practices
Designing for performance: Database Related Worst Practices
 
Data kitchen 7 agile steps - big data fest 9-18-2015
Data kitchen   7 agile steps - big data fest 9-18-2015Data kitchen   7 agile steps - big data fest 9-18-2015
Data kitchen 7 agile steps - big data fest 9-18-2015
 
The Evolution of a Scrappy Startup to a Successful Web Service
The Evolution of a Scrappy Startup to a Successful Web ServiceThe Evolution of a Scrappy Startup to a Successful Web Service
The Evolution of a Scrappy Startup to a Successful Web Service
 
The Growth Of Data Centers
The Growth Of Data CentersThe Growth Of Data Centers
The Growth Of Data Centers
 
engage 2015 - - 2015 - Infrastructure Assessment - Analyze, Visualize and Op...
engage 2015 -  - 2015 - Infrastructure Assessment - Analyze, Visualize and Op...engage 2015 -  - 2015 - Infrastructure Assessment - Analyze, Visualize and Op...
engage 2015 - - 2015 - Infrastructure Assessment - Analyze, Visualize and Op...
 
Streaming is a Detail
Streaming is a DetailStreaming is a Detail
Streaming is a Detail
 
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
 
Short reference architecture
Short reference architectureShort reference architecture
Short reference architecture
 
Thinking Outside the Cube: How In-Memory Bolsters Analytics
Thinking Outside the Cube: How In-Memory Bolsters AnalyticsThinking Outside the Cube: How In-Memory Bolsters Analytics
Thinking Outside the Cube: How In-Memory Bolsters Analytics
 
Isset Presentation @ EECI2009
Isset Presentation @ EECI2009Isset Presentation @ EECI2009
Isset Presentation @ EECI2009
 
Best Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
Best Laid Plans: Saving Time, Money and Trouble with Optimal ForecastingBest Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
Best Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
 
Understanding DataOps and Its Impact on Application Quality
Understanding DataOps and Its Impact on Application QualityUnderstanding DataOps and Its Impact on Application Quality
Understanding DataOps and Its Impact on Application Quality
 
ICS UserGroup - 2015 - Infrastructure Assessment - Analyze, Visualize and Opt...
ICS UserGroup - 2015 - Infrastructure Assessment - Analyze, Visualize and Opt...ICS UserGroup - 2015 - Infrastructure Assessment - Analyze, Visualize and Opt...
ICS UserGroup - 2015 - Infrastructure Assessment - Analyze, Visualize and Opt...
 
Matthew Johnston - Big Data Futures Outlook BCM
Matthew Johnston - Big Data Futures Outlook BCMMatthew Johnston - Big Data Futures Outlook BCM
Matthew Johnston - Big Data Futures Outlook BCM
 
From NASA to Startups to Big Commerce
From NASA to Startups to Big CommerceFrom NASA to Startups to Big Commerce
From NASA to Startups to Big Commerce
 
Data Engineer's Lunch #85: Designing a Modern Data Stack
Data Engineer's Lunch #85: Designing a Modern Data StackData Engineer's Lunch #85: Designing a Modern Data Stack
Data Engineer's Lunch #85: Designing a Modern Data Stack
 
OSTHUS-Allotrope presents "Laboratory Informatics Strategy" at SmartLab 2015
OSTHUS-Allotrope presents "Laboratory Informatics Strategy" at SmartLab 2015OSTHUS-Allotrope presents "Laboratory Informatics Strategy" at SmartLab 2015
OSTHUS-Allotrope presents "Laboratory Informatics Strategy" at SmartLab 2015
 
load speed problems of web resources on the client side classification and ...
 load speed problems of web resources on the client side  classification and ... load speed problems of web resources on the client side  classification and ...
load speed problems of web resources on the client side classification and ...
 
Horses for Courses: Database Roundtable
Horses for Courses: Database RoundtableHorses for Courses: Database Roundtable
Horses for Courses: Database Roundtable
 
How to choose the best frontend framework in 2022
How to choose the best frontend framework in 2022How to choose the best frontend framework in 2022
How to choose the best frontend framework in 2022
 

Kürzlich hochgeladen

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Designing for Performance: Database Related Worst Practices

  • 1. BASLE BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH Designing for Performance: Database Related Worst Practices Christian Antognini
  • 2. @ChrisAntognini Designing for Performance: Database Related Worst Practices2 9/2/2015 Senior principal consultant, trainer and partner at Trivadis in Zurich (CH) christian.antognini@trivadis.com http://antognini.ch Focus: get the most out of Oracle Database Logical and physical database design Query optimizer Application performance management Author of Troubleshooting Oracle Performance (Apress, 2008/14) OakTable Network, Oracle ACE Director
  • 3. Agenda Designing for Performance: Database Related Worst Practices3 9/2/2015 1. Introduction 2. Worst Practices 3. Core Messages
  • 4. Designing for Performance: Database Related Worst Practices4 9/2/2015 Introduction
  • 5. Where Does This Information Come From? Designing for Performance: Database Related Worst Practices5 9/2/2015 Personal experience! I spent most of the last 15 years troubleshooting performance problems. Hundreds of different projects and applications A number of industries were involved According to my experience, most of the database-related performance problems are caused by a limited number of issues. In this presentation I cover the top 10 Even though some of them may seem very basic, do not underestimate the number of systems that are now running and suffering because of them!
  • 6. Why It’s Important? Designing for Performance: Database Related Worst Practices6 9/2/2015 Many performance problems can be avoided with sound planning and design. Do the right thing! There is a widespread lack of knowledge in our industry! The same mistakes are made again and again. “To err is human, to persist in it, is diabolical” – Seneca
  • 7. Designing for Performance: Database Related Worst Practices7 9/2/2015 Source: @peter_berner
  • 8. It’s not Premature Optimization! Designing for Performance: Database Related Worst Practices8 9/2/2015 “Premature optimization is the root of all evil” – Donald Knuth The misconception based on that particular quote is that a developer, while writing code, should ignore optimization altogether. In my opinion, this interpretation is wrong! My take: Developers should avoid micro optimizations that have local impact. Developers should care about optimizations that have global impact, like the design of a system, the algorithms used to implement the required functionality, or in which layer a specific processing should be performed.
  • 9. Designing for Performance: Database Related Worst Practices9 9/2/2015 Worst Practices
  • 10. Lack of Logical Database Design Designing for Performance: Database Related Worst Practices10 9/2/2015 Once upon a time, it was considered obvious that one should have a data architect involved in every development project. Today, unfortunately, too often I see projects in which no formal database design is done. The database is considered a dumb device. The logical database design depends on the target database engine. Schema-on-write vs schema-on-read
  • 11. Implementing Generic Tables Designing for Performance: Database Related Worst Practices11 9/2/2015 In the quest of flexibility, generic database designs are implemented. Entity-attribute-value models XML-based designs Flexibility is tied to performance! In some situations suboptimal performance might be good enough. In other situations it might be catastrophic.
  • 12. Not Using Constraints to Enforce Data Integrity Designing for Performance: Database Related Worst Practices12 9/2/2015 Constraints are not only fundamental to guarantee data integrity, but they are also extensively used by query optimizers during the generation of execution plans. Cons of checking the constraints at the application level: More code being written and tested Potential problems with data integrity Greater consumption of resources (not always) Leads to less scalable locking schemes (not always)
  • 13. Lack of Physical Database Design Designing for Performance: Database Related Worst Practices13 9/2/2015 It is not uncommon to see projects where the logical design is directly mapped to the physical design. The physical database design depends on target database engine. Heap tables, clustered tables, IOT Many type of indexes exist Data partitioning Do not forget to define and implement a data-archiving concept.
  • 14. Not Choosing the Right Data Type Designing for Performance: Database Related Worst Practices14 9/2/2015 In recent years, I have witnessed a disturbing trend in physical database design: wrong datatype selection. E.g. VARCHAR2 instead of DATE or TIMESTAMP There are four main problems related to wrong datatype selection: Wrong or lacking validation of data Loss of information Things do not work as expected Query optimizer anomalies
  • 15. Not Using Bind Variables Correctly Designing for Performance: Database Related Worst Practices15 9/2/2015 From a performance point of view, bind variables introduce both an advantage and a disadvantage. Only applies to database engines having a cursor cache. The advantage of using bind variables is that they allow the sharing of cursors. The disadvantage of using bind variables in WHERE clauses, and only in WHERE clauses, is that crucial information is sometimes hidden from the query optimizer. From a security point of view, bind variables prevent the risks associated with SQL injection.
  • 16. Not Using Advanced Database Features Designing for Performance: Database Related Worst Practices16 9/2/2015 High-end database engines provide many advanced features that can drastically reduce development costs while boosting performance. E.g. data-centric processing should take place as closely as possible to the data Leverage your investment by taking advantage of those features as much as possible. Most of the time, database-independent applications are not required. I would recommend to develop a database-independent application only when there are very good reasons for doing it. Companies are more likely to change the whole application before changing just the database engine.
  • 17. Performing Unnecessary Commits Designing for Performance: Database Related Worst Practices17 9/2/2015 Commits are operations that call for serialization. Every operation that leads to serialization inhibits scalability. Serialization is unwanted and should be minimized as much as possible.
  • 18. Steadily Opening and Closing Database Connections Designing for Performance: Database Related Worst Practices18 9/2/2015 Opening a database connection that in turn starts an associated process or thread on the database server is not a lightweight operation. Do not underestimate the amount of time and resources required. A worst-case scenario that I sometimes observe is a web application that opens and closes a database connection for every request that involves a database access. Using a pool of connections is of paramount importance.
  • 19. Opening Too Many Database Connections Designing for Performance: Database Related Worst Practices19 9/2/2015 A database connection that as an associated process or thread on the database server is not a lightweight resource. A processor core cannot efficiently handle many concurrent processes or threads. Using a pool of connections of limited size is of paramount importance.
  • 20. Designing for Performance: Database Related Worst Practices20 9/2/2015 Core Messages
  • 21. Designing for Performance: Database Related Worst Practices21 9/2/2015 Let’s Face it, Information Technology Is Expensive! Simple solutions for simple problems, elegant solutions for complex problems.
  • 22. One Size Fits All? Designing for Performance: Database Related Worst Practices22 9/2/2015 Use the right tool for the right job.
  • 23. Designing for Performance: Database Related Worst Practices23 9/2/2015 Performance Is Not an Option Optimal performance is not simply a product one can buy but rather the results of an accurate planning and a correct implementation.
  • 24. Questions and Answers Christian Antognini Senior Principal Consultant christian.antognini@trivadis.com 9/2/2015 Designing for Performance: Database Related Worst Practices24