Sql azure data services OData

Uploaded on

In this presentation we explore SQL Azure and OData. …

In this presentation we explore SQL Azure and OData.

Best Regards,

Eduardo Castro

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Ing. Eduardo Castro Martínezecastro@grupoasesor.nethttp://tinyurl.com/comunidadwindows
  • 2. ARC306. Open Data For The Enterprise.Jonathan CarterDEV323. Best Practices: Creating ODataServices using WCF Data Servic. AlexJamesDEV325. Best Practices for BuildingCustom Open Data Protocol (OData)Services with Windows Azure. Alex James
  • 3. Microsoft SQL AzureInformation Platform as a Service Managed Service Scale on Demand Innovate Faster Platform capabilities delivered as a service (Database, Data Database as a utility with Innovate with new data Sync, Reporting…) pay as you grow scaling application patterns Reduced complexity, greater Rely on Business-ready Build cloud-based data flexibility SLAs solutions on a familiar relational model Easy provisioning and Enable multi-tenant deployment solutions Build on existing developer skills and familiar Transact- Auto High availability and Manage multiple servers SQL syntax fault tolerant
  • 4. Subscription Used to map service usage to the billing instrument Users may have many subscriptionsLogical Server Akin to SQL Server Instance Unit of Geo-Location & Billing 1:1 Subscription & serverUser Database Restricted T-SQL surface area Additional catalog views provided e.g. sys.billing, sys.firewall_rules, etc
  • 5. A relational DB in the cloud SQL Azure Database Data Hub Others (Future) .NET Services SQL Services Applications Relational database as a service Live Services Windows Azure Highly available, automatically maintained Extension of the SQL Server Data Platform Applications Windows Windows Windows Others Server Vista/XP Mobile
  • 6. Single Logical Multiple Physical Database Replicas Repli ca 1 Repli D ca 2 B Repli ca 3
  • 7. Reference Data Sync Data Symmetric Programming Model Data Hub Aggregation• Initial services – core RDBMS capabilities with SQL Azure Database, Data Sync• Future Offerings • Additional data platform capabilities: Reporting, BI • New services: Reference Data
  • 8. Clear Feedback: “I want a database in the Cloud”Familiar SQL Server relational modelUses existing APIs & toolsBuilt for the Cloud with availability and scaleAccessible to all from PHP, Ruby, and JavaFocus on combining the best features of SQL Server running at scale with low friction
  • 9. Application Application Application Browser Browser ODBC, OLEDB, Application Application REST Client REST Client SQL Client* ADO.Net PHP, Ruby, … Cloud Cloud Evolves HTTP+REST HTTP+REST HTTP HTTP TDS Windows Azure Windows AzureData Center Data Center Web App REST (Astoria) Web App REST Client ADO.Net + EF SQL Client* REST/SOAP + ACE Model TDS + TSQL Model SDS Current SDS Next * Client access enabled using TDS for ODBC, ADO.Net, OLEDB, PHP-SQL, Ruby, …
  • 10. SQL Azure Database Others (Future) SQL AzureApplications Windows Azure AppFabricWindows Azure Applications Windows Others
  • 11. SQL Azure Database Database TDSApplication Database DatabaseSQL Azure Database Others (Future)
  • 12. SQL Azure Database DatabaseApplication Max database Database size is 50 GB DatabaseApplication Database
  • 13. Applications use standard SQL client libraries: ODBC, ADO.Net, PHP, … Application Internet Azure Cloud TDS (tcp) Security Boundary Load balancer forwards „sticky‟ sessions to TDS LB protocol tier TDS (tcp) Gateway Gateway Gateway Gateway Gateway Gateway Gateway: TDS protocol gateway, enforces AUTHN/AUTHZ policy; proxy to CloudDB TDS (tcp)L SQL SQL SQL SQL Scalability and Availability: Fabric, Failover, Replication, and Load balancing
  • 14. Subscription Coordinated across all Azure services Executed in parallel w/retriesServer May occur between data centers Point where Geo-location is establishedDatabase Always occurs within a single data center Cross node operations executed during this process e.g. add new db to sys.databases on the master
  • 15. Live DNS Cluster Customer Live DNS Browser Svc 1 Datacenter (Sub-Region) 5 Portal LB Gateway LB 2 4 3 6Front-end Node Front-end Node Front-end Node Front-end NodeAdmin Portal Admin Portal Gateway Gateway 7 Backend Node Backend Node Backend NodeSQL Server SQL Server SQL Server Mgmt. Mgmt. Mgmt. Services Fabric Services Fabric Services Fabric
  • 16. 1 TDS Gateway Front-end Node TDS Session Protocol Parser 2 3 Gateway Logic Master Cluster Master Node 4 Master Node Components 7 5 8 6Backend Node 1 Backend Node 2 Backend Node 3 SQL Instance SQL Instance SQL Instance SQL DB SQL DB SQL DB Scalability and and Availability: Fabric,Failover,Replication, and Load balancing Scalability Availability: Fabric, Failover, Replication, and Load balancing
  • 17. AccountServerDatabase
  • 18. Build a custom OData Service?Configure and Deploy your OData Service?Reach your audience?Share only what you want?Plan for the future?
  • 19. OData is the easiest way to share dataDo it wrong and it will cost youMobile and JavaScript clients are importantSharing too much can hurt your careerThings change.
  • 20. “Open Data”
  • 21. The “Open DataProtocol”
  • 22. 1. Based on HTTP & ATOM2. Open Specification Promise HTTP/ATOM + QUERY + JSON + METADATA
  • 23.  HTTP Reach (devices and platforms) Metadata Formats (ATOM & JSON) Semantics(GET/PUT/POST/ DELETE) Uri Conventions & Query Language
  • 24. HTTPSuitable for devicesSimplePowerfulEco-system Platforms: Javascript, PHP, Java, .NET, Silverlight, Ruby, i OS etc Producers: SharePoint, DataMarket, CRM, StackOverflow, Netflix etc.
  • 25. For development you need: Windows Azure SDK and Windows Azure Tools for VS Azure account with at least: One Storage Account One Hosted Service Registered Certificate SQL Azure Database
  • 26. Options Use SSIS Script Database and run script in new database Code in your app to initialize database(Coming Soon)http://www.sqlazurelabs.com/ImportExport.aspx (EXPORT) DacImportExportCli.exe -s serverName -d databaseName -f C:filePathexportFileName.bacpac -x -e (IMPORT) DacImportExportCli.exe -s serverName.database.windows.net -d databaseName -f C:filePathexportFileName.bacpac -i
  • 27. .getJSON(..) <script> {“x”:1} callback({“x”:1})
  • 28. Authentication & Authorization Authenticates and sets: HttpContext.Current.User
  • 29. AuthN Windows Auth – simple for in the enterprise services Basic Auth – maximum reach Forms Auth – purely for integration OAuth – most flexible – but needs custom code OAuth HttpModule Custom client code to acquire credentials
  • 30. authentica tes Gives consent someone@facebook.com someone@facebook .comAuthenticates and sets: HttpContext.Current.User
  • 31. Try to Authenticate someone@mycorp.c om someone@mycorp.comAuthenticates and sets: HttpContext.Current.User
  • 32. need to access x@y.com‟s data token: x@y.com token: x@y.com canread canreadAuthenticates and sets: HttpContext.Current.User
  • 33. WithDataServiceContext.IgnoreMissingProperties: You can safely Add a new optional property Remove a property – Read Only Add unrelated new types But lots of things can go wrong. Add a required property or navigation Remove a property – Read/Write Rename a property (fail). Remove a type / feedRealistic Solution V1/service.svc/ V2/service.svc/
  • 34. You just learned how to: The easiest way to build a web-api The easiest way to host a web-api How to do it the right way: Configuration Security & Reach VersioningYou know how to create a REAL service…
  • 35. Windows Azure SDK and Windows Azure Tools forMicrosoft Visual Studio http://bit.ly/mMcoc3JSONP component (with recent bug fix)http://bit.ly/mbk04cUsing ASP.NET Output Caching with WCF Data Serviceshttp://bit.ly/gXmbdEAuthentication posts on the OData team bloghttp://bit.ly/gXmbdEThe New Hands-on Lab on ACS + WP7 + OAuth2.0OData Service http://bit.ly/h8gcJV
  • 36. http://www.odata.orghttp://msdn.microsoft.com/odata http://odata.codeplex.comhttp://odata.msteched.com/tena2011/sessions.svc
  • 37. http://www.microsoft.com/visualstudiohttp://www.microsoft.com/visualstudio/en-us/lightswitchhttp://www.microsoft.com/expression/http://blogs.msdn.com/b/somasegar/http://blogs.msdn.com/b/bharry/http://www.microsoft.com/sqlserver/en/us/default.aspxhttp://www.facebook.com/visualstudio
  • 38. http://northamerica.msteched.comwww.microsoft.com/teched www.microsoft.com/learninghttp://microsoft.com/technet http://microsoft.com/msdn