Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

28
Bugaev {@rbugaev} Roman, VRP Inc. Windows Azure: technology cocktail

Transcript of Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Page 1: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Bugaev {@rbugaev} Roman, VRP Inc.

Windows Azure: technology cocktail

Page 2: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

“ !Поехали ”

Page 3: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Azure

• Windows Azure Platform is thus classified as platform as a service and forms part of Microsoft's cloud computing strategy, along with their software as a service offering, Microsoft Online Services

Windows Azure: technology cocktail 3

Page 4: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 4

Microsoft CLOUDInfrastructure

From 7 to 17 football fields

Page 5: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 5

Microsoft CLOUDContainers

Page 6: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 6

• 1 1

Page 7: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

What is Windows Azure

• Cloud computing service from Microsoft• Combination of PaaS and IaaS• New development platform

Page 8: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 8

• 1 2

Page 9: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Architecture differences

What is the same: - ASP.NET application runs on IIS and Windows Server- Application uses SQL server Development is still done with VSMain differences:- Application consists of parts called roles- There is no persistent/durable virtual machine- There is no persistent/durable NTFS file system- Application runs in multi instance (server) environment- New API, new configuration files, new type of project

Page 10: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 10

• 1 3

Page 11: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 11

Windows Azure Roles

• Web Role– for web application programming in ASP.NET or PHP– MVC 3

• Worker Role– for performing work on behalf of the web role– may be written in .NET, Ruby, Java– to improve scalability by increasing parall. and async.– used for background work

Page 12: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 12

• 1 4

Page 13: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 13

Developer Experience

• Leverage Existing Skills in .NET, SQL Server, WCF• Use Familiar tools – Visual Studio• RESTful HTTP cloud services, supports PHP, Python• Cloud apps can be developed locally / offline• SDK Cloud Simulator – Dev Fabric, Dev Storage

Page 14: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 14

• 1 5

Page 16: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 16

Storage

• Blobs – Large Data Store• Queues – Background work processing• Tables – Very Fast / Scalable Storage• Drives – NTFS Formatted Page Blobs • SQL Azure – Relational SQL in the Cloud

Page 17: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 17

If you don’t know SQL – write in your CV «NoSQL» (Joke)

Page 18: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 18

Azure Storage Problems

Page 19: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 19

Mongo DB

Running MongoDb on Microsoft Windows Azure with CloudDrive• http://www.captaincodeman.com/2010/05/24/mongodb-azure-

clouddrive/

Server : _mongoProcess = new Process(@"mongod.exe");_mongoProcess.Start();

Client: var mongo = new Mongo(connectionString);mongo.Connect();var db = mongo.GetDatabase("notes");

Page 20: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 20

Alternative for Azure Queue

• RabbitMQ (erlang)• Service Bus Queues (app fabric)

Page 21: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 21

Building a Task Scheduler in Windows Azure

Page 22: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 22

Scheduling

public class ScheduledItem : TableServiceEntity {

public string Message { get; set; } public DateTime Time { get; set; }

public ScheduledItem(string message, DateTime time) : base(string.Empty, time.Ticks.ToString("d19") + "_" + Guid.NewGuid().ToString())

{ Message = message; Time = time;

}

public ScheduledItem() {}

}

Page 23: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 23

Managing Concurrency

using (var arl = new AutoRenewLease(leaseBlob)){ if (arl.HasLease) { // inside here, this instance has exclusive access var ctx = tables.GetDataServiceContext(); foreach (var item in ctx.CreateQuery<ScheduledItem>("ScheduledItems").Where(s => s.PartitionKey == string.Empty && s.RowKey.CompareTo(DateTime.UtcNow.Ticks.ToString("d19")) <= 0) .AsTableServiceQuery()) { q.AddMessage(new CloudQueueMessage(item.Message));

ctx.DeleteObject(item); ctx.SaveChangesWithRetries(); } }}

Page 24: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 24

Alternative Schedule

• Quartz• BrokeredMessage.ScheduledEnqueueTime

Page 25: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 25

Node.js Applications

1. native Windows Node.js binaries 2. iisnode module

https://github.com/smarx/noderole

Page 26: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 26

Caching

• Windows Azure Caching• memcached

Page 27: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

Windows Azure: technology cocktail 27

Invite

Get a Windows Azure Trial Account Try out a free Windows Azure account for 30 days. • Go http://bit.ly/azure_invite, select "United States" and • Enter promo-code: FBPASS

Page 28: Ciklum net sat12112011-roman bugaev-windows azure technology cocktail

ThX! Q?

Phone: +375 (29) 264-6830 Skype: Bugaev_RomanLinkedin: http://www.linkedin.com/in/rbugaevFacebook: http://www.facebook.com/rbugaev Twitter: @rbugaev