Things to think about while architecting azure solutions

Preview:

Citation preview

Things to think about whilearchitecting 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)

So, What is Software Architecture exactly?

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

Architecture forces

Architecture

Quality Attributes

Technology

Patterns & Anti-patterns

Principles

Community experience

Stakeholders

Architect

people

A “deliverable”

Produce

Key

Is an input

Constraints

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

Dequeue/Delete pattern

The Network is reliable

Dequeue/Delete pattern

The Network is reliable

Still a problem If we crash here

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

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

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

Latency is zero

It might be infinite for all purposes but it costs…

Bandwidth is infinite

Authentication with ACS

Slide by Alik Levin

The Network is Secure

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

Enabling hybrid applicationsDatacenter

LOB web

service

LOB app

Partner

Mobile Device

Enabling hybrid applicationsDatacenter

LOB web

service

LOB app

Partner

Mobile Device

SB

ACS

Enabling hybrid applicationsDatacenter

LOB web

service

LOB app

Partner

Mobile Device

SB

ACS

Enabling hybrid applicationsPartner

Mobile Device

Datacenter

LOB web

service

LOB app

SB

ACS

Enabling hybrid applicationsPartner

Mobile Device

Datacenter

LOB web

service

LOB app

SB

ACS

Electricity Power Grid

Demo

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

Inter-role communications

Reduced Headache on the one handNew challenges on the other

There is one administrator

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

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

Transport cost is zero

Distribution cost in serialization, time on the wire, security

A lot of calls to fulfill a business function

Bring Data close to computation

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

Deployment view

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

production

Cost considerations

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

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$

2 instances can give you better availability

• Need to be on different fault and upgrade domains

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

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

Testing

DEMO CLOUDOSCOPE ACCEPTANCE TESTS

Illustrations

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

Recommended