This document discusses how Azure provides opportunities for handling data beyond traditional relational databases. It presents Azure as both an operational opportunity for hosting through IaaS and PaaS offerings, as well as an architectural opportunity through services like Redis, Azure Search, and scaling data across instances. The document demonstrates migrating a SQL database to SQL Azure, publishing a web app to an Azure web site, configuring ASP.NET to use Redis, and searching data with Azure Search. It concludes that Azure should be viewed as a platform to enhance applications through improved data handling.
2. Marco Parenzan
Training and Speaking with 1nn0va
Microsoft MVP 2014 for Microsoft Azure
Training and planning with ITS Kennedy
www.slideshare.net/marco.parenzan
marco [dot] parenzan [at] libero [dot] it
www.innovazionefvg.net
Developer and Architect in .NET and Web
Cloud Developer
Loves functional programming
Some videogames for fun
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. 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. 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
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. 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
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. 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
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. 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. 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. 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
ď‚š https://sqlazuremw.codeplex.com/
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
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. 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!)
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. Programming approach to Redis
ď‚š Implements a cache-aside pattern
ď‚š http://azure.microsoft.com/en-us/documentation/infographics/cloud-design-patterns/
ď‚š 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
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. 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
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. 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. 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
34. Recap Operations
ď‚š Migrate your DB to SQL Azure
ď‚š Or the equivalent DaaS for the RDBMS you like (https://www.cleardb.com/, for
example)
ď‚š Use IaaS only if you really (really) need
ď‚š Publish your app on Web Site
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. 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