SlideShare a Scribd company logo
1 of 38
Improving the Quality of Large-Scale
Database-Centric Software Systems by
Analyzing Database Access Code
1
Tse-Hsun(Peter) Chen
Supervised by Ahmed E. Hassan
Common performance problems in
database-access code
2
DBMSCode
• Inefficient data access
Inefficient data access
3
for each userId{
…
executeQuery(“select … where
u.id = userId”);
}
Code
SQL select … from user where u.id = 1
select … from user where u.id = 2
…
Common performance problems in
database-access code
4
DBMSCode
• Inefficient data access
• Unneeded data access
Unneeded data access
5
DBMSCode
Require
user data in
the code
Actual request sent
Team TableUser Table
join
Common performance problems in
database-access code
6
DBMSCode
• Inefficient data access
• Unneeded data access
• Overly-strict isolation level
Overly-strict isolation level
7
DBMSCode
Reading only
user name
set read-write transaction
select … from user
Cannot find problems by only looking
at the DBMS side
8
DBMS
select … from user where u.id = 1
select … from user where u.id = 2
…for each userId{
…
executeQuery(“
select … where u.id = userId”);
}
Database accesses are abstracted
9
DBMSCode
Abstraction
Layers
Problems become more complex and
frequent after adding abstraction layers
Accessing data using ORM incorrectly
10
@Entity
Class User{
…
}
for each userId{
User u = findUserById(userId);
u.getName();
}
A database
entity class
Objects
SQL
select … from user where u.id = 1
select … from user where u.id = 2
…
Research statement
There are common problems in how developers write
database-access code, and these problems are hard to
diagnose by only looking at the DBMS. In addition, due
to the use of different database abstraction layers, these
problems become even harder to find.
By finding problems in the database access code and
configuring the abstraction layers correctly, we can
significantly improve the performance of database-
centric systems.
11
12
Detecting inefficient
data access code
Overview of the thesis
Detecting unneeded
data access
Finding overly-strict
isolation level
Finished work Future work
Under
submission
Detecting unneeded
data access
13
Detecting inefficient
data access code
Overview of the thesis
Finding overly-strict
isolation level
Finished work Future work
Under
submission
Inefficient data access detection
framework
Inefficient data access detection and
ranking framework
Ranked according to
performance impact
Ranked
inefficient
data access
code
Source
Code
detection
ranking
14
Inefficient data access detection
framework
Inefficient data access detection and
ranking framework
Ranked according to
performance impact
Ranked
inefficient
data access
code
Source
Code
detection
ranking
15
Focus on one type of inefficient
data access: one-by-one processing
Detecting one-by-one processing
using static analysis
16
First find all the functions that
read/write from/to DBMS
Class User{
getUserById()…
getUserAddress()…
}
Identify the positions of all loops
for each userId{
foo(userId)
}
Check if the loop contains any
database-accessing function
foo (userId){
getUserById(userId)
}
Inefficient data access detection
framework
Inefficient data access detection and
ranking framework
Ranked according to
performance impact
Ranked
inefficient
data access
code
Source
Code
detection
ranking
17
Inefficient data access detection
framework
Inefficient data access detection and
ranking framework
Ranked according to
performance impact
Ranked
inefficient
data access
code
Source
Code
detection
ranking
18
Assessing inefficient data access
impact by fixing the problem
Execution
Response time
for u in users{
update u
}
Code with
inefficient data access
users.updateAll()
Code without
inefficient data access
19
Execute test
suite 30 times
Response time
after the fix
Avg. %
improvement
Execution
Execute test
suite 30 times
Inefficient data access causes
large performance impacts
0%
20%
40%
60%
80%
100%
One-by-one processing
20
%improvementinresponsetime
Detecting unneeded
data access
21
Detecting inefficient
data access code
Overview of the thesis
Finding overly-strict
isolation level
Finished work Future work
Under
submission
22
Detecting inefficient
data access code
Overview of the thesis
Finding overly-strict
isolation level
Finished work Future work
Under
submission
Detecting unneeded
data access
Intercepting system executions using
byte code instrumentation
ORM
DBMS
23
Intercept called
functions in the code
Intercept ORM
generated SQLs
Needed
data
Requested
data
diff
Mapping data access to called
functions
24
@Entity
@Table(name = “user”)
public class User{
…
@Column(name=“name”)
String userName;
@OneToMany
List<Team> teams;
public String getUserName(){
return userName;
}
public void addTeam(Team t){
teams.add(t);
}
User.java
We apply static analysis to
find which database
column a function is
reading/modifying
24
Identifying unneeded data access
from intercepted data
Only user name is needed in the
application logic
Needed user name in code
Requested id, name,
address, phone number
25
26
Detecting inefficient
data access code
Overview of the thesis
Finding overly-strict
isolation level
Finished work Future work
Under
submission
Detecting unneeded
data access
Detecting unneeded
data access
27
Detecting inefficient
data access code
Overview of the thesis
Finding overly-strict
isolation level
Finished work Future work
Under
submission
A real life example of transaction
abstraction problem
28
All functions in foo will be
executed in transactions
@Transactional
public class foo{
int getFooVal(){
return foo.val;
}
…
}
This function does not need to be
executed in transactions
Where to put the transaction may affect
system behavior and performance
Plans for finding transaction problems
related abstraction
29
Bug
Reports
Categories of
transaction-
related bugs
We plan to empirically study bug reports
to find root causes and implement a
detection framework
30
31
32
33
34
35
36
37
38
http://petertsehsun.github.io

More Related Content

Viewers also liked

Visual Exploration of Large-Scale Evolving Software
Visual Exploration of Large-Scale Evolving SoftwareVisual Exploration of Large-Scale Evolving Software
Visual Exploration of Large-Scale Evolving SoftwareRichard Wettel
 
Model-based Analysis of Large Scale Software Repositories
Model-based Analysis of Large Scale Software RepositoriesModel-based Analysis of Large Scale Software Repositories
Model-based Analysis of Large Scale Software RepositoriesMarkus Scheidgen
 
Large scale software development
Large scale software development Large scale software development
Large scale software development mahamiqbalrajput
 
Jan-Erik Sandberg - Succeeding with Large Scale Agile
Jan-Erik Sandberg - Succeeding with Large Scale AgileJan-Erik Sandberg - Succeeding with Large Scale Agile
Jan-Erik Sandberg - Succeeding with Large Scale AgileAgile Lietuva
 
Searching for Key Stakeholders in Large-Scale Software Projects
Searching for Key Stakeholders in Large-Scale Software ProjectsSearching for Key Stakeholders in Large-Scale Software Projects
Searching for Key Stakeholders in Large-Scale Software ProjectsSoo Ling Lim
 
Agile Project-Based Teaching and Learning
Agile Project-Based Teaching and LearningAgile Project-Based Teaching and Learning
Agile Project-Based Teaching and LearningDagmar Monett
 
Key Issues for Requirements Engineering (lecture slides)
Key Issues for Requirements Engineering (lecture slides)Key Issues for Requirements Engineering (lecture slides)
Key Issues for Requirements Engineering (lecture slides)Dagmar Monett
 
Requirements Engineering Methods for Documenting Requirements (lecture slides)
Requirements Engineering Methods for Documenting Requirements (lecture slides)Requirements Engineering Methods for Documenting Requirements (lecture slides)
Requirements Engineering Methods for Documenting Requirements (lecture slides)Dagmar Monett
 
Methods for Validating and Testing Software Requirements (lecture slides)
Methods for Validating and Testing Software Requirements (lecture slides)Methods for Validating and Testing Software Requirements (lecture slides)
Methods for Validating and Testing Software Requirements (lecture slides)Dagmar Monett
 
Modelling Software Requirements: Important diagrams and templates (lecture sl...
Modelling Software Requirements: Important diagrams and templates (lecture sl...Modelling Software Requirements: Important diagrams and templates (lecture sl...
Modelling Software Requirements: Important diagrams and templates (lecture sl...Dagmar Monett
 
Requirements Engineering Techniques for Eliciting Requirements (lecture slides)
Requirements Engineering Techniques for Eliciting Requirements (lecture slides)Requirements Engineering Techniques for Eliciting Requirements (lecture slides)
Requirements Engineering Techniques for Eliciting Requirements (lecture slides)Dagmar Monett
 

Viewers also liked (11)

Visual Exploration of Large-Scale Evolving Software
Visual Exploration of Large-Scale Evolving SoftwareVisual Exploration of Large-Scale Evolving Software
Visual Exploration of Large-Scale Evolving Software
 
Model-based Analysis of Large Scale Software Repositories
Model-based Analysis of Large Scale Software RepositoriesModel-based Analysis of Large Scale Software Repositories
Model-based Analysis of Large Scale Software Repositories
 
Large scale software development
Large scale software development Large scale software development
Large scale software development
 
Jan-Erik Sandberg - Succeeding with Large Scale Agile
Jan-Erik Sandberg - Succeeding with Large Scale AgileJan-Erik Sandberg - Succeeding with Large Scale Agile
Jan-Erik Sandberg - Succeeding with Large Scale Agile
 
Searching for Key Stakeholders in Large-Scale Software Projects
Searching for Key Stakeholders in Large-Scale Software ProjectsSearching for Key Stakeholders in Large-Scale Software Projects
Searching for Key Stakeholders in Large-Scale Software Projects
 
Agile Project-Based Teaching and Learning
Agile Project-Based Teaching and LearningAgile Project-Based Teaching and Learning
Agile Project-Based Teaching and Learning
 
Key Issues for Requirements Engineering (lecture slides)
Key Issues for Requirements Engineering (lecture slides)Key Issues for Requirements Engineering (lecture slides)
Key Issues for Requirements Engineering (lecture slides)
 
Requirements Engineering Methods for Documenting Requirements (lecture slides)
Requirements Engineering Methods for Documenting Requirements (lecture slides)Requirements Engineering Methods for Documenting Requirements (lecture slides)
Requirements Engineering Methods for Documenting Requirements (lecture slides)
 
Methods for Validating and Testing Software Requirements (lecture slides)
Methods for Validating and Testing Software Requirements (lecture slides)Methods for Validating and Testing Software Requirements (lecture slides)
Methods for Validating and Testing Software Requirements (lecture slides)
 
Modelling Software Requirements: Important diagrams and templates (lecture sl...
Modelling Software Requirements: Important diagrams and templates (lecture sl...Modelling Software Requirements: Important diagrams and templates (lecture sl...
Modelling Software Requirements: Important diagrams and templates (lecture sl...
 
Requirements Engineering Techniques for Eliciting Requirements (lecture slides)
Requirements Engineering Techniques for Eliciting Requirements (lecture slides)Requirements Engineering Techniques for Eliciting Requirements (lecture slides)
Requirements Engineering Techniques for Eliciting Requirements (lecture slides)
 

Similar to ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software Systems by Analyzing Database Access Code

TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...
TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...
TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...Concordia University
 
Mechanisms for Database Intrusion Detection and Response
Mechanisms for Database Intrusion Detection and ResponseMechanisms for Database Intrusion Detection and Response
Mechanisms for Database Intrusion Detection and ResponseAshish Kamra
 
ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...
ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...
ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...Concordia University
 
Icse2014 v3
Icse2014 v3Icse2014 v3
Icse2014 v3SAIL_QU
 
Introduction to DBMS.pptx
Introduction to DBMS.pptxIntroduction to DBMS.pptx
Introduction to DBMS.pptxSreenivas R
 
Ista presentation-dga
Ista presentation-dgaIsta presentation-dga
Ista presentation-dgavinaykumar R
 
Database security and security in networks
Database security and security in networksDatabase security and security in networks
Database security and security in networksG Prachi
 
Data Architectures for Robust Decision Making
Data Architectures for Robust Decision MakingData Architectures for Robust Decision Making
Data Architectures for Robust Decision MakingGwen (Chen) Shapira
 
Database Management system
Database Management systemDatabase Management system
Database Management systemVijay Thorat
 
Project Presentation
Project PresentationProject Presentation
Project PresentationShariffAyesha
 
CH05-CompSec4e.pptx
CH05-CompSec4e.pptxCH05-CompSec4e.pptx
CH05-CompSec4e.pptxIkmal71
 
Improving the Performance of Database-Centric Applications Through Program An...
Improving the Performance of Database-Centric Applications Through Program An...Improving the Performance of Database-Centric Applications Through Program An...
Improving the Performance of Database-Centric Applications Through Program An...Concordia University
 
Creating a Multi-Layered Secured Postgres Database
Creating a Multi-Layered Secured Postgres DatabaseCreating a Multi-Layered Secured Postgres Database
Creating a Multi-Layered Secured Postgres DatabaseEDB
 
Data Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your DatabaseData Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your DatabaseMichael Rosenblum
 
JAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and RetrievalJAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and RetrievalDr. Ranbijay Kumar
 

Similar to ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software Systems by Analyzing Database Access Code (20)

TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...
TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...
TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...
 
Mechanisms for Database Intrusion Detection and Response
Mechanisms for Database Intrusion Detection and ResponseMechanisms for Database Intrusion Detection and Response
Mechanisms for Database Intrusion Detection and Response
 
Lecture 15-16.pdf
Lecture 15-16.pdfLecture 15-16.pdf
Lecture 15-16.pdf
 
ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...
ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...
ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...
 
Icse2014 v3
Icse2014 v3Icse2014 v3
Icse2014 v3
 
Introduction to DBMS.pptx
Introduction to DBMS.pptxIntroduction to DBMS.pptx
Introduction to DBMS.pptx
 
Ista presentation-dga
Ista presentation-dgaIsta presentation-dga
Ista presentation-dga
 
Database security and security in networks
Database security and security in networksDatabase security and security in networks
Database security and security in networks
 
Data Architectures for Robust Decision Making
Data Architectures for Robust Decision MakingData Architectures for Robust Decision Making
Data Architectures for Robust Decision Making
 
Database Management system
Database Management systemDatabase Management system
Database Management system
 
DBMS PPT.pptx
DBMS PPT.pptxDBMS PPT.pptx
DBMS PPT.pptx
 
Project Presentation
Project PresentationProject Presentation
Project Presentation
 
CH05-CompSec4e.pptx
CH05-CompSec4e.pptxCH05-CompSec4e.pptx
CH05-CompSec4e.pptx
 
Susi
Susi Susi
Susi
 
Improving the Performance of Database-Centric Applications Through Program An...
Improving the Performance of Database-Centric Applications Through Program An...Improving the Performance of Database-Centric Applications Through Program An...
Improving the Performance of Database-Centric Applications Through Program An...
 
Creating a Multi-Layered Secured Postgres Database
Creating a Multi-Layered Secured Postgres DatabaseCreating a Multi-Layered Secured Postgres Database
Creating a Multi-Layered Secured Postgres Database
 
Data Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your DatabaseData Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your Database
 
DBMS
DBMSDBMS
DBMS
 
JAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and RetrievalJAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and Retrieval
 
unit 1.pdf
unit 1.pdfunit 1.pdf
unit 1.pdf
 

More from Concordia University

Towards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent supportTowards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent supportConcordia University
 
A first look at the integration of machine learning models in complex autonom...
A first look at the integration of machine learning models in complex autonom...A first look at the integration of machine learning models in complex autonom...
A first look at the integration of machine learning models in complex autonom...Concordia University
 
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...Concordia University
 
ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...
ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...
ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...Concordia University
 
FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...
FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...
FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...Concordia University
 
CSER2016 - Detecting Problems in Database Access Code of Large Scale Systems
CSER2016 - Detecting Problems in Database Access Code of Large Scale SystemsCSER2016 - Detecting Problems in Database Access Code of Large Scale Systems
CSER2016 - Detecting Problems in Database Access Code of Large Scale SystemsConcordia University
 
ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...
ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...
ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...Concordia University
 
MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...
MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...
MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...Concordia University
 
MSR2014 - An Empirical Study of Dormant Bugs
MSR2014 - An Empirical Study of Dormant BugsMSR2014 - An Empirical Study of Dormant Bugs
MSR2014 - An Empirical Study of Dormant BugsConcordia University
 
MSR2012 - Explaining Software Defects Using Topic Models
MSR2012 - Explaining Software Defects Using Topic ModelsMSR2012 - Explaining Software Defects Using Topic Models
MSR2012 - Explaining Software Defects Using Topic ModelsConcordia University
 

More from Concordia University (11)

Towards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent supportTowards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent support
 
A first look at the integration of machine learning models in complex autonom...
A first look at the integration of machine learning models in complex autonom...A first look at the integration of machine learning models in complex autonom...
A first look at the integration of machine learning models in complex autonom...
 
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
 
Icse2018 autonomic
Icse2018 autonomicIcse2018 autonomic
Icse2018 autonomic
 
ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...
ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...
ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...
 
FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...
FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...
FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...
 
CSER2016 - Detecting Problems in Database Access Code of Large Scale Systems
CSER2016 - Detecting Problems in Database Access Code of Large Scale SystemsCSER2016 - Detecting Problems in Database Access Code of Large Scale Systems
CSER2016 - Detecting Problems in Database Access Code of Large Scale Systems
 
ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...
ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...
ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...
 
MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...
MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...
MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...
 
MSR2014 - An Empirical Study of Dormant Bugs
MSR2014 - An Empirical Study of Dormant BugsMSR2014 - An Empirical Study of Dormant Bugs
MSR2014 - An Empirical Study of Dormant Bugs
 
MSR2012 - Explaining Software Defects Using Topic Models
MSR2012 - Explaining Software Defects Using Topic ModelsMSR2012 - Explaining Software Defects Using Topic Models
MSR2012 - Explaining Software Defects Using Topic Models
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
"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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
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
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
"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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
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
 

ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software Systems by Analyzing Database Access Code

  • 1. Improving the Quality of Large-Scale Database-Centric Software Systems by Analyzing Database Access Code 1 Tse-Hsun(Peter) Chen Supervised by Ahmed E. Hassan
  • 2. Common performance problems in database-access code 2 DBMSCode • Inefficient data access
  • 3. Inefficient data access 3 for each userId{ … executeQuery(“select … where u.id = userId”); } Code SQL select … from user where u.id = 1 select … from user where u.id = 2 …
  • 4. Common performance problems in database-access code 4 DBMSCode • Inefficient data access • Unneeded data access
  • 5. Unneeded data access 5 DBMSCode Require user data in the code Actual request sent Team TableUser Table join
  • 6. Common performance problems in database-access code 6 DBMSCode • Inefficient data access • Unneeded data access • Overly-strict isolation level
  • 7. Overly-strict isolation level 7 DBMSCode Reading only user name set read-write transaction select … from user
  • 8. Cannot find problems by only looking at the DBMS side 8 DBMS select … from user where u.id = 1 select … from user where u.id = 2 …for each userId{ … executeQuery(“ select … where u.id = userId”); }
  • 9. Database accesses are abstracted 9 DBMSCode Abstraction Layers Problems become more complex and frequent after adding abstraction layers
  • 10. Accessing data using ORM incorrectly 10 @Entity Class User{ … } for each userId{ User u = findUserById(userId); u.getName(); } A database entity class Objects SQL select … from user where u.id = 1 select … from user where u.id = 2 …
  • 11. Research statement There are common problems in how developers write database-access code, and these problems are hard to diagnose by only looking at the DBMS. In addition, due to the use of different database abstraction layers, these problems become even harder to find. By finding problems in the database access code and configuring the abstraction layers correctly, we can significantly improve the performance of database- centric systems. 11
  • 12. 12 Detecting inefficient data access code Overview of the thesis Detecting unneeded data access Finding overly-strict isolation level Finished work Future work Under submission
  • 13. Detecting unneeded data access 13 Detecting inefficient data access code Overview of the thesis Finding overly-strict isolation level Finished work Future work Under submission
  • 14. Inefficient data access detection framework Inefficient data access detection and ranking framework Ranked according to performance impact Ranked inefficient data access code Source Code detection ranking 14
  • 15. Inefficient data access detection framework Inefficient data access detection and ranking framework Ranked according to performance impact Ranked inefficient data access code Source Code detection ranking 15 Focus on one type of inefficient data access: one-by-one processing
  • 16. Detecting one-by-one processing using static analysis 16 First find all the functions that read/write from/to DBMS Class User{ getUserById()… getUserAddress()… } Identify the positions of all loops for each userId{ foo(userId) } Check if the loop contains any database-accessing function foo (userId){ getUserById(userId) }
  • 17. Inefficient data access detection framework Inefficient data access detection and ranking framework Ranked according to performance impact Ranked inefficient data access code Source Code detection ranking 17
  • 18. Inefficient data access detection framework Inefficient data access detection and ranking framework Ranked according to performance impact Ranked inefficient data access code Source Code detection ranking 18
  • 19. Assessing inefficient data access impact by fixing the problem Execution Response time for u in users{ update u } Code with inefficient data access users.updateAll() Code without inefficient data access 19 Execute test suite 30 times Response time after the fix Avg. % improvement Execution Execute test suite 30 times
  • 20. Inefficient data access causes large performance impacts 0% 20% 40% 60% 80% 100% One-by-one processing 20 %improvementinresponsetime
  • 21. Detecting unneeded data access 21 Detecting inefficient data access code Overview of the thesis Finding overly-strict isolation level Finished work Future work Under submission
  • 22. 22 Detecting inefficient data access code Overview of the thesis Finding overly-strict isolation level Finished work Future work Under submission Detecting unneeded data access
  • 23. Intercepting system executions using byte code instrumentation ORM DBMS 23 Intercept called functions in the code Intercept ORM generated SQLs Needed data Requested data diff
  • 24. Mapping data access to called functions 24 @Entity @Table(name = “user”) public class User{ … @Column(name=“name”) String userName; @OneToMany List<Team> teams; public String getUserName(){ return userName; } public void addTeam(Team t){ teams.add(t); } User.java We apply static analysis to find which database column a function is reading/modifying 24
  • 25. Identifying unneeded data access from intercepted data Only user name is needed in the application logic Needed user name in code Requested id, name, address, phone number 25
  • 26. 26 Detecting inefficient data access code Overview of the thesis Finding overly-strict isolation level Finished work Future work Under submission Detecting unneeded data access
  • 27. Detecting unneeded data access 27 Detecting inefficient data access code Overview of the thesis Finding overly-strict isolation level Finished work Future work Under submission
  • 28. A real life example of transaction abstraction problem 28 All functions in foo will be executed in transactions @Transactional public class foo{ int getFooVal(){ return foo.val; } … } This function does not need to be executed in transactions Where to put the transaction may affect system behavior and performance
  • 29. Plans for finding transaction problems related abstraction 29 Bug Reports Categories of transaction- related bugs We plan to empirically study bug reports to find root causes and implement a detection framework
  • 30. 30
  • 31. 31
  • 32. 32
  • 33. 33
  • 34. 34
  • 35. 35
  • 36. 36
  • 37. 37