JAZUG

Download JAZUG

Post on 27-Aug-2014

1.282 views

Category:

Software

14 download

DESCRIPTION

Azure http://ec.nikkeibp.co.jp/item/books/P98330.html

TRANSCRIPT

  • kyrt / Takekazu Omi http://kyrt.in takekazu.omi@kyrt.in @takekazuomi 2014/7/30 1.0.1
  • Cloud Design Patterns: Prescriptive Architecture Guidance for Cloud Applications kyrt @takekazuomi 2
  • JAZUG Azure Storage Microsoft MVP for Azure kyrt @takekazuomi 3 kyrt.in github.com/takekazuomi white paper
  • Microsoft patterns & practices Cloud Design Patterns: Prescriptive Architecture Guidance for Cloud Applications http://msdn.microsoft.com/en- us/library/dn568099.aspx 20146 Azure http://ec.nikkeibp.co.jp/item/books/P98330.html BP CDP kyrt @takekazuomi 4
  • Software design pattern Cloud Application 24 10 http://azure.microsoft.com/en-us/documentation/infographics/cloud- design-patterns/ kyrt @takekazuomi 5
  • JAZUG de:code kyrt @takekazuomi 6
  • 8 10code sample kyrt @takekazuomi 7
  • Design Patterns with Sample Code kyrt @takekazuomi 8 Code samples Competing Consumers Pattern Compute Resource Consolidation Pattern External Configuration Store Pattern Health Endpoint Monitoring Pattern Leader Election Pipes and Filters Pattern Priority Queue Pattern Runtime Reconfiguration Pattern Static Content Hosting Pattern Valet Key Pattern
  • kyrt @takekazuomi 9
  • Sample Codes kyrt @takekazuomi 10
  • Web Platform Installer Microsoft Visual Studio 2012/2013 Windows Azure Tools for Microsoft Visual Studio http://azure.microsoft.com/ja-jp/develop/net/ Azure Trial http://azure.microsoft.com/ja-jp/pricing/free-trial/ kyrt @takekazuomi 112014/2/26
  • Codes Azure Storage2.1.x 4.2.0 (7/28 release) Azure SDK 2.2 (2.3 kyrt @takekazuomi 12
  • Cloud Design Patterns: Prescriptive Architecture Guidance for Cloud Applications http://msdn.microsoft.com/en-us/library/dn568099.aspx http://aka.ms/Cloud-Design-Patterns-Sample kyrt @takekazuomi 13
  • Cloud Design Patterns Examples.zip Competing Consumers Compute Resource Consolidation External Configuration Store Health Endpoint Monitoring Leader Election Pipes and Filters Priority Queue Runtime Reconfiguration Static Content Hosting Valet Key +Readme files kyrt @takekazuomi 14
  • Competing Consumers Pattern kyrt @takekazuomi 15
  • Competing Consumers Pattern http://msdn.microsoft.com/en-us/library/dn568101.aspx kyrt @takekazuomi 16
  • Outline Queue kyrt @takekazuomi 17
  • Project CompetingConsumers.ccproj Azure Role CompetingConsumers.Shared.csproj Sender,Receiver Receiver.csproj Consumer Sender.csproj Producer kyrt @takekazuomi 18
  • Sender worker role Service Bus Queue Receiver worker role Queue Receiver worker 2 kyrt @takekazuomi 19
  • Service Bus Queue Utility Class CompetingConsumers.Shared.QueueManager Start() Stop() SendMessagesAsync() ReceiveMessages() kyrt @takekazuomi 20
  • async Task QueueManager.Start() Receiver.OnStart(), Sender.OnStart() Queue Queue idempotent Check->-> MessagingEntityAlreadyExistsException TraceWarning MessagingException InnerException as WebException !=null API HttpStatusCode kyrt @takekazuomi 21
  • async Task QueueManager.Start() queueDescription.MaxDeliveryCount = 3; Brokered Messaging: Dead Letter Queue http://code.msdn.microsoft.com/windowsazure/Brokere d-Messaging-Dead- 22536dd8/sourcecode?fileId=76870&pathId=497121593 kyrt @takekazuomi 22
  • Compute Resource Consolidation Pattern 1.5 P32 kyrt @takekazuomi 23
  • Compute Resource Consolidation Pattern http://msdn.microsoft.com/en-us/library/dn589778.aspx kyrt @takekazuomi 24
  • Outline separation of concernsSoC kyrt @takekazuomi 25
  • Project ComputeResourceConsolidation.ccproj Role ComputeResourceConsolidation.Worker.ccproj WorkerRole kyrt @takekazuomi 26
  • WorkerRole MyWorkerTask[12](CancellationToken ct) worker role task Trace.TraceInformation Task.Delayloop #1 30#25 CancellationToken Task.Delay() kyrt @takekazuomi 27
  • WorkerRole.Run() Run() Task.WaitAny() Task AggregateException OperationCanceledException (Stop) kyrt @takekazuomi 28
  • WorkerRole.Run():L61,L74,L98 L61 catch (AggregateException ex) L71) cts.IsCancellationRequested (Stop) L74, L98:Stop(TimeSpan.FromMinutes(5)) L98OnStop()5 L74 kyrt @takekazuomi 29
  • kyrt @takekazuomi 30
  • External Configuration Store Pattern 1.8 P62 kyrt @takekazuomi 31
  • External Configuration Store Pattern http://msdn.microsoft.com/en-us/library/dn589803.aspx kyrt @takekazuomi 32
  • Outline config kyrt @takekazuomi 33
  • WorkerRole.cs WorkerRole Class ExternalConfigurationManager.cs Cache ExternalConfiguration.cs ExternalConfigurationManagerFactory Class Lazy BlobSettingsStore.cs BlobStore kyrt @takekazuomi 34
  • WorkerRole.OnStart():L43 UL L85: Subscribe L52: ExternalConfiguration.Instance.Changed.Subscribe kyrt @takekazuomi 35
  • WorkerRole.OnStop():L65 Blog DeleteConfigurationBlob():L94 upload, delete Version CheckUL ETag kyrt @takekazuomi 36
  • ISettingsStore P65 Update() kyrt @takekazuomi 37 public interface ISettingsStore { Task GetVersionAsync(); Task> FindAllAsync(); }
  • BlobSettingsStore async Task GetVersionAsync() :L40 FetchAttributesAsync()HEAD Body ETag ETag kyrt @takekazuomi 38
  • Azure Files SMB 2.1 net use z: myaccount.file.core.windows.netmyshare /u:myaccount StgAccKey== AzCopy 2.4 copy Storage Client library 4.0 Microsoft Azure Files http://blogs.msdn.com/b/windowsazurej/archive/2014/06/05/ blog-introducing-microsoft-azure-file-service.aspx kyrt @takekazuomi 39
  • Health Endpoint Monitoring 1.11 P82 kyrt @takekazuomi 40
  • Health Endpoint Monitoring http://msdn.microsoft.com/en-us/library/dn589789.aspx kyrt @takekazuomi 41
  • Outline http SSL kyrt @takekazuomi 42
  • HealthEndPointMonitoring.Web.csproj EndpointASP.NET HealthEndpointMonitoring.Cloud.ccproj Azure Project kyrt @takekazuomi 43
  • Leader Election Pattern 1.13 P99 kyrt @takekazuomi 44
  • kyrt @takekazuomi 45 http://msdn.microsoft.com/en-us/library/dn568104.aspx
  • Outline RoleJob Blob Mutex Apache Zookeeper kyrt @takekazuomi 46
  • DistributedMutex.csproj LeaderElection.ccproj Azure Project LeaderElection.Tests.csproj Unit Test LeaderElection.Worker.csproj Worker Role kyrt @takekazuomi 47
  • BlobLeaseManager L51: RetryPolicy = new LinearRetry(TimeSpan.FromSeconds(1), 3); RetryPolicy LinearRetry L76,L138 DebugStorageException StorageExtendedErrorInformationRequestResult kyrt @takekazuomi 48
  • Pipes and Filters Pattern 1.15 P133 kyrt @takekazuomi 49
  • kyrt @takekazuomi 50 http://msdn.microsoft.com/en-us/library/dn568100.aspx
  • Outline kyrt @takekazuomi 51
  • Project PipesAndFilters.Cloud.ccproj Azure Project InitialSender.csproj WorkerRole PipeFilterA.csproj AWorkerRole PipeFilterB.csproj BWorkerRole FinalReceiver.csproj WorkerRole kyrt @takekazuomi 52
  • QueueManager.cs Competing Consumers QueueManager ServiceBusPipeFilter.cs Start()idempotent OnPipeFilterMessageAsync() Func>Mesasge out queue kyrt @takekazuomi 53
  • kyrt @takekazuomi 54
  • kyrt @takekazuomi 55
  • Queue Service Bus Queue Storage Queue Special Thanks Source Han Sans http://github.com/adobe-fonts/source-han-sans/ kyrt @takekazuomi 56
  • Storage Client Library 4.2.0 kyrt @takekazuomi 57
  • Windows Azure Storage 4.2.0 (1) 2014/7/28 All: NameValidator class All: LogRecord RequestUrl HTML4 decoded BUG All: 24 All: log line error All (WP): Windows Phone All (WP): Windows Phone 8.1 Silverlight support kyrt @takekazuomi 58
  • Windows Azure Storage 4.2.0 (2) Blobs: blob snapshots SAS tokens Blobs: CloudBlobClient.DefaultDelimiter http://github.com/Azure/azure-storage- net/commit/905e9f260b8c673988cee9903092af7c71517270#diff- 90cd11bb9518ee4bff77205ad15cf726R218 Queues (RT): queue message messagettl visibilitytimeout query parameters kyrt @takekazuomi 59
  • Windows Azure Storage 4.2.0 (3) Tables: CloudTable.DeleteIfExists async Table exception false http://github.com/Azure/azure-storage- net/releases/tag/v4.2.0 http://www.nuget.org/packages/WindowsAzure.Storage/ 4.2.0 kyrt @takekazuomi 60