Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

The Azure Weekly runs every Tuesday from 12:30 – 14:00 (UK timezone) and is aimed at the techie who has not yet had any/much exposure to Azure but who just wants a leg-up to get started. This is a more practically focused session than a theoretical/architectural session and is mostly based around the following demos: • Creating a Microsoft Azure WordPress website • Creating a Microsoft Azure ASP.Net website • Creating a Microsoft Azure Virtual Machine • Creating a Microsoft Azure Mobile Services (with Android client) • Creating a Microsoft Azure Cloud Service • How to sign up for a free Microsoft Azure Trial subscription. Azure is an opportunity because it gives to programmers many opportunities different from "just" scaffolding an SQL relational database. In our guest presentation we will show you how to make a MVC Web App that born with an SQL Backend, can be enhanced with Azure.

  • Login to see the comments

  • Be the first to like this

Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

  1. 1. Data Opportunities with Azure Marco Parenzan Azure Weekly – January 20th, 2015
  2. 2. Marco Parenzan Training and Speaking with 1nn0va Microsoft MVP 2014 for Microsoft Azure Training and planning with ITS Kennedy marco [dot] parenzan [at] libero [dot] it Developer and Architect in .NET and Web Cloud Developer Loves functional programming Some videogames for fun
  3. 3. Data Legacy WITHOUT Azure  It’s common having just ONE data store in our toolbox  Typically it’s a relational database (either Microsoft SQL server or other SQL vendors)  Traditional hosting providers had just few combinations of data and hosting capabilities  Is Azure just another data (and hosting) opportunity?
  4. 4. Data WITH Azure  Azure give you many opportunities handling you data  Not just relational  Not just small  Not just monolithic  Not just table  Not just fields  ….
  5. 5. One Scenario  You have an ASP.NET MVC application  But ASP.NET WebForms, PHP, Java is the same  You have a relational DB in SQL Server  But having a MySQL, Postgre, “Oracle”, is the same
  6. 6. Opportunity Enhance you SQL-BASED ASP.NET experience with AZURE
  7. 7. Is Azure just a new hosting opportunity? Yes, it’s an operational opportunity. You can solve your issues about  Deployment  Security  Maintenance  (some) Scalability
  8. 8. Is Azure just a new hosting opportunity? No, it’s also an architectural opportunity, but only if you write some code  Cache your data  Search your data  Query your data
  9. 9. Agenda  Operational opportunities in Azure  Developer opportunities in Azure
  10. 10. Handle relational data with IaaS: Pro  Free to choose your OS  Full power of a Relational DB  Simple Scaling Up  “partial” licencing  Pay Per Use (no CAPEX)  Full power control  Ready images (no installation)  With specific configurations  Just Click, Name, choose, deploy
  11. 11. Handle relational data with IaaS: Cons  OPEX: highest  Relational (non open) DBMS are expensive  Bits+Management  You have to be a real Administrator  Scalability: you can ONLY scale up  Current sharding needs application to be updated  Current sharding is in experimentation stage
  12. 12. DEMO SQL Server in a Azure VM
  13. 13. Handle relational data with SaaS  You don’t want to handle management issues  You don’t want vertical scalability-related issues  You don’t need special infrastructural architecture  “PaaS if possibile, IaaS if really needed”
  14. 14. Handle relational data with SaaS: Pro  OPEX: lower than IaaS  Bits+Management  Full power of a Relational DB  Editions  Clustering  CPU+Memory  No licencing (No CAPEX)  Pay Per Use (OPEX)  No need for images
  15. 15. Handle relational data with SaaS: Cons  OPEX: lower, than IaaS  Partial power of a Relational DB  Configure what is just available  Scalability: can ONLY scale up
  16. 16. Migrating your on-premise SQL to SQL Azure  Not all features of On-Premise SQL are available in SQL Azure  A “backup” is not enough to bring DB to the cloud  Exporting a script  Last December 2014 update have great news  Some tools are available, updated  Developer Way: Database Project, targeting SQL Azure  Operations Way: Database | Tasks | Deploy to Windows Azure SQL Database 
  17. 17. DEMO Migrate your SQL Database to SQL Azure
  18. 18. Host your Web Application in a Azure Web Site  Publish your Web Application in a Web Sites  Seconds (minutes) to go  Configure DB access in web.config
  19. 19. DEMO Publish your web app to Azure Web Site in Visual Studio 2013
  20. 20. Stateful web application  Statefulness is the state that influences the computation of every request in a web application  State avoids horizontal scalability  State is evil, but you have it!
  21. 21. Bring state OUTSIDE your web server  Redis as an efficient in memory key/value store  Configure ASP.NET MVC to use Redis (declarative approach)  Session State is taken OUTSIDE web application  State can be shared between two or more instances (scaling out!)
  22. 22. DEMO Configure ASP.NET using REDIS
  23. 23. Latency in a cloud environment is an issue  In a cloud environment, database is FAR from app hosting  Query result set can “arrive” long…  How many times is a query executed? How many times same data are retrieved?  In a pay per use environment, queries costs?  SQL licensing  Bandwidth
  24. 24. Programming approach to Redis  Implements a cache-aside pattern   Query cache first  If not found, Query data source and store result in cache  Cache invalidation rules have to be handled  Explicit  Timeout  Find many .NET clients in nuget  Example Stack Exchange implementation
  25. 25. DEMO
  26. 26. Search inside your data  Search on relational DB is tipically “field-oriented” search  Search in the web is more “context free”, “full text” search  Handling text is not simple
  27. 27. Azure Search  A search-as-a-service solution allowing developers to incorporate great search experiences into applications without managing infrastructure or needing to become search experts.  You acquire immediately all text search experience  You acquire immediately support for languages  It is based on Elastic Search  Bullet proof, state of the art, search implementation  It is independent from a specific data source  You need to publish your data EXPLICITLY to the search service
  28. 28. DEMO
  29. 29. Latencies with data  As already told, data is “far” from app  You can have issues with timeouts  You have to retry a query
  30. 30. Data that scale out  You can handle scalability in two ways  Scale up: increase power of your “hardware” to improve application responsiveness  But you cannot avoid programming issues, like “locks”  Scale out: partition data. Divide data horizontally (by key) to distribute data between instances.  Problem: SQL db don’t partition
  31. 31. Entity Framework to the rescue  All issues can be solved at application level with Entity Framework (EF6)  Well, with some help from external code  Not native implementations  Not the best solutions in Cloud
  32. 32. DEMO
  33. 33. Conclusions
  34. 34. Recap Operations  Migrate your DB to SQL Azure  Or the equivalent DaaS for the RDBMS you like (, for example)  Use IaaS only if you really (really) need  Publish your app on Web Site
  35. 35. Developer Recap  Create a Redis instance  Configure SessionState if you use Session in ASP.NET  Implement cache-aside pattern to avoid repeated queries – this is the same for every db you use  Create an Azure Search instance  Enhance your experience in text search!  Improve EF experience  Handle retries (in cloud is mandatory)  Partition your data if you have very big datasets
  36. 36. Conclusions  Consider Azure as a Platform opportunity for your application  Consider Azure as a Data Platform opportunity for your application  You cannot move your application without making improvements to your architecture  Make an assessment to check all issues with your legacy chooses  Evaluate all other data opportunities in Azure
  37. 37. Thank You! - Q&A Marco Parenzan Azure Weekly – January 20th, 2015 Email: Slideshare: GitHub: https://www.gihtub.cob/marcoparenzan Twitter: