DAT336 Connected vs Disconnected Data Access in ADO.NET Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.

Slides:



Advertisements
Similar presentations
Eric Nelson Application Architect, Microsoft |
Advertisements

DEV351 ADO.NET Performance Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.
Dos and don’ts of Columnstore indexes The basis of xVelocity in-memory technology What’s it all about The compression methods (RLE / Dictionary encoding)
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Technical Architectures
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.
The Ins and Outs of Secure Data Access Jørgen Thyme Developer & Platform Strategy Group, Microsoft
Online Magazine Bryan Ng. Goal of the Project Product Dynamic Content Easy Administration Development Layered Architecture Object Oriented Adaptive to.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Microsoft Office SharePoint Server Business Intelligence Tom Rizzo Director, Microsoft Office SharePoint Server
Advanced Deployment Topics – MSI Enhancements Om Sharma Program Manager, Windows Installer Microsoft Corporation.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Object Oriented Databases by Adam Stevenson. Object Databases Became commercially popular in mid 1990’s Became commercially popular in mid 1990’s You.
 Pablo Castro Software Architect Microsoft Corporation TL08.
WEB329 ASP.NET: A Lap Around the New Enhancements for Web Developers in Microsoft Visual Studio 2005 Omar Khan Lead Program Manager Web Platform and Tools.
SQL Server Replication By Karthick P.K Technical Lead, Microsoft SQL Server.
LAYING OUT THE FOUNDATIONS. OUTLINE Analyze the project from a technical point of view Analyze and choose the architecture for your application Decide.
Training Workshop Windows Azure Platform. Presentation Outline (hidden slide): Technical Level: 200 Intended Audience: Developers Objectives (what do.
Native Support for Web Services  Native Web services access  Enables cross platform interoperability  Reduces middle-tier dependency (no IIS)  Simplifies.
What is Architecture  Architecture is a subjective thing, a shared understanding of a system’s design by the expert developers on a project  In the.
AJAX and Atlas in ASP.NET 2.0 William J. Steele MSDN Developer Evangelist Microsoft Corporation
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.
Project “Astoria” first announced in Mix 2007 Shared early prototypes, got tons of feedback Now we’re talking about the real deal Production quality bits,
1 Introduction to ADO.NET Microsoft ADO.NET 2.0 Step by Step Rebecca M Riordan Microsoft Press, 2006.
Ronnie Saurenmann Principal Architect Microsoft Switzerland.
Boost data-driven application development using SQL Server Centric.NET Code Generator David Rodriguez SQL Server Technology Specialist Microsoft Corporation.
Sudarshan Yadav Sr. Program Manager, Microsoft
© 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
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Why data services? Common challenges when creating rich web applications Creating rich web applications with data services Future scenarios & roadmap.
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
Distributed Information Systems. Motivation ● To understand the problems that Web services try to solve it is helpful to understand how distributed information.
“ WinFS” Future Directions: Building Data-Centric Applications Using Windows Presentation Foundation “Avalon” and Windows Forms Ramesh Nagarajan DAT310.
DAT 332 SQL Server 2000 Data Transformation Services (DTS) Best Practices Euan Garden Product Unit Manager SQL Server Development Microsoft Corporation.
Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.
DEV395 No Touch Deployment for Windows Forms Jamie Cool Program Manager.NET Client Microsoft Corporation.
DAT 405 Extreme SqlXml Irwin Dolobowsky Program Manager – SqlXml Microsoft Corporation.
Step-by-Step Migration and Adoption Mark Michaelis Architect, Author, and Trainer Eric Lee Microsoft Product Manager Visual Studio 2005 Team Foundation.
Aniruddha Deswandikar & Govind Kanshi Microsoft Technology Center, Bangalore SESSION CODE: ##### Building performant Web applications.
DEV414 Black-belt ASP.NET Tips And Tricks For Your ASP.NET Applications Rob Howard Program Manager Web Platform and Tools Team.
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.
DAT 378 SQL Server 2000 Bringing The Best of Reporting Services and Analysis Services Together Sean Boon Program Manager, BI Systems
Technology Drill Down: Windows Azure Platform Eric Nelson | ISV Application Architect | Microsoft UK |
2 Behind every great site, there is great data Eric Nelson Developer Evangelist Microsoft UK
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.
Developing Custom ASP.NET Providers For Membership And Role Manager Stefan Schackow PRS404 Program Manager – Web Platform and Tools Microsoft Corporation.
DAT 390 Advanced ADO.NET Programming Techniques Jackie Goldstein Renaissance Computer Systems
DAT303 - Entity Framework: Application Patterns Pablo Castro Technical Lead, Microsoft Corporation.
Integrating SharePoint 2010 with Office 2010
Integrating Enterprise Applications Into SharePoint® Portal Server
MIX 09 6/5/2018 9:14 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Beyond the BDC\BCS Model
Chris Menegay Sr. Consultant TECHSYS Business Solutions
Avalon – Using Data In Your Applications
Tech·Ed North America /31/2018 4:35 PM
Optimizing Microsoft SQL Server 2008 Applications Using Table Valued Parameters, XML, and MERGE
ADO.NEXT Advances in Data Access for 2008
Developer Patterns to Integrate Silverlight 4.0 with SharePoint 2010
Accessing Data in a .NET Web Application
Lecture 1: Multi-tier Architecture Overview
LitwareHR v2: an S+S reference application
Visual Studio 2005 Tools For Office: Creating A Multi-tier Application
Pablo Castro Software Architect Microsoft Corporation
Chapter 10 ADO.
Mark Quirk Head of Technology Developer & Platform Group
9/8/ :03 PM © 2006 Microsoft Corporation. All rights reserved.
Presentation transcript:

DAT336 Connected vs Disconnected Data Access in ADO.NET Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation

Agenda Disconnected is good Some connected bits can help Balancing connected/disconnected Scrolling and streaming Custom aggregation Incremental load Summary

Disconnected? In the context of this talk: “Disconnected” apps are online applications that don’t keep database connections open for long periods of time such as the lifetime of a session Usually 3-tier applications We’re not going to discuss “off-line” applications where a user can operate an application even if the server is not available

Disconnected is Good Simpler to design 3-tier applications follow the disconnected model naturally Simpler to code once the pieces are set i.e. data binding, marshalling in 3-tier apps, no connection management for long-lived business objects Simpler to make apps scale Middle-tier layer easy to scale-out It’s harder to scale-up/out database servers

Disconnected ADO.NET ADO.NET has first-class disconnected apps support DataSet as a relational data cache Plays well with remoting & web services Single implementation, no database-specific behavior DataAdapter/DataSet provide services for getting, updating and merging data Custom types for non-relational

…but too disconnected… Handling large volumes of data Batch processing Reporting Custom aggregation Performance-sensitive code-paths ASP.NET pages in apps without heavy business logic Gateway applications Avoid buffering large portions of data Avoid data-shipping costs

Discrete Objects Scenarios This is the “easy part” Stand-alone business objects Business object state representation DataSets – ADO.NET helps with retrieval, update and change tracking Custom objects – model your business entity state using regular classes Remoting or webservices enable this scenario easily

Sessions in the Middle Tier Scenarios Per-session state can’t be avoided sometimes If needed, keep only in-memory state No database connections if at all possible Quite common in ASP/ASP.NET apps “Sticky sessions” take care of scale-out So it’s not that bad if you don’t keep connections or other external resources

Scrolling and Streaming Scenarios In general, handling large results in pieces UI: scrolling, paging Batch processing: chunking, scanning large results Custom aggregation Options change depending on each case

Scrolling, Paging Goal is to fetch rows from a large result, a few at a time Cursors DataAdapter.Fill method SQL-based solutions

Scrolling, Paging: Cursors Not available in all databases Provide scrolling support Sometimes even bi-directional No need for extra logic in the application Scalability issues Require to maintain state Database connections, keyset or temporary tables in the database Cursor escalation Server may need to materialize some/all data

Scrolling, Paging: Cursors Design issues Hard to include in 3-tier applications Need to keep connection/cursor objects alive in middle tier How is data propagated to the presentation layer? Tends to be a chatty interface Result stability Need to use transactions or static cursors if stability is required

Scrolling, Paging: Fill() ADO.NET DataAdapter.Fill() method There’s an overload that takes first row and number of rows Under the covers, this method: Skips rows as needed Copies as many rows as requested to the target DataTable Scans and discards the rest of the rows  Don’t use it for paging in large result-sets

Scrolling, Paging: SQL If at all possible, use SQL constructs for paging Stored-procedures if you know the table schema and sort order SQL can help in other cases where the query is not known but constrained Scalability/performance issues Time taken to execute query is not amortized across requests

Scrolling, Paging: SQL Design issues Fits nicely for 3-tier apps Each page is an independent database operation No state held between hits Ad-hoc queries are hard to handle Result stability Need to use transactions if stability is required

Streaming Goal is to handle very large result-sets No buffering proportional to size of data Concurrency issues Interleaving Common scenarios for streaming Batch processing Reporting Custom aggregation

Streaming: DataReaders ADO.NET providers have an streaming interface DataReader class exposes a row at a time Some minor buffering might happen internally Can scan millions of rows without taking much resources Scalability issues Usually large scans happen in batch processes Not many at the same time

Streaming: DataReaders Design issues DataReaders cannot be marshaled across tiers Move the batch process code to the middle tier Send the data in chunks to the next tier (too much overhead in most cases) Contention can be high Result stability Depends on the isolation level

Custom Aggregate Logic Similar case: scan lots of rows But end-result is a small result-set No need to ship the data out of the server Cursors can help here Scan and aggregate inside the server Ship only the aggregated information to the client Avoids moving lots of data across tiers

Incremental Load Scenarios Present first bit of data in UI quick Incrementally load the rest in the background DataSet merge support is great here Be aware of multi-threading issues

Incremental Load & Merge ADO.NET DataSet can merge results Incremental load UI Chunking API in the middle tier Bring down the first DataSet and display it As more data comes, merge the DataSets and update UI This even preserves changes in existing data Multi-threading issues DataSet is not thread-safe Same for WinForms UI controls

Summary Disconnected is good ADO.NET has great support for it Good to start disconnected by default You will need some connected pieces ADO.NET also helps there You can add connected parts as needed Extremes can hurt your app performance or scalability

Attend a free chat or web cast List of newsgroups communities/newsgroups/en-us/default.aspx MS Community Sites Locate Local User Groups Community sites

© 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.