Migrating Business Apps to Windows Azure

  • Published on
    24-Feb-2016

  • View
    47

  • Download
    0

DESCRIPTION

Migrating Business Apps to Windows Azure. Marc Mller Principal Consultant, 4tecture Gmb H www.4tecture.ch www.dotnetacademy.ch mmueller@4tecture.ch. Agenda. Short Introduction to Windows Azure Overview Differences to On-Premise Development Migration Strategies - PowerPoint PPT Presentation

Transcript

<p>PowerPoint Presentation</p> <p>Migrating Business Apps to Windows AzureMarc MllerPrincipal Consultant, 4tecture GmbH</p> <p>www.4tecture.chwww.dotnetacademy.chmmueller@4tecture.chAgendaShort Introduction to Windows AzureOverviewDifferences to On-Premise DevelopmentMigration StrategiesLogic / Frontend / StorageCloud Computing TopicsScale Out / Scale upArchitecture / Cost Oriented ArchitectureSecurityRole ManagementCall to ActionQuestionsAgendaWindows AzureWhat, Cloud is just computers? differences to on-premise systemsDemoDefinition of Cloud Computing</p> <p>Software-as-a-ServiceconsumeSaaS</p> <p>Platform-as-a-ServicebuildPaaS</p> <p>Infrastructure-as-a-ServicehostIaaSPackaged SoftwareStorageServersNetworkingO/SMiddlewareVirtualizationDataApplicationsRuntimeYou manageInfrastructure(as a Service)StorageServersNetworkingO/SMiddlewareVirtualizationDataApplicationsRuntimeManaged by vendorYou managePlatform(as a Service)Managed by vendorYou manageStorageServersNetworkingO/SMiddlewareVirtualizationApplicationsRuntimeDataSoftware(as a Service)Managed by vendorStorageServersNetworkingO/SMiddlewareVirtualizationApplicationsRuntimeDataImage Source: Windows Azure Training KitThe transition to the cloud</p> <p>Windows ServerSingle InstancePersistent</p> <p>File SystemNetwork Shares</p> <p>Windows Security (AD)</p> <p>Windows AzureMulti InstanceStateles OS</p> <p>Azure StorageSQL Azure</p> <p>ACS (AD ADFS)Azure Connect / Service Bus</p> <p>BenefitsAutomated UpdatesMulti-Instance-ManagementScale-OutHigh Availability / FailoverStandard Cloud TiersFront end: e.g. load-balanced stateless web serversMiddle worker tier: e.g. order processing, encodingBackend storage: e.g. SQL tables or filesMultiple instances of each for scalability and availability</p> <p>Front-EndCloud ApplicationFront-EndHTTP/HTTPSWindowsAzureStorage,SQL AzureLoad BalancerMiddle-TierImage Source: Windows Azure Training KitTop migration effort pointsStateful vs Stateless</p> <p>Scheduled Jobs</p> <p>Complex Business Logic in Database</p> <p>File HandlingMigration StrategiesAzure ComputeHow to migrate your processing logicWindwos Azure RolesRole is an executableCreate your own web server, host a database, etc.Inbound onAny TCP PortHTTP/HTTPSWorker Role</p> <p>Role is hosted on IISHTTP/HTTPSASP.NETFast CGI + PHPWeb Role</p> <p>Move applications to Windows AzureFull control over OS ImageVHD ImageDesigned for long or non-automated installsImage must be Windos Server 2008 R2 EnterpriseVM Role</p> <p>Azure Package and EndpointsConfigurationService Definition (*.csdef)Service Configuration (*.cscfg)</p> <p>Deployment PackageEncrypted(Zipped(Code + *.csdef))*.cspkg file</p> <p>Deplyoment(*.cspkg + *.cscfg)</p> <p>EndpointsInputInternalWindows Azure ConnectStartup TasksEnables short, unattended setups on role startupSilent MSIs, COM Components, Registry Keys, Configuring Windows Server, etc.Configured in the .csdefTask TypeSimple System waits for the task to exitBackground System does not wait for the task to exitForeground Same as background, but blocks role restart until tasks exit</p> <p>Workflow (simplified)Define your EndpointsDefine Roles and Instance CountCreate a deployment package (application binaries)Provide additional Installers and Binaries for Startup TasksDeploy!</p> <p> but there are some important points to consider!Migration StrategiesAzure StorageHow to hanlde files in the cloudStorage ChallangeDont think in terms of file system accessThink RESTful4 HTTP Verbs for CRUDRessources</p> <p>Local file system should be used for local cache onlyCreate logical storage storage interfaces / abstractions CreateAzure Storage adapters in your application</p> <p>Migrate your local file systemBlobs - Simple named files along with metadata for the fileTwo level hierarchy container / fileSecurity on container / file policy or signatureTwo TypesBlock BLOB (streaming workload [file], blocks, max 200GB)Page BLOB (random read / write, pages, max 1TB)</p> <p>Drives - Durable NTFS volumesPage BLOB formatted as a NTFS single volume VHDone instance read/write, read-only snapshot for multiple instancesDrive API, not REST Calls NTFS API for read/write</p> <p>Access BLOB FilesRESTful URL</p> <p>Can include / or other delimeter in namee.g. //f1/blob1.jpge.g. //f1/blob2.jpghttp://.../?comp=list&amp;prefix=f1&amp;delimiter=/ f1/blob1.jpg, f1/blob2.jpg</p> <p>Image Source: Windows Azure Training KitBLOB SecurityControl the access to your filesFine grain access rights to blobs and containersSign URL with storage key permit elevated rightsRevocationUse short time periods and re-issueUse container level policy that can be deleted Two broad approachesAd-hocPolicy based</p> <p>Create Shared Access Keys byToolAPIWeb AppClientBlob StorageRequest Shared Access KeyURLSigned URLDemoToolsWindows Azure Storage Explorerhttp://azurestorageexplorer.codeplex.com</p> <p>New ConceptsAzure Table StorageNot a RDBMS!Tables and EntitiesCRUDNo fixed Schema (except Partition Key, Row Key, Timestamp)Up to 255 properties per Entity type (standard .NET Types)</p> <p>Azure Queue StorageUsed for instance synchronizationMessages (max. 8kb)Reliable Delivery / Poisonous Message detection</p> <p>Image Source: Windows Azure Training KitMigration StrategiesDatabaseSQL Database in the cloudSQL Azure</p> <p>SQL Server EngineShared infrastructureRequest routing, security, isolationScalable / high availabilityAutomatic replication and failover</p> <p>Working with SQL AzureTDS 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)</p> <p>ChallengeSQL Azure focusses on logical administrationSchema creation and managementQuery optimizationSecuriy management</p> <p>No physical management needed / possible</p> <p>RestrictionsNot supported: Sparse Columns, Filestreams, Partitions, Full-Text-indexes, SQL-CLRTables require clustered indexes</p> <p>New featuresSQL Azure Federations</p> <p>How do I migrate my database?TSQLManagement Studio Script database asSize restrictions (data)! use BCP</p> <p>TSQL with BCP (Bulk Copy Utility)SQL Azure Migration Wizard (http://sqlazuremw.codeplex.com)SQL Azure Federation Data Migration Wizard (http://sqlazurefedmw.codeplex.com)</p> <p>SQL Server Data-Tier Applications (DAC)DACPAC / BACPAC</p> <p>Sync Framework 2.1</p> <p>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_nameNo job scheduler!</p> <p>Sync with on-premise databaseSQL Azure DatasyncFull backup functionality on on-premise database</p> <p>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</p> <p>SQL Azure Backup ToolsQuest Spotlight for SQL Azure, Enzo Backup for SQL Azure, Redgate SQL Azure Backup Tool, SQLAzureBackupHow do I implemen multi-tenancy?SQL Azure FederationsOut of the box scalabilitySharding pattern</p> <p>Scale out multiple phyiscal DBs</p> <p>Split and Merge online</p> <p>USE FEDERATION tenant_federation(id = 1)WITH RESET, FILTERING=ON Goselect * from customers</p> <p>No out of the box DAL Components!</p> <p>Restriction WorkaroundsJob SchedulerUse an on-premise database (sync) and run the jobs locallyOn-premise job scheduler with connection to SQL Azure (TSQL)Local SQL Server Integration Services with connection to cloudUse an Azure Worker Role with a scheduler</p> <p>Full Text SearchLucene.net</p> <p>Unique identifier Clustered IndexesNEWSEQUANTIALID() ist not supported!Dont use unique identifiers for clustered indexes orprovide custom index generator (App Tier)</p> <p>Migration StrategiesInfrastructureHow to integrate cloud and on-premise infrastructureWindows Azure ConnectEnables hybrid apps access to on-premises serversAllows remote administration of Windows Azure appsNetwork policy managed through Windows Azure portalAutomatic setup of IPsec</p> <p>EnterpriseWindows Azure </p> <p>Databases</p> <p>Dev machinesRelayRole BRole ARole C(multiple VMs)Migration StrategiesCloud FeaturesDesign your application for the cloud!Scale-Out ArchitectureStorageTablesLBBlobsWorker ServiceWorker ServiceWorker RoleManaged Interface CallWeb Site(ASPX, ASMX, WCF)Web Site(ASPX, ASMX, WCF)Web RoleIIS as HostQueuesWindows Azure Data CenterLBLBThe InternetThe Internet via TCP or HTTPImage Source: Windows Azure Training KitScale-Out ArchitectureIntelligent Network Load BalancerAsync ActivationNetwork ActivationBlob StoragePartitioned RDBMSKey/ValueDatastoresState TierQueuesStateless Web and/or Application ServersStateless Worker MachinesRole PatternsWeb RoleIIS Web Application / Web Farm</p> <p>Worker RoleQueue Polling WorkerPoll and Pop Messages (i.e. map/reduce pattern)Listening Worker RoleTcpListener / WCF (i.e. run a .NET SMTP)External Process Worker RoleStart process from application or startup taskE.g. Run a database server, web server, distributed cache</p> <p>Web / Worker Hybrid Role Web Application and Background Worker in same InstanceWeb RoleWorker RoleHybrid RoleAsynchronous ProgrammingUse queue messages for tasksA message should be small, use BLOB or Table storage for the payload</p> <p>Web RoleWorker RoleStorageQueueLBLBWorker RoleWorker RoleWeb RoleWorker RoleBlob ContainerTable</p> <p>Map Reduce</p> <p>Upload Web RoleMap Worker Role</p> <p>Reduce Worker Role</p> <p>Image Uploaded</p> <p>Image SplitSlicesSaved ToBlob Storage</p> <p>Slices Pulled from Blob StorageImages Processedin Worker InstancesProcessed Slices Pushed Back to Blob Storage</p> <p>Splits ReducedBack to Full Image</p> <p>Final ImageSaved as BLOBReady for UseQueue Best PracticesEnsure thatmessages are idempotent [f(x) = f(f(x))] and have a compensation mechanismyou implement poison detection</p> <p>To do so, you have toCheck the dequeue count of a messageUse Transaction with Rollback / ComitUse an Action-Log to recover last stateMove poisonous message to a separate queue or delete them</p> <p>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)</p> <p>Horizontal Partitioning:Vertical Partitioning:Migration StrategiesSecurityHow to authenticate in your cloud applicationAuthentication &amp; AuthorizationWe do not want toimplement another security systemintegrate the cloud server into our domain</p> <p>We want tointegrate into our existing security system (AD)integrate partners and customersuse open an flexible standardsTrustSecurity TokenIntegrate in companys ADHow it works</p> <p>SubjectRelying PartyIdentity ProviderClientApplicationSecurity Token ServiceTokenKontrolleVertrauen</p> <p>Claims</p> <p>Image Source: Windows Azure Training KitMigration StrategiesRole ManagementScale Out / Scale UpCloud Computing PatternsOptimize your instance usageSave moneyHave responsive apps</p> <p>Manage InstancesManually through management portalManuelly through management serviceAutomaticallyTrac diagnostic informationModify instance count automatically(i.e. EntLib 5 Autoscaling Block)</p> <p>ConfigurationDeplyoment packages are staticAny files that are part of a ASP.NET project on windows azure are READ ONLY!If you need to be able to change the contents of files:User Blob StorageIf its configuration, use the service model files which can be changed at runtime.Service Definition (Schema)Describes the shape of your Windows Azure Service (Role Definition, Ports, ertificates, Startup Tasks, )Can only be changed with a deployment</p> <p>Service Configuration (Values)Runtime Values (Scale, Config Settings,)Can be updated through management portal / API</p> <p>DeploymentTwo environments to choose fromProduction environment .cloudapp.netStaing environment .cloudapp.net</p> <p>VIP Swap swap staging and production environment</p> <p>In-Place Upgrade (most restrictive on changes)</p> <p>Use staging environment forDeployment verificationUpgrade without interruptionShould not be used as a testing environmentDeployment ManagementToolsVisual Studio, CSManage.exe, Windows Azure MMC, WASM cmdlets, 3rd party</p> <p>Management APIRESTful serviceBuild your own tools</p> <p>DiagnosticsLogs, Crash Dumps, Performance Counters, Event Logs, Debug/Trace Statements, Infrastructure Events</p> <p>Lets get startedMSDN BenefitsMSDN Benefitshttp://www.windowsazure.com/en-us/pricing/member-offers/msdn-benefits/ </p> <p>Special Training Offerhttp://www.4tecture.ch/Media/Default/Flyer/AzureQuickstartFlyer.pdf </p> <p>Questions?</p>

Recommended

View more >