38
Things to think about while architecting Azure solutions

Things to think about while architecting azure solutions

Embed Size (px)

Citation preview

Page 1: Things to think about while architecting azure solutions

Things to think about whilearchitecting Azure solutions

Page 2: Things to think about while architecting azure solutions

Famous Last Words…

“It is a very humbling experience to make a multimillion-dollar mistake, but it is also very memorable….”

(Fred Brooks - “Mythical Man-Month” p.47)

Page 3: Things to think about while architecting azure solutions

So, What is Software Architecture exactly?

Page 4: Things to think about while architecting azure solutions

Software architecture is the fundamental organization of a system, embodied in its components, their relationships to each other and the environment, and the principles governing its design and evolution

Page 5: Things to think about while architecting azure solutions

Architecture forces

Architecture

Quality Attributes

Technology

Patterns & Anti-patterns

Principles

Community experience

Stakeholders

Architect

people

A “deliverable”

Produce

Key

Is an input

Constraints

Page 6: Things to think about while architecting azure solutions

Fallacies of distributed Computing

The Network is reliable

Latency is zero

Bandwidth is infinite

The Network is Secure

Topology doesn’t change

There is one administrator

Transport cost is zero

The Network is

homogenous

Page 7: Things to think about while architecting azure solutions

Dequeue/Delete pattern

The Network is reliable

Page 8: Things to think about while architecting azure solutions

Dequeue/Delete pattern

The Network is reliable

Still a problem If we crash here

Page 9: Things to think about while architecting azure solutions

Idempotencyf(x) = f(f(x))

Page 10: Things to think about while architecting azure solutions

Messages Process At Least Once

Web Role Worker Role

StorageQueue

LB

LB

Worker RoleWorker Role

Web Role Worker Role

1. Debit bank account $100 message2. Worker role reads message3. Balance debited $1004. Worker role is torn before message can be deleted5. 3 minutes later, message re-appears on queue6. Worker role reads message7. Balance debited $1008. Message deleted from queue9. Chaos ensues.....10. Customer calls bank.....

Balance = $1000Balance = $900Balance = $800

Page 11: Things to think about while architecting azure solutions

Solving the Idempotency Problem

Web Role Worker Role

StorageQueue

LB

LB

Worker RoleWorker Role

Web Role Worker Role

1. Debit bank account $100 message with transaction ID2. Worker role reads message. Checks transaction ID not present.3. Writes transaction ID with state ‘Started’ to ‘Replay Log’4. Balance debited $1005. Worker role is torn before message can be deleted6. 3 minutes later, message re-appears on queue7. Worker role reads message. Checks transaction ID. It is present in

state started.8. Compensating message written to another queue9. Message deleted from queue10. Compensatory message processed.Balance = $1000Balance = $900

Table

QueryQuery

Queue

Page 12: Things to think about while architecting azure solutions

Latency is zero

Page 13: Things to think about while architecting azure solutions

It might be infinite for all purposes but it costs…

Bandwidth is infinite

Page 14: Things to think about while architecting azure solutions

Authentication with ACS

Slide by Alik Levin

The Network is Secure

Page 15: Things to think about while architecting azure solutions

Service Bus• Provides secure messaging and connectivity across

different network topologies• Enables hybrid applications that span on-premises and

the cloud• Enables various communication protocols and patterns

for developers to engage in reliable messaging

Topology doesn’t change

Page 16: Things to think about while architecting azure solutions

Enabling hybrid applicationsDatacenter

LOB web

service

LOB app

Partner

Mobile Device

Page 17: Things to think about while architecting azure solutions

Enabling hybrid applicationsDatacenter

LOB web

service

LOB app

Partner

Mobile Device

SB

ACS

Page 18: Things to think about while architecting azure solutions

Enabling hybrid applicationsDatacenter

LOB web

service

LOB app

Partner

Mobile Device

SB

ACS

Page 19: Things to think about while architecting azure solutions

Enabling hybrid applicationsPartner

Mobile Device

Datacenter

LOB web

service

LOB app

SB

ACS

Page 20: Things to think about while architecting azure solutions

Enabling hybrid applicationsPartner

Mobile Device

Datacenter

LOB web

service

LOB app

SB

ACS

Page 21: Things to think about while architecting azure solutions

Electricity Power Grid

Demo

Page 22: Things to think about while architecting azure solutions

Don’t assume specific instances

Service Instance

NLB Driver

Worker Role

TCP/IP

Windows Kernel

Virtual NIC

Worker Role

TCP/IP

Windows Kernel

Virtual NIC

Virtual IP : 1.1.1.1

Virtual IP : 1.1.1.2Virtual IP : 1.1.1.3

Service InstanceIIS

Web Role

NIC Driver

TCP/IP

Windows Kernel

Virtual NIC

Virtual IP : 1.1.1.4

NIC Driver

TCP/IP

NIC Driver

TCP/IP

Page 23: Things to think about while architecting azure solutions

Inter-role communications

Page 24: Things to think about while architecting azure solutions

Reduced Headache on the one handNew challenges on the other

There is one administrator

Page 25: Things to think about while architecting azure solutions

Azure MMC Snap-in http://code.msdn.microsoft.com/windowsazuremmc

Page 26: Things to think about while architecting azure solutions

Cerebrata – Azure Diagnostics Managerhttp://www.cerebrata.com/Products/AzureDiagnosticsManager/Default.aspx

Page 27: Things to think about while architecting azure solutions

Transport cost is zero

Distribution cost in serialization, time on the wire, security

Page 28: Things to think about while architecting azure solutions

A lot of calls to fulfill a business function

Page 29: Things to think about while architecting azure solutions

Bring Data close to computation

Page 30: Things to think about while architecting azure solutions

It isn’t – but it’s abstractedunless of course you use Azure connect

The Network is

homogenous

Quickly connect on-premise computers with the cloud, no networking configuration required

Supports standard IP protocols; secured using end-to-end IPSec

Integrated with the Windows Azure Service Model; all role types supported

Page 31: Things to think about while architecting azure solutions

Deployment view

• Consider xsmall instances for development• Test if you can use less than medium for

production

Page 32: Things to think about while architecting azure solutions

Cost considerations

• You pay when you’re deployed (there is no “shelving”)– Shutdown doesn’t help– (keep CPUs running..)

Page 33: Things to think about while architecting azure solutions

2 Small instances cost the same as 1 medium instance

Compute Instance Size CPU Memory Instance Storage Cost per hour

Extra Small 1 GHz 768 MB 20 GB 0.05$

Small 1.6 GHz 1.75 GB 225 GB 0.12$

Medium 2 x 1.6 GHz 3.5 GB 490 GB 0.24$

Large 4 x 1.6 GHz 7 GB 1,000 GB 0.48$

Extra large 8 x 1.6 GHz 14 GB 2,040 GB 0.96$

Page 34: Things to think about while architecting azure solutions

2 instances can give you better availability

• Need to be on different fault and upgrade domains

Page 35: Things to think about while architecting azure solutions

I/O performance on smaller instances might be problematic

Compute Instance Size CPU Memory Instance Storage I/O Performance

Extra Small 1 GHz 768 MB 20 GB Low

Small 1.6 GHz 1.75 GB 225 GB Moderate

Medium 2 x 1.6 GHz 3.5 GB 490 GB High

Large 4 x 1.6 GHz 7 GB 1,000 GB High

Extra large 8 x 1.6 GHz 14 GB 2,040 GB High

Page 36: Things to think about while architecting azure solutions

You can control Azure from scripts and code (even dev fabric)

Testing

Page 37: Things to think about while architecting azure solutions

DEMO CLOUDOSCOPE ACCEPTANCE TESTS

Page 38: Things to think about while architecting azure solutions

Illustrations

• Slide 11 http://www.sxc.hu/photo/1201443• Slide http://www.sxc.hu/photo/1160486