Presentation is loading. Please wait.

Presentation is loading. Please wait.

Stephen Forte DAT401 from s in dat.Speaker select s.Bio; Chief Strategy Officer of Telerik Certified Scrum Master Active in the community: International.

Similar presentations


Presentation on theme: "Stephen Forte DAT401 from s in dat.Speaker select s.Bio; Chief Strategy Officer of Telerik Certified Scrum Master Active in the community: International."— Presentation transcript:

1

2 Stephen Forte DAT401

3 from s in dat.Speaker select s.Bio; Chief Strategy Officer of Telerik Certified Scrum Master Active in the community: International Conference Speaker for 12+ years RD, MVP and INETA Speaker Co-moderator & founder of NYC.NET Developers Group http://www.nycdotnetdev.comhttp://www.nycdotnetdev.com Author of SQL Server 2008 Developers Guide (MS Press) MBA from the City University of New York Past: CTO and co-founder of Corzen, Inc. (TXV: WAN) CTO of Zagat Survey

4 Agenda ADO.NET: Passing a.NET Custom Collection to a Stored Procedure LINQ: Understanding the difference between IEnumerable and IQueryable by eavesdropping on the server Entity Framework: Model Complex Relationships with Views Silverlight: Binding REST data to Silverlight Database Architecture: Pre-calculate and Transform Data for Faster Performance

5 Agenda ADO.NET: Passing a.NET Custom Collection to a Stored Procedure LINQ: Understanding the difference between IEnumerable and IQueryable by eavesdropping on the server Entity Framework: Model Complex Relationships with Views Astoria: Binding REST data to Silverlight Database Architecture: Pre-calculate and Transform Data for Faster Performance

6 Hack #1: Pass.NET Collection to SPs SQL Server 2008 allows Table Valued Variables to be passed into a stored procedure (TVP) ADO.NET 3.51 allows a DataSet to be passed into a SP via a TVP Your custom.NET collection is a graph of the data you want to insert/change Must implement IEnumerable Create a C# 3.0 Extension method that takes any IEnumerable collection and converts to a DataSet Call your stored procedure with yourcollection.ToDataSet()

7 Using TVPs and.NET 3.5 Extension Methods

8 Agenda ADO.NET: Passing a.NET Custom Collection to a Stored Procedure LINQ: Understanding the difference between IEnumerable and IQueryable by eavesdropping on the server Entity Framework: Model Complex Relationships with Views Astoria: Binding REST data to Silverlight Database Architecture: Pre-calculate and Transform Data for Faster Performance

9 Hack #2: Spying on Your Server Use implicitly typed local variables IEnumerable will execute locally (Linq to Objects, XML) IQueryable will convert your LINQ to TSQL and execute remotely When executing remotely, LINQ queries will generate TSQL on your server You can spy on this SQL via code or even better, watch the whole conversation via SQL Server Profiler Learning a very small amount about TSQL, Indices, and Execution Plans will make you a far better LINQ programmer

10 LINQ to SQL, LINQ to EF, LINQ to ORM + SQL Server Profiler

11 Agenda ADO.NET: Passing a.NET Custom Collection to a Stored Procedure LINQ: Understanding the difference between IEnumerable and IQueryable by eavesdropping on the server Entity Framework: Model Complex Relationships with Views Astoria: Binding REST data to Silverlight Database Architecture: Pre-calculate and Transform Data for Faster Performance

12 Hack #3: Deconstruct Complex Databases Before You Map Them Some DBAs go overboard and super normalize the database Hard to represent a relationship via too many joins ORMs/EF are supposed to do this for us; however, it creates difficult models to work with Many models are just 1:1 representations of the database Create a series of views that deconstruct your complex data and optimize those views with an index Updates? Use stored procedures or you can still model the tables and only use them for updates

13 Creating Views Out of Complex Data Relationships for EF

14 Agenda ADO.NET: Passing a.NET Custom Collection to a Stored Procedure LINQ: Understanding the difference between IEnumerable and IQueryable by eavesdropping on the server Entity Framework: Model Complex Relationships with Views Astoria: Binding REST data to Silverlight Database Architecture: Pre-calculate and Transform Data for Faster Performance

15 Hack #4: Silverlight Databinding to RESTful Data Services Use LINQ to ADO.NET Data Services on the SL client Leverage your investment in LINQ; however, you have to be 100% asynchronous Hack: Encapsulate all the asynchronous LINQ calls into its own helper library using Generics Beware of cross-domain issues Clientaccesspolicy.xml WCF Web Service, then expose as RESTful data

16 Asynchronous ADO.NET Data Services Data Binding via LINQ to Astoria in Silverlight

17 Agenda ADO.NET: Passing a.NET Custom Collection to a Stored Procedure LINQ: Understanding the difference between IEnumerable and IQueryable by eavesdropping on the server Entity Framework: Model Complex Relationships with Views Astoria: Binding REST data to Silverlight Database Architecture: Pre-calculate and Transform Data for Faster Performance

18 Hack #5: “Reporting DB” Design Pattern Optimize for a high read environment with multiple views of the data and multiple data access strategies What data to move? Anything that can be derived from an OLTP database for high read Reporting data Web view (Amazon catalog, not orders) Traditionally “flatter” Some de-normalized aspects Prevents query against normalized “raw” data Must accept latency Good implementation of XML Highly indexed since the data is “published”

19 Building the Database for Database Reads

20 stevef@orcsweb.com http://stephenforte.net

21 www.microsoft.com/teched Sessions On-Demand & Community http://microsoft.com/technet Resources for IT Professionals http://microsoft.com/msdn Resources for Developers www.microsoft.com/learning Microsoft Certification and Training Resources www.microsoft.com/learning Microsoft Certification & Training Resources Resources

22 Complete an evaluation on CommNet and enter to win! Required Slide

23 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Required Slide


Download ppt "Stephen Forte DAT401 from s in dat.Speaker select s.Bio; Chief Strategy Officer of Telerik Certified Scrum Master Active in the community: International."

Similar presentations


Ads by Google