Communicating with the Outside. Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency ControlRecovery Storage Subsystem Indexes Query.

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Advertisements

Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
Database System Concepts and Architecture
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
--What is a Database--1 What is a database What is a Database.
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
1 - Oracle Server Architecture Overview
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
1 C. Shahabi Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California
Communicating with the Outside. Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency ControlRecovery Storage Subsystem Indexes Query.
Homework 2 In the docs folder of your Berkeley DB, have a careful look at documentation on how to configure BDB in main memory. In the docs folder of your.
Client-server database systems and ODBC l Client-server architecture and components l More on reliability and security l ODBC standard.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Overview of Database Languages and Architectures.
Database System Architectures  Client-server Database System  Parallel Database System  Distributed Database System Wei Jiang.
1 © Prentice Hall, 2002 The Client/Server Database Environment.
Lecture The Client/Server Database Environment
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
The Client/Server Database Environment
SEMESTER 1, 2013/2014 DB2 APPLICATION DEVELOPMENT OVERVIEW.
Enterprise Object Framework. What is EOF? Enterprise Objects Framework is a set of tools and resources that help you create applications that work with.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
JDBC Vs. Java Blend Presentation by Gopal Manchikanti Shivakumar Balasubramanyam.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Interacting With Data Databases.
Lecture On Database Analysis and Design By- Jesmin Akhter Lecturer, IIT, Jahangirnagar University.
MBA 664 Database Management Systems Dave Salisbury ( )
Chapter 2 CIS Sungchul Hong
Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”
Database Architecture Introduction to Databases. The Nature of Data Un-structured Semi-structured Structured.
CSC271 Database Systems Lecture # 4.
Database Environment Chapter 2 AIT632 Sungchul Hong.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Communicating with the Outside. Overview Package several SQL statements within one call to the database server Embedded procedural language (Transact.
© Dennis Shasha, Philippe Bonnet – 2013 Communicating with the Outside.
CS 405G: Introduction to Database Systems Database programming.
Universal Data Access and OLE DB. Customer Requirements for Data Access Technologies High-Performance access to data Reliability Vendor Commitment Broad.
Dr Gordon Russell, Napier University Unit Embedded SQL - V3.0 1 Embedded SQL Unit 5.1.
JDBC. JDBC stands for Java Data Base Connectivity. JDBC is different from ODBC in that – JDBC is written in Java (hence is platform independent, object.
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
Personal Computer - Stand- Alone Database  Database (or files) reside on a PC - on the hard disk.  Applications run on the same PC and directly access.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 14 Using Relational Databases to Provide Object Persistence (Overview) Modern Database.
Improving Database Performance Derrick Rapley
CVSQL 2 Current Project Status. CVSQL Server – Status Configuration Manager –Handles server and database configuration files: To Do Authentication Subsystem.
Lesson Overview 3.1 Components of the DBMS 3.1 Components of the DBMS 3.2 Components of The Database Application 3.2 Components of The Database Application.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
ICS 321 Fall 2009 DBMS Application Programming Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 10/06/20091Lipyeow.
ICS 321 Fall 2010 SQL in a Server Environment (i) Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 11/1/20101Lipyeow.
INTRODUCTION TO DBS Database: a collection of data describing the activities of one or more related organizations DBMS: software designed to assist in.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
12/6/2015B.Ramamurthy1 Java Database Connectivity B.Ramamurthy.
UNIT III - JDBC JDBC Overview – JDBC implementation – Connection class – Statements - Catching Database Results, handling database Queries. Networking–
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
University of Sunderland COM 220 Lecture Ten Slide 1 Database Performance.
Java JDBC API. A Java API To Access almost any kind of tabular data To Access almost any kind of tabular data Trademarked (not an acronym) Trademarked.
Object storage and object interoperability
Basics of JDBC Session 14.
Introduction Because database applications today reside in a complicated environment, various standards have been developed for accessing database servers.
Em Spatiotemporal Database Laboratory Pusan National University File Processing : Database Management System Architecture 2004, Spring Pusan National University.
In the Name Of Almighty Allah. Java Application Connection To Mysql Created by Hasibullah (Sahibzada) Kabul Computer Science Faculty Afghanistan.
Troubleshooting Dennis Shasha and Philippe Bonnet, 2013.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
CS 540 Database Management Systems
Indexes By Adrienne Watt.
The Client/Server Database Environment
Database JDBC Overview CS Programming Languages for Web Applications
The Client/Server Database Environment
Software Architecture in Practice
Database System Concepts and Architecture
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Tiers vs. Layers.
Presentation transcript:

Communicating with the Outside

Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency ControlRecovery Storage Subsystem Indexes Query Processor Application

The ways applications accessing the Database System 4GL(fourth generation language) –Execute at high level resulting in small programs –Hider portability, different vendors offers different 4GLs Programming language + Call Level Interface –ODBC(Open DataBase Connectivity) for c/c++ –JDBC: Java based API, for Java –Database specific ODBC drivers: OCI (C++/Oracle), CLI (C++/ DB2) –Perl/DBI

API pitfalls Cost of portability –Layer of abstraction on top of ODBC drivers to hide discrepancies across drivers with different conformance levels. –Beware of performance problems in this layer of abstraction: Use of meta-data description when submitting queries, accessing the result set Iterations over the result set

ODBC vs. OCI ODBC vs. OCI on Oracle8iEE on Windows 2000 Iteration over a result set one record at a time. Prefetching is performed. Low OCI overhead when number of records transferred is small ODBC performs better when number of records transferred increases due to it’s good at prefetching.

Client-Server Mechanisms Connection pooling and multiplexing when multiple clients access a server Communication buffer on the database server. One per connection. –If a client does not consume results fast enough, then the server holds resources until it can output the result. –Data is sent either when the communication buffer is full or when a batch is finished executing. Small buffer – frequent transfer overhead Large buffer – time to first record increases. No actual impact on a 100 Mb network. More sensitive in an intranet with low bandwidth.

Communication buffer

Harmful small objects authorized(user, type) doc(id, type, date) What are the document instances a user can see? SQL: select doc.id, doc.date from authorized, doc where doc.type = authorized.type and authorized.user = If documents and doctypes are encapsulated in objects, the risk is the following: –Find types t authorized for user input select doc.type as t from authorized where user = –For each type t issue the query select id, date from doc where type = ; –The join is executed in the application and not in the DB!

Tuning the Application Interface Avoid user interaction within a transaction Minimize the number of roundtrips between the application and the database Retrieve needed columns only Retrieve needed rows only Minimize the number of query compilations

Avoid User Interaction within a Transaction User interaction within a transaction forces locks to be held for a long time. Careful transaction design (possibly transaction chopping) to avoid this problem.

Minimize the Number of Roundtrips to the Database Rule of thumb: crossing the interface between the application and the database server is costly Avoid Loops: –Application programming languages offer looping facilities (SQL statements, cursors, positioned updates) Positioned updates: ODBC allows updating the rows that are obtained as the result of a query, this forces the processing of updates one row at a time –Rigid object-oriented programming might force such loops.

Avoid External Loops No loop: sqlStmt = “select * from lineitem where l_partkey <= 200;” odbc->prepareStmt(sqlStmt); odbc->execPrepared(sqlStmt); Loop: sqlStmt = “select * from lineitem where l_partkey = ?;” odbc->prepareStmt(sqlStmt); for (int i=1; i<200; i++) { odbc->bindParameter(1, SQL_INTEGER, i); odbc->execPrepared(sqlStmt); }

Avoid External Loops SQL Server 2000 on Windows 2000 Crossing the application interface has a significant impact on performance Let the DBMS optimize set operations Fetch 2000 records Loop: 200 queries No loop: 1 query Crossing the application interface too often hurts performances.

Avoid Cursors No cursor select * from employees; Cursor DECLARE d_cursor CURSOR FOR select * from employees; OPEN d_cursor while = 0) BEGIN FETCH NEXT from d_cursor END CLOSE d_cursor go

Avoiding Cursors Cursors are terribly slow in almost all systems Using the cursor, records are transmitted from the database server to the application one at a time. Query fetches bytes records Response time is a few seconds with a SQL query and more than an hour iterating over a cursor.

summary