43
Migrating Business Apps to Windows Azure Marc Müller Principal Consultant, 4tecture GmbH www.4tecture.ch www.dotnetacademy.ch [email protected]

Migrating Business Apps to Windows Azure

  • Upload
    joie

  • View
    61

  • Download
    0

Embed Size (px)

DESCRIPTION

Migrating Business Apps to Windows Azure. Marc Müller Principal Consultant, 4tecture Gmb H www.4tecture.ch www.dotnetacademy.ch [email protected]. Agenda. Short Introduction to Windows Azure Overview Differences to On-Premise Development Migration Strategies - PowerPoint PPT Presentation

Citation preview

Page 1: Migrating  Business Apps to Windows  Azure

Migrating Business Apps to Windows Azure

Marc MüllerPrincipal Consultant, 4tecture GmbH

[email protected]

Page 2: Migrating  Business Apps to Windows  Azure

Agenda

AgendaShort Introduction to Windows Azure

Overview Differences to On-Premise Development

Migration Strategies Logic / Frontend / Storage

Cloud Computing Topics Scale Out / Scale up Architecture / Cost Oriented Architecture

SecurityRole ManagementCall to ActionQuestions

Page 3: Migrating  Business Apps to Windows  Azure

Windows AzureWhat, Cloud is just computers? – differences to on-premise systems

Page 4: Migrating  Business Apps to Windows  Azure

Demo

Page 5: Migrating  Business Apps to Windows  Azure

Definition of Cloud Computing

Software-as-a-Service

consume

“SaaS”Platform-as-a-Service

build

“PaaS”Infrastructure-as-a-Service

host

“IaaS”

Packaged Software

Storage

Servers

Networking

O/S

Middleware

Virtualization

Data

Applications

Runtime

You

man

age

Infrastructure(as a Service)

Storage

Servers

Networking

O/S

Middleware

Virtualization

Data

Applications

Runtime

Managed by vendor

You

man

age

Platform(as a Service)

Managed by vendor

You

man

age

Storage

Servers

Networking

O/S

Middleware

Virtualization

Applications

Runtime

Data

Software(as a Service)

Managed by vendor

Storage

Servers

Networking

O/S

Middleware

Virtualization

Applications

Runtime

Data

Image Source: Windows Azure Training Kit

Page 6: Migrating  Business Apps to Windows  Azure

The transition to the cloudWindows Server Single Instance Persistent

File System Network Shares

Windows Security (AD)Windows Azure Multi Instance Stateles OS

Azure Storage SQL Azure

ACS (AD ADFS) Azure Connect / Service Bus

Benefits Automated Updates Multi-Instance-Management Scale-Out High Availability / Failover

Page 7: Migrating  Business Apps to Windows  Azure

Standard Cloud Tiers Front end: e.g. load-balanced stateless web

servers Middle worker tier: e.g. order processing,

encoding Backend storage: e.g. SQL tables or files Multiple instances of each for scalability and

availability Front-End

Cloud Application

Front-EndHTTP/HTTPS

WindowsAzure

Storage,SQL Azure

Load Balancer

Middle-Tier

Image Source: Windows Azure Training Kit

Page 8: Migrating  Business Apps to Windows  Azure

Top migration effort pointsStateful vs Stateless

Scheduled Jobs

Complex Business Logic in Database

File Handling

Page 9: Migrating  Business Apps to Windows  Azure

Migration StrategiesAzure ComputeHow to migrate your processing logic

Page 10: Migrating  Business Apps to Windows  Azure

Windwos Azure Roles

Role is an executableCreate your own web server, host a database, etc.

Inbound onAny TCP PortHTTP/HTTPS

Worker Role Role is hosted on IIS HTTP/HTTPS ASP.NET Fast CGI + PHP

Web Role

“Move” applications to Windows Azure Full control over OS Image VHD Image Designed for long or non-automated installs Image must be Windos Server 2008 R2

Enterprise

VM Role

Page 11: Migrating  Business Apps to Windows  Azure

Azure Package and EndpointsConfiguration

Service Definition (*.csdef) Service Configuration (*.cscfg)

Deployment Package Encrypted(Zipped(Code + *.csdef)) *.cspkg file

Deplyoment (*.cspkg + *.cscfg)

Endpoints Input Internal Windows Azure Connect

Page 12: Migrating  Business Apps to Windows  Azure

Startup Tasks Enables short, unattended setups on role startup

Silent MSIs, COM Components, Registry Keys, Configuring Windows Server, etc. Configured in the .csdef Task Type

Simple – System waits for the task to exit Background – System does not wait for the task to exit Foreground – Same as background, but blocks role restart until tasks exit

<WebRole name=“FabrikamShipping.App.Web"> <Startup> <Task commandline="relative\path\ToSetupExecutable" executionContext="limited|elevated" taskType=“simple|foreground|background"/> </Startup></WebRole>

Page 13: Migrating  Business Apps to Windows  Azure

Workflow (simplified) Define your Endpoints Define Roles and Instance Count Create a deployment package (application binaries) Provide additional Installers and Binaries for Startup

Tasks Deploy!

… but there are some important points to consider!

Page 14: Migrating  Business Apps to Windows  Azure

Migration StrategiesAzure StorageHow to hanlde files in the cloud…

Page 15: Migrating  Business Apps to Windows  Azure

Storage Challange Don’t think in terms of «file system access» Think RESTful

4 HTTP Verbs for CRUD Ressources

Local file system should be used for «local cache» only Create logical storage storage interfaces / abstractions CreateAzure Storage adapters in your application

Page 16: Migrating  Business Apps to Windows  Azure

Migrate your local file systemBlobs - Simple named files along with metadata for the file

Two level hierarchy – container / file Security on container / file – policy or signature Two Types

Block BLOB (streaming workload [“file”], blocks, max 200GB) Page BLOB (random read / write, pages, max 1TB)

Drives - Durable NTFS volumes Page BLOB formatted as a NTFS single volume VHD one instance read/write, read-only snapshot for multiple instances Drive API, not REST Calls – NTFS API for read/write

Page 17: Migrating  Business Apps to Windows  Azure

Access BLOB FilesRESTful URL

Can include ‘/‘ or other delimeter in name

e.g. /<container>/f1/blob1.jpg e.g. /<container>/f1/blob2.jpg http://.../<container>?comp=list&prefix=f1&delimiter=/ f1/blob1.jpg,

f1/blob2.jpg Image Source: Windows Azure Training Kit

Page 18: Migrating  Business Apps to Windows  Azure

BLOB SecurityControl the access to your files Fine grain access rights to blobs and containers Sign URL with storage key – permit elevated rights Revocation

Use short time periods and re-issue Use container level policy that can be deleted

Two broad approaches Ad-hoc Policy based

Create Shared Access Keys by Tool API

Web App

Client

Blob Storage

Request Shared Access KeyURL

Signed URL

Page 19: Migrating  Business Apps to Windows  Azure

Demo

Page 20: Migrating  Business Apps to Windows  Azure

ToolsWindows Azure Storage Explorerhttp://azurestorageexplorer.codeplex.com

Page 21: Migrating  Business Apps to Windows  Azure

New ConceptsAzure Table Storage

Not a RDBMS! Tables and Entities

CRUD No fixed Schema (except

Partition Key, Row Key, Timestamp) Up to 255 properties per

Entity type (standard .NET Types)

Azure Queue Storage Used for instance synchronization Messages (max. 8kb) Reliable Delivery / Poisonous Message detection

Image Source: Windows Azure Training Kit

Page 22: Migrating  Business Apps to Windows  Azure

Migration StrategiesDatabaseSQL Database in the cloud

Page 23: Migrating  Business Apps to Windows  Azure

SQL Azure

Click icon to add picture

SQL Server EngineShared infrastructure

Request routing, security, isolation

Scalable / high availability Automatic replication and failover

Working with SQL Azure TDS Protocol (Firewall rules!) Use existing clint libraries: ADO.NT, ODBC, PHP, … Cannot switch between DBs (no USE command) Only SSL connections are supported (encrypt = true) Standard SQL Auth Logins (username + password)

Page 24: Migrating  Business Apps to Windows  Azure

ChallengeSQL Azure focusses on logical administration Schema creation and management Query optimization Securiy management

No physical management needed / possibleRestrictions Not supported: Sparse Columns, Filestreams, Partitions, Full-Text-indexes, SQL-CLR Tables require clustered indexes

New features SQL Azure Federations

Page 25: Migrating  Business Apps to Windows  Azure

How do I migrate my database?TSQL Management Studio – Script database as… Size restrictions (data)! use BCP

TSQL with BCP (Bulk Copy Utility) SQL Azure Migration Wizard (http://sqlazuremw.codeplex.com) SQL Azure Federation Data Migration Wizard (http://sqlazurefedmw.codeplex.com)

SQL Server Data-Tier Applications (DAC) DACPAC / BACPAC

Sync Framework 2.1

Page 26: Migrating  Business Apps to Windows  Azure

How do I backup by database?Import / Export (DAC) Not transactional consistent! create a copy first! CREATE DATABASE destination_database_name AS COPY OF

[source_server_name.]source_database_name No job scheduler!

Sync with on-premise database SQL Azure Datasync Full backup functionality on on-premise database

BCP (bulk copy utility) bcp AdventureWorksLTAZ2008R2.SalesLT.Customer out C:\Users\user\Documents\GetDataFromSQLAzure.txt -c -U

username@servername -S tcp:servername.database.windows.net -P password

SQL Azure Backup Tools Quest Spotlight for SQL Azure, Enzo Backup for SQL Azure, Redgate SQL Azure Backup Tool,

SQLAzureBackup

Page 27: Migrating  Business Apps to Windows  Azure

Restriction WorkaroundsJob Scheduler Use an on-premise database (sync) and run the jobs locally On-premise job scheduler with connection to SQL Azure (TSQL) Local SQL Server Integration Services with connection to cloud Use an Azure Worker Role with a scheduler

Full Text Search Lucene.net

Unique identifier Clustered Indexes NEWSEQUANTIALID() ist not supported! Don’t use unique identifiers for clustered indexes or provide custom index generator (App Tier)

Page 28: Migrating  Business Apps to Windows  Azure

Migration StrategiesCloud FeaturesDesign your application for the cloud!

Page 29: Migrating  Business Apps to Windows  Azure

Scale-Out Architecture

StorageTables

LB

Blobs

Worker ServiceWorker

Service

Worker Role

Managed Interface

Call

Web Site(ASPX, ASMX,

WCF)Web Site

(ASPX, ASMX, WCF)

Web RoleIIS as Host

Queues

Windows Azure Data Center

LBLB

The InternetThe Internet via TCP or HTTP

Image Source: Windows Azure Training Kit

Page 30: Migrating  Business Apps to Windows  Azure

Scale-Out ArchitectureIntelligent Network Load Balancer

Async Activation

Network Activation

Blob Storage

Partitioned RDBMS

Key/ValueDatastor

es

State Tier Queues

Stateless Web and/or Application Servers

Stateless ‘Worker’ Machines

Page 31: Migrating  Business Apps to Windows  Azure

Role PatternsClick icon to add pictureClick icon to add picture

Click icon to add picture

Web Role IIS Web Application / Web FarmWorker Role Queue Polling Worker

Poll and Pop Messages (i.e. map/reduce pattern) Listening Worker Role

TcpListener / WCF (i.e. run a .NET SMTP) External Process Worker Role

Start process from application or startup task E.g. Run a database server, web server,

distributed cacheWeb / Worker Hybrid Role

Web Application and Background Worker in same Instance

Web Role Worker Role

Hybrid Role

Page 32: Migrating  Business Apps to Windows  Azure

Asynchronous Programming Use queue messages for tasks A message should be small, use BLOB or Table storage for the payload

Web Role Worker Role

StorageQueue

LB LB

Worker RoleWorker Role

Web Role Worker Role

Blob Container

Table

30mb JPEG

Page 33: Migrating  Business Apps to Windows  Azure

Map Reduce

Upload Web Role

Map Worker Role

Reduce Worker Role

Image Uploaded

Image Split

SlicesSaved To

Blob Storage

Slices Pulled from Blob Storage

Images Processedin Worker Instances

Processed Slices Pushed Back to Blob Storage

Splits ReducedBack to Full Image

Final ImageSaved as BLOBReady for Use

Page 34: Migrating  Business Apps to Windows  Azure

Queue Best PracticesEnsure that messages are idempotent [f(x) = f(f(x))] and have a compensation mechanism you implement poison detection

To do so, you have to Check the «dequeue count» of a message Use Transaction with Rollback / Comit Use an Action-Log to recover last state Move poisonous message to a separate queue or delete them

Page 35: Migrating  Business Apps to Windows  Azure

Data PartitioningWhy should we partition the data? Data volume (too large) Work load (too many transactions) Costs (COA – Cost Oriented Architecture) Elasticity (JIT Partitioning during high load periods)

Horizontal Partitioning: Vertical Partitioning:

Page 36: Migrating  Business Apps to Windows  Azure

Migration StrategiesSecurityHow to authenticate in your cloud application

Page 37: Migrating  Business Apps to Windows  Azure

Authentication & AuthorizationClick icon to add picture

Click icon to add pictureClick icon to add picture

We do not want to implement another security system integrate the cloud server into our domain

We want to integrate into our existing security system (AD) integrate partners and customers use open an flexible standards

TrustSecurity

Token

Integrate in company’s AD

Page 38: Migrating  Business Apps to Windows  Azure

Migration StrategiesRole ManagementScale Out / Scale Up

Page 39: Migrating  Business Apps to Windows  Azure

Cloud Computing PatternsOptimize your instance usage Save money Have responsive apps

Manage Instances Manually through management portal Manuelly through management service Automatically

Trac diagnostic information Modify instance count automatically (i.e. EntLib 5 Autoscaling Block)

Click icon to add pictureClick icon to add picture

Click icon to add pictureClick icon to add picture

Page 40: Migrating  Business Apps to Windows  Azure

Let’s get startedMSDN Benefits

Page 43: Migrating  Business Apps to Windows  Azure

Questions?