azure weekly - 2015.01.20 - marco parenzan - data opportunities with azure

37
Data Opportunities with Azure Marco Parenzan Azure Weekly – January 20 th , 2015

Upload: marco-parenzan

Post on 17-Jul-2015

115 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

Data Opportunities with Azure

Marco ParenzanAzure Weekly – January 20th, 2015

Page 2: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

Marco ParenzanTraining 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

Page 3: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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?

Page 4: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

….

Page 5: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 6: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

Opportunity

Enhance you SQL-BASED ASP.NET

experience with AZURE

Page 7: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

Is Azure just a new hosting opportunity?

Yes, it’s an operational opportunity. You can solve your issues

about

Deployment

Security

Maintenance

(some) Scalability

Page 8: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 9: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

Agenda

Operational opportunities in Azure

Developer opportunities in Azure

Page 10: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 11: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 12: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

DEMO

SQL Server in a Azure VM

Page 13: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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”

Page 14: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 15: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 16: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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/

Page 17: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

DEMOMigrate your SQL Database to SQL Azure

Page 18: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 19: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

DEMOPublish your web app to Azure Web Site

in Visual Studio 2013

Page 20: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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!

Page 21: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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!)

Page 22: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

DEMOConfigure ASP.NET using REDIS

Page 23: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 24: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 25: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

DEMO

Page 26: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 27: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 28: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

DEMO

Page 29: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

Latencies with data

As already told, data is “far” from app

You can have issues with timeouts

You have to retry a query

Page 30: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 31: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 32: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

DEMO

Page 33: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

Conclusions

Page 34: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 35: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 36: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

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

Page 37: Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure

Thank You! - Q&A

Marco ParenzanAzure Weekly – January 20th, 2015

Email: [email protected]

Slideshare: http://www.slideshare.net/marcoparenzan

GitHub: https://www.gihtub.cob/marcoparenzan

Twitter: http://twitter.com/marco_parenzan