DEV351 ADO.NET Performance Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.

Slides:



Advertisements
Similar presentations
ADO vs ADO.NET ADOADO.NET Client/server coupledDisconnected collection of data from data server Uses RECORDSET object (contains one table) Uses DATASET.
Advertisements

DAT307 Developing Applications With SQL Server Desktop Edition (MSDE) Stephen Forte (USA) CTO, Corzen Inc Microsoft Regional Director- New York.
WEB401 Security Practices for Web Services (Part 2) Keith Ballinger Program Manager XML Messaging Microsoft Corporation.
WEB490 Developing Service-Oriented Architectures Brian Travis Chief Technical Officer Architag International Corp.
Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Passage Three Introduction to Microsoft SQL Server 2000.
1 Building Distributed Asynchronous Applications With SQL Service Broker Gerald Hinson, Roger Wolter DAT303 Dev Lead Microsoft Corporation.
Architecting a Large-Scale Data Warehouse with SQL Server 2005 Mark Morton Senior Technical Consultant IT Training Solutions DAT313.
OFC324 Microsoft Project Server: Putting Enterprise Project Management (EPM) To Work Sam Brooks
DAT304 Leveraging XML and HTTP with Sql Server Irwin Dolobowsky Program Manager Webdata Group.
Object Oriented Databases by Adam Stevenson. Object Databases Became commercially popular in mid 1990’s Became commercially popular in mid 1990’s You.
OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.
DBA230 Introducing SQL Server 2000 Reporting Services Jason Carlson Product Unit Manager SQL Server Microsoft Corporation.
OFC 322 Building Office Research Web Services: Exposing Corporate Data Through Office Brian Jones Program Manager Authoring Services Martin Sawicki Lead.
Database Design for DNN Developers Sebastian Leupold.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
OFC304 Excel 2003 Overview: XML Support Joseph Chirilov Program Manager.
Visual Studio ®.NET Data with XML Carlotta Eaton ( Associate Professor of IST New River Community College Slides by Microsoft Modified.
EBZ318 Deploying A Content Management Server 2002 Solution Case Study Daniel Kogan Program Manager Microsoft CMS / E-Biz server Group.
OFC 200 Microsoft Solution Accelerator for Intranets Scott Fynn Microsoft Consulting Services National Practices.
DAT336 Connected vs Disconnected Data Access in ADO.NET Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
Your Data Any Place, Any Time Online Transaction Processing.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
DAT304 Managing And Executing Stored Procedures For Performance William R. Vaughn Beta V Corporation.
DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
OFC290 Information Rights Management in Microsoft Office 2003 Lauren Antonoff Group Program Manager.
DEV339 Best Practices for Debugging Visual Studio.NET Applications Keith Pleas Architect, Guided Design
.NET Compact Framework Performance Strategies MBL 402 Ivo Salmre Product Manager.NET Developer Technologies, UK Microsoft Corporation.
Objectives In this lesson, you will learn to: *Identify the need for ADO.NET *Identify the features of ADO.NET *Identify the components of the ADO.NET.
DEV337 Modeling Distributed Enterprise Applications Using UML in Visual Studio.NET David Keogh Program Manager Visual Studio Enterprise Tools.
Module 7: Accessing Data by Using ADO.NET
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
DEV384 COM+ Lives : New Features in Enterprise Services Included in Windows Server 2003 Catherine Heller Senior Consultant Microsoft Spain.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Introduction to ADO.NET ADO.NET - Lesson 01  Training time: 10 minutes  Author:
Windows Forms in Visual Studio 2005 Mike Pelton Systems Engineer Microsoft Ltd
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
DEV333 Instrumenting Applications for Manageability with the Enterprise Instrumentation Framework David Keogh Program Manager Visual Studio Enterprise.
EBZ319 Building Enterprise Web Sites Using MCMS 2002 Daniel Kogan Program Manager CMS Group Microsoft Corporation Pat Miller Developer CMS Group Microsoft.
MBL206 A First Look at the Microsoft Location Server (MLS) Steve Lombardi Technical Product Manager MapPoint Business Unit Microsoft Corporation.
OFC291 Microsoft® Office Word XML (part 1 of 3): Introduction Martin Sawicki Lead Program Manager.
MBL401.Net Compact Framework: Data Access Best Practices Paul Foster Mobile solutions architect.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
DAT 332 SQL Server 2000 Data Transformation Services (DTS) Best Practices Euan Garden Product Unit Manager SQL Server Development Microsoft Corporation.
DEV383 The ADO.NET DataSet and You Jackie Goldstein General Manager Renaissance Computer Systems
EBIZ327 InfoPath and BizTalk Server 2004 Scott Woodgate Jupiter Product Planner.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
DAT300 SQL Server Notification Services: Application Development Ken Henderson Technical Lead, SQL Server Support Microsoft Corporation
MBL 305 ASP.NET Mobile Controls: Best Practices Gökşin Bakir CSA Yage Ltd. Microsoft Regional Director.
DEV395 No Touch Deployment for Windows Forms Jamie Cool Program Manager.NET Client Microsoft Corporation.
EBIZ302 Jupiter Business Process Automation and Web Services David Fong Program Manager.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
DEV394 Windows Forms Performance Tips And Tricks Mike Henderlight Development Manager.NET Client Team Microsoft Corporation
DEV332 Programming for the Middle Tier in Visual Basic.NET Billy Hollis Author / Consultant.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
DAT 405 Extreme SqlXml Irwin Dolobowsky Program Manager – SqlXml Microsoft Corporation.
EBZ306 Advanced Business Process Automation Using BizTalk Server 2004 David Fong Program Manager.
DAT200 Microsoft® ADO.NET for ADO Classic Developers: Introducing ADO.NET Jackie Goldstein Renaissance Computer Systems
Module 2: Using ADO.NET to Access Data. Overview ADO.NET Architecture Creating an Application That Uses ADO.NET to Access Data Changing Database Records.
EBIZ312 Connecting Host Systems to Microsoft Technologies Paul Larsen Aaron Grady Microsoft Corporation.
OFC320 Building EPM Solutions with Microsoft Project Server Ted Dinklocker Program Manager Microsoft Corp.
Data Access. ADO.NET ADO.NET is the primary library for building database solutions within the.NET Framework. ADO.NET does not replace ADO. ADO and OLEDB.
ADO .NET from. ADO .NET from “ADO .Net” Evolution/History of ADO.NET MICROSOFT .NET “ADO .Net” Evolution/History of ADO.NET History: Most applications.
DAT 390 Advanced ADO.NET Programming Techniques Jackie Goldstein Renaissance Computer Systems
9/24/2017 7:27 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Chris Menegay Sr. Consultant TECHSYS Business Solutions
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Chapter 10 ADO.
Presentation transcript:

DEV351 ADO.NET Performance Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation

Agenda What Impacts Data Access Performance? ADO.NET Performance Characteristics Why Connections are Expensive? Query Execution and Data Retrieval Disconnected Scenarios

What Impacts Performance? Round-trips Enlist DTC transaction Open connection Execute statement Result fetching (De)Serialization Provider processing Allocations/Boxing High Impact Low Impact Network I/O

ADO.NET Performance Connected stack Thin layer, minimum overhead Mixed managed/native providers have may have additional overhead in native code Network is usually the bottleneck Disconnected stack – DataSet Basically a data structure Compact in memory, but not on the wire Allocation-intensive during creation

Open() Takes Time Open a communications channel i.e. a socket or a pipe Warm-up time, i.e. TCP slow-start Initial handshake (negotiation, login, …) One or more round-trips (SqlClient does 2) To optimize Connection pooling is critical If pooling is not an option, minimize Opens Choose TCP over Pipes for remote servers

Integrated Security Extra steps for integrated security Obtain current thread user’s credentials Do challenge-response (NTLM) Connection pooling helps Pooled connections don’t need an extra authentication step Worth the overhead in most cases Much more secure than SQL authentication

Distributed Transactions There is an “enlist” step for connections Automatic if within a COM+ transaction May require several round-trips Can be avoided if not needed “enlist=false” in the connection string Conditional enlistment may help Only enlist if conditions require it Use conn.EnlistDistributedTransaction() New in ADO.NET 1.1

Conditional Distributed Transactions demo demo

Statement Execution Every execution is a round-trip Try to batch many statements in a single command Use NextResult() to fetch several result-sets Minimize the result-set size Perform all the filtering operations in the server Bring only the columns you need Specially in large result-sets

Batching Send several SQL statements in one round-trip Syntax is database-specific Always use parameters for user input Concatenation leads to SQL injection attacks Concatenating using “+” or “&” is slow StringBuilder makes a big difference

Statement Batching demo demo

DataSet Use them when you won’t use the data right away Never keep a DataReader for a long time Filling up a DataSet implies an overhead The DataAdapter uses a reader internally Minimize round-trips using mappings Loading from XML Avoid inferring the schema if you know it

DataSet Serialization Serialization Representation is not compact Use XML attributes instead of elements ColumnMapping=MappingType.Attribute Avoid verbose column names They are repeated many times in the XML doc Deserialization Parsing cost Allocation-intensive

Updating DataSets DataSets creates and maintains indexes For primary keys, data views, etc. Maintenance makes updates expensive Minimize updates, or… Minimize indexes i.e. primary keys are not always needed if data comes from a database

DataSet Optimizations demo demo

Summary Opening connections is very expensive Pooling is critical Round-trips must be minimized Batching helps to reduce them ADO.NET enables high-perf applications Connected stack: thin layer, minimum overhead DataSet: scalability of the disconnected model

Community Resources Most Valuable Professional (MVP) Newsgroups Converse online with Microsoft Newsgroups, including Worldwide User Groups Meet and learn with your peers

evaluations evaluations

© 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.