This Slideshare presentation is a partial preview of the full business document. To view and download the full document, please go here:
http://flevy.com/browse/business-document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
Part 5 of a multi-part series of presentations on the management discipline of database administration. This part covers database application development coding, issues, and concerns. The entire series can be used to implement an efficient and effective database administration function at your organization. This first part covers the following areas:
- Database Application Development & SQL
- Defining Transactions
- Locking
- Batch Processing
2. SQL
• SQL is the de facto standard for accessing
relational databases
• SQL is a high-level language that provides a
greater degree of abstraction than do
traditional procedural languages
• SQL is designed such that programmers
specify what data is needed.
– It does not—indeed it cannot—specify how to
retrieve it
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
3. SQL
Statement
Database Tables
Result Set (table)
Relational Closure
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
4. SQL Middleware and APIs
• JDBC
– JDBC enables Java to access relational databases.
– Similar to ODBC, JDBC consists of a set of classes and
interfaces that can be used to access relational data.
– There are several types of JDBC middleware, including
the JDBC-to-ODBC bridge, as well as direct JDBC
connectivity to the relational database.
– Anyone familiar with application programming and
ODBC (or any call-level interface) can get up and
running with JDBC quickly
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
5. SQL Middleware and APIs
• OLE DB
– Object Linking and Embedding Database
– OLE DB presents an object-oriented interface for generic
data access.
– Based on the COM architecture
– OLE DB provides greater flexibility than ODBC because it
can be used to access both relational and nonrelational
data.
– OLE DB is conceptually divided into consumers and
providers.
• consumers are the applications that need access to the data
• providers are the software components that implement the
interface and thereby provide the data to the consumer.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
6. Microsoft .NET
• ... is a set of Microsoft technologies for
connecting people, systems, and devices
• ... allows Internet Servers to expose functions
to any client named as .NET web services
• … enables software to be delivered as a
service over the web
• … is designed to let many different services
and systems interactThis document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
7. EIS TierClient Tier
Java
Standalone
Runtime
Database
Web Tier
JSP
Pages
Browser
Business Tier
Servlets
Enterprise
JavaBeans
Business
Components
for Java
Java
Application
Pure HTML
Applet
J2EE and Java
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
8. Other Application Choices
• There are other choices, including
– Ruby on Rails
– Ajax
– PHP
– C/C++
– And so on…
• This is not an exhaustive list…
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
9. Impedance Mismatch
• When OO programming language is used to
access a relational database, you must map
objects to relations.
– OO programs deal with objects
– RDBMSs deal with relations, (that is, tables)
• Applications will not be object-oriented in the
“true” sense of the word because the data will
not be encapsulated within the method (that
is, the program).
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
10. Types of SQL
• SQL can be planned or unplanned.
– A planned SQL request is typically embedded into an application program, but
it might also exist in a query or reporting tool. At any rate, a planned SQL
request is designed and tested for accuracy and efficiency before it is run in a
production system. Contrast this with the characteristics of an unplanned SQL
request. Unplanned SQL, also called ad hoc SQL, is created “on the fly” by end
users during the course of business. Most ad hoc queries are created to
examine data for patterns and trends that impact business. Unplanned, ad hoc
SQL requests can be a significant source of inefficiency and are difficult to
tune. How do you tune requests that are constantly written, rewritten, and
changed?
• SQL can either be embedded in a program or issued stand-alone.
– Embedded SQL is contained within an application program, whereas stand-
alone SQL is run by itself or within a query, reporting, or OLAP tool.
• SQL can be dynamic or static.
– A dynamic SQL statement is optimized at run time. Depending on the DBMS, a
dynamic SQL statement may also be changed at run time. Static SQL, on the
other hand, is optimized prior to execution and cannot change without
reprogramming. Favor static SQL to minimize the possibility of SQL injection
attacks.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
11. What is XML?
• XML stands for eXtensible
Markup Language.
– Like HTML, XML is based on SGML
– HTML uses tags to describe the
appearance of data on a page,
whereas XML uses tags to describe
the data itself, instead of its
appearance.
– Allows documents to be self-
describing, through the
specification of tag sets and the
structural relationships between
the tags.
• XML is actually a meta
language (a language used to
define other languages).
– These languages are collected
in dictionaries called DTDs
Document Type Definitions.
– The DTD stores definitions of
tags for specific industries or
fields of knowledge.
– The DTD for an XML document
can be either part of the
document or stored in an
external file.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
12. Defining Transactions
• A transaction is an atomic unit of work with
respect to recovery and consistency.
• When all the steps that make up a specific
transaction have been accomplished, a
COMMIT is issued.
– ROLLBACK before COMMIT to undo transaction’s
work
• DBMS maintains transaction log
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
13. TP System Versus DBMS (Stored Procs)
Relational
DBMS
Stored
Procedures
Presentation
(Client)
DiskRelational
DBMS (1)
Transaction
Server
Workflow
Controller
Presentation
(Client)
Disk
Relational
DBMS (2)
Disk
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
14. Granularity of Lock
AccessConcurrency
Column Row Page Table Tablespace Database
High
Low
Level of Lock Granularity
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
15. Lock Compatibility
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
16. Lock Duration
• Lock duration refers to the length of time that
a lock is held by the DBMS.
• Two parameters impact lock duration:
– Isolation level
– Acquire/Release
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
17. Lock Escalation
• Lock escalation is the process of increasing the
lock granularity for a process or program.
• Typically controlled by system parameters and
DDL parameters in CREATE statements.
• For example:
– If a threshold is hit for the number of locks being held
by a process (or by the entire DBMS), page locks (or
row locks) can be escalated to table locks.
– Can cause concurrency issues
• If the entire table is locked other processes cannot access
the data
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
18. Questions
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-database-application-design-part-5-576
19. 1
Flevy (www.flevy.com) is the marketplace
for premium documents. These
documents can range from Business
Frameworks to Financial Models to
PowerPoint Templates.
Flevy was founded under the principle that
companies waste a lot of time and money
recreating the same foundational business
documents. Our vision is for Flevy to
become a comprehensive knowledge base
of business documents. All organizations,
from startups to large enterprises, can use
Flevy— whether it's to jumpstart projects, to
find reference or comparison materials, or
just to learn.
Contact Us
Please contact us with any questions you may have
about our company.
• General Inquiries
support@flevy.com
• Media/PR
press@flevy.com
• Billing
billing@flevy.com