DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent...

36
Developing Compelling Applications with Java and PHP for Microsoft SQL Server and SQL Azure Amina Saify Lead Program Manager Microsoft Corporation DBI305

Transcript of DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent...

Page 1: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Developing Compelling Applications with Java and PHP for Microsoft SQL Server and SQL Azure

Amina SaifyLead Program ManagerMicrosoft Corporation

DBI305

Page 2: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Session Objectives and Takeaways

Session Objectives: Learn about what’s new for Java and PHP developers in DenaliLearn about developing a Java and/or PHP application locally and deploying it in the cloudA deep-dive into the Windows Azure Platform is beyond the scope of this presentation

Page 3: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Agenda

IntroductionWhat’s new in Denali

PHPJDBC

Develop locally, deploy in the cloudDemoTools for Developers

Page 4: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Introduction

Amina Saify - Lead Program ManagerMember of SQL Connectivity

Connect application developers to SQL Server & SQL Azure

Responsible for connecting Java and PHP developers to SQL server & SQL azure.Contact: [email protected]: @amisaify

4

Page 5: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Customers using Java

Major adopters:BT Financial GroupScottradeBNY MellonIBMKronosSAP

Page 6: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Major Applications on PHP

Major application support:phpBBSilverStripeSugarCRMDrupalDoctrineMoodlePropel

Page 7: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

What's New in Denali?

Page 8: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

"Denali" PHP Release Pillars

• Buffered Queries with client-side resultsets & cursors• Paging results (LIMIT-equivalent clause)

Optimize Data Access for PHP Workloads

• Enable new High Availability scenarios (AlwaysOn Connectivity)

Enterprise-class Connectivity & Performance

• Enhance developer productivity with SQL Express Local Database

Improve Developer Productivity

Page 9: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Optimize Data Access for PHP Workloads: Buffered Queries with client-side resultsets & cursors

Overview

• Fetch resultset into client• Scrollable client-side cursor• Optional

Benefits

• Common programming model for PHP applications• Reliable access to RowCount and faster scrollable cursor• Consumes results immediately and frees up server resources

Page 10: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Optimize Data Access for PHP Workloads: Paging results (LIMIT-equivalent clause)

Overview• Constrain resultsets into “pages” required by web applications• ANSI-syntax: OFFSET X ROWS FETCH FIRST Y ROWS ONLY• Supported by SQL Server ’Denali’• Equivalent to LIMIT/OFFSET from competing databases

Benefits• Standard programming model for PHP web applications (e.g. show top

10 news items)• Reduced memory footprint• Simpler syntax than previous SQL Server approaches

Page 11: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Enterprise Connectivity: AlwaysOn

Overview

• Added support for virtual network name as the server name

• Multi-subnet failover• Read-only Intent

Benefits

• Allow applications to specify VNN as server name

• Disaster recovery• Read-only workload such as

reporting can be offloaded to secondaries

A

A

AA

Page 12: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Improve Developer Productivity:Serverless Express Local Database

Overview• Develop on machine with file-based database (no server)• Feature takes care of creating SQL instance on behalf of app

Benefits• No need to configure server• Enabled through connection string• Can deploy app and data together via file copy• Serverless Express can also be used as production database for small deployments

Page 13: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

"Denali" JDBC Release Pillars

• Enable pure Java Kerberos integrated authentication • Provide single sign-on

Increase Breadth of Authentication Options

• Provide high available connectivity to top tier applications (AlwaysOn Connectivity)• Increase scalability by enabling read scale-out

Enterprise-class Connectivity for SQL Server Developers

• Provide common connectivity components across SQL and SQL Azure

Improved Connectivity to SQL Azure

Page 14: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Increase Breadth of Authentication Option

Overview

• Current Kerberos Integrated authentication (type-2) is available on Windows client only• New Kerberos Integrated authentication (type-4 pure Java implementation) provides multiplatform

support

Benefits

• Enhanced security and provision for auditing • It does NOT fall back on NTLM

• Two-tier Kerberos support• Three tier Kerberos support• Support Cross-realm

• Primary focus – Windows KDC (active directory)• The driver will not take Kerberos user id and password in the connection string,

• Application has to do the KDC authentication• Customers can customize the Login module by specifying a configuration file – TGT Cache, keytab, etc.

Page 15: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Kerberos Authentication

15

2. A

uthe

ntic

atio

n

Req

uest

Kerberos Service (KDC1) [Windows]

Service Provider (SQL Server)3.

Enc

rypt

ed T

GT

6. Provide ticket to use the service

7. Provide service to the user4.

TG

T

5. S

ervi

ce T

icke

t

App Server

• TGT – Ticket Granting Ticket

• JVM 1.5 and 1.6

1. Credential

Client

8. Results

Windows/*NixWindows/*Nix

Kerberos Service (KDC2) [Windows/*nix]

Windows

SQL Server registered to Windows KDC

Page 16: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Enterprise-class Connectivity: AlwaysOn

Overview

• Added support for virtual network name as the server name

• Multi-subnet failover• Read-only Intent

Benefits

• Allow applications to specify VNN as server name

• Disaster recovery• Read-only workload such as reporting

can be offloaded to secondaries

Connection Strings: Primary (1 subnet): serverName=AG1_VNN; databaseName=Db1; Primary (2+ subnet): serverName=AG1_VNN; databaseName=Db1; multiSubnetFailover=TrueSecondary: serverName=N2; databaseName=Db1; applicationIntent=ReadOnlyNew DataSource APIssetMultiSubnetFailover(boolean);setApplicationIntent(String);

A

A

AA

Page 17: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Develop Locally, Deploy in the Cloud

Page 18: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

What’s in the Cloud?

Ru

nti

mes

&S

ervi

ces

Win

do

ws

Azu

re

SD

Ks

Developer ExperienceUse existing skills and tools.

Windows Azure Tools for

Windows Azure Command-Line Tools for

Windows Azure Companion

Page 19: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Windows Azure - Roles

Web roleInteracts with the outside world via HTTP

Worker roleInteracts with the outside world in various waysMay receive input from web role and work on user requests

Virtual machine roleRuns an image of Windows Server 2008 R2

Page 20: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

demo

Develop Locally, Deploy to the Cloud

Amina SaifyLead Program ManagerSQL Server

Page 21: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

ClientWeb Browser

Web ServerWindows/Tomcat/Java SQL Server

Developing Locally, Deploying to the Cloud

1. SQL Azure Migration

Wizard

2. Change DB

connection string

3. Eclipseor

Windows Azure

Command Line Tools for JDBC

4. Windows Azure Compute Emulator

Page 22: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Developing Locally, Deploying to the Cloud

Download Apache TomcatDownload Eclipse EE editionDownload JDBC driver

Install JDBC driverSet the CLASSPATH CLASSPATH=C:\sqljdbc_3.0\enu\sqljdbc4.jar

Download Windows Azure SDKDownload SQL Azure Migration WizardDownload JRE6

JRE_HOME=C:\Program Files\Java\jre6\bin

Download SQL Server 2008 R2 (Express or higher)Download AdventureWorks database from MSDN

Page 23: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Data in the Cloud

SQL Azure Migration Wizard (SAMW)Moves a database schema and data to and from SQL Server and SQL Azure An open source project hosted on codeplex:

http://sqlazuremw.codeplex.com/

Requirements:SQL Server 2008 R2 bits to runBCP version 10.50.1600.1 or greater

SQL Server Management Studio (SSMS)Provides the same experience as managing on-premise SQL server instanceConnect to SQL Azure instance via SQL Authentication

Page 24: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Windows Azure Plugin for Eclipse

With Java:Eclipse wizards to create and build new Windows Azure projects in EclipseShortcuts to deploy and start the project in the Windows Azure Compute Emulator Association of *.cscfg and *.csdef files with the Eclipse XML editor for easier XML editing

With PHP:A series of wizards and utilities allowing to write, debug, configure, and deploy PHP applications to Windows Azure Bundles the existing Windows Azure SDK for PHP into the Eclipse PHP project Includes a Window Azure storage explorer that allows developers to browse data contained into the Windows Azure tables, blobs, or queues

Page 25: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Windows Azure SDK for Java and PHP

Overview Enables Java and PHP developers to leverage the Microsoft Cloud Services Platform - Windows AzureProvides consistent programming model for Windows Azure Storage (Blobs, Tables & Queues)PHP SDK

Developed by Microsoft Partner RealDolmenOpen source project available at Available at http://phpazure.codeplex.com/

Java SDKDeveloped by Microsoft Partner SoyatecProject site: http://www.windowsazure4j.org/

Features Java and PHP classes for Windows Azure Blobs, Tables & Queues (for CRUD operations)Helper Classes for HTTP transport, Authorization, REST & Error ManagementManageability, Instrumentation & Logging supportSupport for storing Java sessions in Azure Table Storage

Page 26: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Windows Azure Tools

Windows Azure Starter Kit for Javaa simple command line build tool to help Java developers deploy their applications to the Windows Azure cloudhttp://wastarterkit4java.codeplex.com/

A simple command line tool for packaging and deploying PHP applications to Windows Azure

Package all project assets: PHP Engine, Application source, PHP ExtensionsAvailable at http://azurephptools.codeplex.com or through the Web PI

Windows Azure CompanionProvides a seamless experience installing and configuring PHP platform-elements (PHP runtime, extensions) and community PHP applications on Windows Azure.Used for testing application compatibility and is *not* intended for production deploymenthttp://code.msdn.microsoft.com/azurecompanionhttp://www.interoperabilitybridges.com/projects/windows-azure-companion

Page 27: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

SSRS SDK for PHP

The SQL Server Reporting Services SDK for PHP enables developers to leverage the SSRS business intelligence and reporting features in applications by…

Querying for the list of reports on the server Querying for the list of parameters required for each report, including list of valid values Querying the list of formats supported by the server Executing and rendering reports

PHP ScriptSSRS SDK

for PHP

Web Server

SOAP APIReport ServerWeb

Service

Page 28: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Summary

Compelling Denali features for Java and PHP developersCommunity Technology Preview (CTP) with next Denali CTP timeframe

Leverage Cloud infrastructure today!Wide range of tools available for Java and PHP developers

Page 29: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Related Content

Breakout Sessions:DBI302 | Microsoft SQL Server Code-Named "Denali" AlwaysOn Series, Part 1: Introducing the Next Generation High Availability Solution DBI404 | Microsoft SQL Server Code-Named "Denali" AlwaysOn Series, Part 2: Building a Mission-Critical High Availability Solution Using AlwaysOn COS202 | Introducing the Windows Azure Platform

Interactive Sessions:DBI374-INT | Developing Microsoft SQL Server Code-Named "Denali" Applications with C/C++ and ODBC DBI375-INT | Microsoft SQL Azure: Performance and Connectivity Tuning and Troubleshooting

Page 31: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Database Platform (DAT) Resources

Try the new SQL Server Mission Critical BareMetal Hand’s on-Labs

Visit the updated website for SQL Server® Code Name “Denali” on www.microsoft.com/sqlserver and sign to be notified when the next CTP is availableFollow the @SQLServer Twitter account to watch for updates

Visit the SQL Server Product Demo Stations in the DBI Track section of the Expo/TLC Hall. Bring your questions, ideas and conversations!

• Microsoft® SQL Server® Security & Management • Microsoft® SQL Server® Optimization and Scalability• Microsoft® SQL Server® Programmability • Microsoft® SQL Server® Data Warehousing• Microsoft® SQL Server® Mission Critical • Microsoft® SQL Server® Data Integration

Page 32: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Resources

www.microsoft.com/teched

Sessions On-Demand & Community Microsoft Certification & Training Resources

Resources for IT Professionals Resources for Developers

www.microsoft.com/learning

http://microsoft.com/technet http://microsoft.com/msdn

Learning

http://northamerica.msteched.com

Connect. Share. Discuss.

Page 33: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Complete an evaluation on CommNet and enter to win!

Page 34: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

Scan the Tag to evaluate this session now on myTech•Ed Mobile

Page 35: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.

© 2011 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.

Page 36: DBI305. 4 Buffered Queries with client-side resultsets & cursors Paging results (LIMIT-equivalent clause) Optimize Data Access for PHP Workloads.