SlideShare a Scribd company logo
1 of 58
NServiceBus 
On Azure
Yves Goeleven 
Founder of MessageHandler.net 
• Developer on NServiceBus 
• Windows Azure MVP 
• @YvesGoeleven
Agenda 
NServiceBus on Azure 
• Tour d’Azure 
• Hosting options 
• Transports 
• Persistence 
• Tips & tricks || Q&A
Tour d’Azure
Why people are interested in Azure? 
Various reasons 
• Automated, 
• Scalability (scale out) 
• Elasticity (scale in again) 
• Cost 
• Globally available
NServiceBus & Azure: Perfect match 
All this goodness comes at a cost though 
• Serious learning curve 
• Different development paradigm 
• Need to understand infrastructure 
• NServiceBus helps reduce that learning curve, 
• makes it easy to develop for Azure
What is Azure? 
Global network of huge data centers operated by Microsoft
Some numbers 
Just to illustrate how huge it is 
• 13 regions 
• 321 IP ranges 
• 250.000+ customers 
• 2.000.000+ VM’s 
• 25+ trillion objects stored
200 services 
running on top
Implications 
Of such a huge network 
• Latency is normal 
• Machine failure is normal 
• Network partitioning is normal 
• No distributed transactions!
Implications 
Of ‘as a service’ model 
• Microsoft doesn’t trust you! 
• Individual resources are limited 
• Throttling 
• Your resources are moved around 
• Unpredictable resource performance 
• Transient errors 
• No locks or very short locks 
• No local transactions! 
• 1 exception: Sql as it is build into the protocol
How to deal with it 
NServiceBus helps a lot, but you need to code to it as well 
• Retry, retry, retry! 
• Pick a transport that retries instead of relying on transactions 
• Enable First Level Retry 
• Enable Second Level Retry
How to deal with it 
NServiceBus helps a lot, but you need to code to it as well 
• Take care of idempotency 
• Atomic messagehandler implementations 
• Saga’s too! Update saga state & nothing else! 
• Use saga’s to coordinate compensation logic 
• Check for retries 
• Check side effects 
See, http://docs.particular.net/nservicebus/understanding-transactions-in-windows-azure for more options
How to deal with it 
Do not trust your disk! 
• Do not put anything on disk! 
• The machine will fail, the disk will be gone! 
• Anyone noticed there is no SLA for individual VM’s? 
• Put your stuff in storage 
• 99.99% SLA 
• Local Redundant & Geo Redunant
Hosting options
3 hosting options 
Same underlying infrastructure, built on top of each other
Cloud services
Cloud services 
Many identical vm’s managed by azure 
• Stateless 
• Based on a template (role) 
• Includes agents 
• Health reporting 
• Diagnostics collection 
• Runtime & configuration environment
Server Rack 1 Server Rack 2
Cloud services 
Specific NServiceBus host 
• Make use of agents present on the vm 
• Runtime & configuration environment 
• Diagnostics 
• Found in NServiceBus.Hosting.Azure
Cloud services 
Use NServiceBusRoleEntrypoint 
• Just call start & stop 
public class WorkerRole : RoleEntryPoint 
{ 
private readonly NServiceBusRoleEntrypoint nsb = new NServiceBusRoleEntrypoint(); 
public override bool OnStart() { 
nsb.Start(); 
return base.OnStart(); 
} 
public override void OnStop() { 
nsb.Stop(); 
base.OnStop(); 
} 
}
Cloud services 
And Configure your endpoint as a worker 
• AsA_Worker: Specific profile, similar to AsA_Publisher on-premises but different defaults 
public class EndpointConfig : IConfigureThisEndpoint, AsA_Worker, UsingTransport<AzureServiceBus> 
{ 
} 
• Configured for local emulator by default 
• Don’t forget to change config settings before deploying to azure itself
Cloud services 
Is designed for massive scale, what if you don’t need that 
• AsA_Host: Specific profile for colocation 
public class EndpointConfig : IConfigureThisEndpoint, AsA_Host 
{ 
} 
• Reference nservicebus.hosting.azure.hostprocess from your AsA_Worker endpoint 
• Zip your endpoint & put in blob storage container 
• AsA_Host endpoint will 
• Download them on startup 
• Run them 
• Manage them (including updates)
Virtual Machines
Virtual Machines 
Just like regular VM’s, except 
• Built on cloud services, yet single VM 
• No SLA unless you run multiple (stateless) copies 
• You manage the os 
• You are responsible for failover & backups! 
• Disk persisted remotely 
• In azure storage services 
• No local write cache by default, subject to throttling 
• Impacts IOPS 
• May loose local data during geo disaster 
• 1 minute local replication (lease held by original node) 
• 5 minute geo-replication SLA 
• Happened 3 times in past 5 years, no data loss yet
Virtual Machines 
Regular NServiceBus host can be used, but 
• Do not setup DTC 
• Do not rely on transports that rely on DTC 
• no msmq 
• If you use other transports that rely on local disk 
• Make sure they are configured for failover or clustered 
• Do not rely on persistance that rely on DTC 
• share connection to prevent auto promotion 
• If you use persistence that relies on local disk 
• Make sure it’s configured for failover or clustered
Websites
Websites 
Shared website hosting 
• IIS as a service 
• With Continuous Integration built in 
• Deploy straight from github/bitbucket/tfs/... 
• You only controle your code 
• Nothing else
Websites 
NServiceBus self hosting can be used 
• Only public remote transports can be used 
• Only public remote persistance can be used 
• Remote: No option to install on the machine 
• Public: No option to setup virtual networking with cloudservices or virtual machines
Transports
Best transports 
Because they retry and are built for failover
Optional transports 
If you manage it correctly (Failover, clustering, sharding, etc…)
Azure Storage Queues 
Queue construct in Azure Storage Services 
• Highly reliable 
• Very cheap 
• 200TB/500TB capacity limit 
• HTTP(S) based 
• Queue Peek Lock for retries 
• Max 7 days TTL!
Azure Storage Queues 
Configure NServiceBus to use azure storage queues 
• Found in NServiceBus.Azure.Transports.WindowsAzureStorageQueues 
public class EndpointConfig : IConfigureThisEndpoint, AsA_Worker, UsingTransport<AzureStorageQueues> 
{ 
} 
• Connection string 
DefaultEndpointsProtocol=https;AccountName=myAccount;AccountKey=myKey; 
• Detailed configuration 
http://docs.particular.net/nservicebus/using-azure-storage-queues-as-transport-in-nservicebus
Azure ServiceBus 
Broker service in azure 
• Reliable 
• Supports queues, topics & subscriptions 
• 5GB capacity limit 
• No limit on TTL 
• TCP based, lower latency 
• Queue Peek Lock for retries 
• Emulates local transactions 
• Loads of additional features 
• Dedupe, sessions, partitioning, ... 
• Relatively expensive
Azure ServiceBus 
Configure NServiceBus to use azure servicebus 
• Found in NServiceBus.Azure.Transports.WindowsAzureServiceBus 
public class EndpointConfig : IConfigureThisEndpoint, AsA_Worker, UsingTransport<AzureServiceBus> 
{ 
} 
• Connection string 
Endpoint=sb://{yournamespace}.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue={yourkey} 
• Detailed configuration 
http://docs.particular.net/nservicebus/using-azure-servicebus-as-transport-in-nservicebus
Azure ServiceBus 
Additional features & applicability 
• Applicable 
• Duplicate detection: time window 
• Partitioning: Bundle of queues/topics 
• Message ordering 
• Deadlettering 
• Batched operations 
• Not applicable: 
• Sessions: instance affinity for message set, used for large messages, use databus instead
Persistence
Best persistence 
Because it is built for failover
Optional persistence 
If you manage it correctly (Failover, clustering, sharding, etc…)
Azure Storage 
Found in NServiceBus.Azure 
• Uses Azure Table Storage & Azure Blob Storage 
• Supports Subscriptions, Saga’s, Timeouts & Databus 
public class EnableStorage : INeedInitialization 
{ 
public void Init() 
{ 
Configure.Instance 
.AzureSubscriptionStorage() 
.AzureSagaPersister() 
.UseAzureTimeoutPersister() 
.AzureDatabus(); 
} 
} 
• Configured for local emulator by default, detailed configuration; 
http://docs.particular.net/nservicebus/using-azure-servicebus-as-transport-in-nservicebus
Tips & tricks || Q&A
Tips & tricks 
Lessons learned the hard way 
• Do not develop with the emulator (Compute nor storage) 
• Slow & behaves differently 
• Use nservicebus.hosting.azure.hostprocess for your workers 
• Use IISExpress for your websites 
• Use azure storage or azure servicebus online
Tips & tricks 
Lessons learned the hard way 
• Deploy asap 
• Your machine != huge cloud 
• Test as if ‘in production’
Tips & tricks 
Lessons learned the hard way 
• Tune the machine for lot’s of small requests 
System.Net.ServicePointManager.DefaultConnectionLimit = 5000; 
System.Net.ServicePointManager.UseNagleAlgorithm = false; 
System.Net.ServicePointManager.Expect100Continue = false;
Tips & tricks 
Lessons learned the hard way 
• Intellitrace is your best friend for remote debugging
Tips & tricks 
Lessons learned the hard way 
• Log file shipping instead of default trace logs 
• Ship eventlog & log files via diagnostics service 
• Configured in .wadcfg file 
• Trace logs in table storage is to unfriendly
Wrapup
Resources 
Want to know more? 
• Overview: http://docs.particular.net/nservicebus/windows-azure-transport 
• Hosting: http://docs.particular.net/nservicebus/hosting-nservicebus-in-windows-azure 
• Cloud services: http://docs.particular.net/nservicebus/hosting-nservicebus-in-windows-azure-cloud-services 
• Shared host: http://docs.particular.net/nservicebus/shared-hosting-nservicebus-in-windows-azure-cloud-services 
• Azure servicebus: http://docs.particular.net/nservicebus/using-azure-servicebus-as-transport-in-nservicebus 
• Azure storage queues: http://docs.particular.net/nservicebus/using-azure-storage-queues-as-transport-in-nservicebus 
• Storage persistence: http://docs.particular.net/nservicebus/using-azure-storage-persistence-in-nservicebus 
• Transactions: http://docs.particular.net/nservicebus/understanding-transactions-in-windows-azure
Resources 
Or get your hands dirty? 
• Samples: https://github.com/particular/nservicebus.azure.samples
Thanks

More Related Content

What's hot

Container Orchestration with Amazon ECS
Container Orchestration with Amazon ECSContainer Orchestration with Amazon ECS
Container Orchestration with Amazon ECSAmazon Web Services
 
A brief introduction to CloudFormation
A brief introduction to CloudFormationA brief introduction to CloudFormation
A brief introduction to CloudFormationSWIFTotter Solutions
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraFormWesley Charles Blake
 
Hosting Drupal on Amazon EC2
Hosting Drupal on Amazon EC2Hosting Drupal on Amazon EC2
Hosting Drupal on Amazon EC2Kornel Lugosi
 
Boris Stoyanov - some new features in Apache cloudStack
Boris Stoyanov - some new features in Apache cloudStackBoris Stoyanov - some new features in Apache cloudStack
Boris Stoyanov - some new features in Apache cloudStackShapeBlue
 
Cloud Computing: AWS for Lean Startups
Cloud Computing: AWS for Lean StartupsCloud Computing: AWS for Lean Startups
Cloud Computing: AWS for Lean StartupsZvi Avraham
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon Web Services
 
ILM - Pipeline in the cloud
ILM - Pipeline in the cloudILM - Pipeline in the cloud
ILM - Pipeline in the cloudAaron Carey
 
Migratory Workloads Across Clouds with Nomad
Migratory Workloads Across Clouds with NomadMigratory Workloads Across Clouds with Nomad
Migratory Workloads Across Clouds with NomadPhilip Watts
 
Scaling Up and Out your Virtualized SQL Servers
Scaling Up and Out your Virtualized SQL ServersScaling Up and Out your Virtualized SQL Servers
Scaling Up and Out your Virtualized SQL Serversheraflux
 
Elastic HBase on Mesos - HBaseCon 2015
Elastic HBase on Mesos - HBaseCon 2015Elastic HBase on Mesos - HBaseCon 2015
Elastic HBase on Mesos - HBaseCon 2015Cosmin Lehene
 
Cassandra Core Concepts - Cassandra Day Toronto
Cassandra Core Concepts - Cassandra Day TorontoCassandra Core Concepts - Cassandra Day Toronto
Cassandra Core Concepts - Cassandra Day TorontoJon Haddad
 
Hindsight is 20/20: MySQL to Cassandra
Hindsight is 20/20: MySQL to CassandraHindsight is 20/20: MySQL to Cassandra
Hindsight is 20/20: MySQL to CassandraMichael Kjellman
 
Leveraging MongoDB: An Introductory Case Study
Leveraging MongoDB: An Introductory Case StudyLeveraging MongoDB: An Introductory Case Study
Leveraging MongoDB: An Introductory Case StudySean Laurent
 
How Shit Works: Storage
How Shit Works: StorageHow Shit Works: Storage
How Shit Works: StorageTomer Gabel
 
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014Amazon Web Services
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows AzureRadu Vunvulea
 

What's hot (20)

Container Orchestration with Amazon ECS
Container Orchestration with Amazon ECSContainer Orchestration with Amazon ECS
Container Orchestration with Amazon ECS
 
A brief introduction to CloudFormation
A brief introduction to CloudFormationA brief introduction to CloudFormation
A brief introduction to CloudFormation
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraForm
 
IP Multicast on ec2
IP Multicast on ec2IP Multicast on ec2
IP Multicast on ec2
 
Hosting Drupal on Amazon EC2
Hosting Drupal on Amazon EC2Hosting Drupal on Amazon EC2
Hosting Drupal on Amazon EC2
 
Boris Stoyanov - some new features in Apache cloudStack
Boris Stoyanov - some new features in Apache cloudStackBoris Stoyanov - some new features in Apache cloudStack
Boris Stoyanov - some new features in Apache cloudStack
 
Cloud Computing: AWS for Lean Startups
Cloud Computing: AWS for Lean StartupsCloud Computing: AWS for Lean Startups
Cloud Computing: AWS for Lean Startups
 
Performance out
Performance outPerformance out
Performance out
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
 
London Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in ProductionLondon Hug 19/5 - Terraform in Production
London Hug 19/5 - Terraform in Production
 
ILM - Pipeline in the cloud
ILM - Pipeline in the cloudILM - Pipeline in the cloud
ILM - Pipeline in the cloud
 
Migratory Workloads Across Clouds with Nomad
Migratory Workloads Across Clouds with NomadMigratory Workloads Across Clouds with Nomad
Migratory Workloads Across Clouds with Nomad
 
Scaling Up and Out your Virtualized SQL Servers
Scaling Up and Out your Virtualized SQL ServersScaling Up and Out your Virtualized SQL Servers
Scaling Up and Out your Virtualized SQL Servers
 
Elastic HBase on Mesos - HBaseCon 2015
Elastic HBase on Mesos - HBaseCon 2015Elastic HBase on Mesos - HBaseCon 2015
Elastic HBase on Mesos - HBaseCon 2015
 
Cassandra Core Concepts - Cassandra Day Toronto
Cassandra Core Concepts - Cassandra Day TorontoCassandra Core Concepts - Cassandra Day Toronto
Cassandra Core Concepts - Cassandra Day Toronto
 
Hindsight is 20/20: MySQL to Cassandra
Hindsight is 20/20: MySQL to CassandraHindsight is 20/20: MySQL to Cassandra
Hindsight is 20/20: MySQL to Cassandra
 
Leveraging MongoDB: An Introductory Case Study
Leveraging MongoDB: An Introductory Case StudyLeveraging MongoDB: An Introductory Case Study
Leveraging MongoDB: An Introductory Case Study
 
How Shit Works: Storage
How Shit Works: StorageHow Shit Works: Storage
How Shit Works: Storage
 
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows Azure
 

Similar to NSBCon UK nservicebus on Azure by Yves Goeleven

Running Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows AzureRunning Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows AzureSimon Evans
 
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...ShapeBlue
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)Michael Collier
 
Cloud Messaging with NServiceBus and Microsoft Azure
Cloud Messaging with NServiceBus and Microsoft AzureCloud Messaging with NServiceBus and Microsoft Azure
Cloud Messaging with NServiceBus and Microsoft AzureParticular Software
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702Jess Coburn
 
Powering Remote Developers with Amazon Workspaces
Powering Remote Developers with Amazon WorkspacesPowering Remote Developers with Amazon Workspaces
Powering Remote Developers with Amazon WorkspacesAmazon Web Services
 
Cloud-Native DevOps: Simplifying application lifecycle management with AWS | ...
Cloud-Native DevOps: Simplifying application lifecycle management with AWS | ...Cloud-Native DevOps: Simplifying application lifecycle management with AWS | ...
Cloud-Native DevOps: Simplifying application lifecycle management with AWS | ...Amazon Web Services
 
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless DreamsRainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless DreamsJosh Carlisle
 
Cloudstack for beginners
Cloudstack for beginnersCloudstack for beginners
Cloudstack for beginnersJoseph Amirani
 
Nuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloudNuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloudDavid Veksler
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…Sergey Dzyuban
 
London Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben Coughlan
London Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben CoughlanLondon Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben Coughlan
London Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben CoughlanBen Coughlan
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldJignesh Shah
 
More Cache for Less Cash
More Cache for Less CashMore Cache for Less Cash
More Cache for Less CashMichael Collier
 
Massive Lift & Shift Migrations to Microsoft Azure with the Microsoft Migrati...
Massive Lift & Shift Migrations to Microsoft Azure with the Microsoft Migrati...Massive Lift & Shift Migrations to Microsoft Azure with the Microsoft Migrati...
Massive Lift & Shift Migrations to Microsoft Azure with the Microsoft Migrati...Morgan Simonsen
 
Building Real World Application with Azure
Building Real World Application with AzureBuilding Real World Application with Azure
Building Real World Application with Azuredivyapisces
 

Similar to NSBCon UK nservicebus on Azure by Yves Goeleven (20)

Running Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows AzureRunning Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows Azure
 
Running Galera Cluster on Microsoft Azure
Running Galera Cluster on Microsoft AzureRunning Galera Cluster on Microsoft Azure
Running Galera Cluster on Microsoft Azure
 
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
 
IaaS azure_vs_amazon
IaaS azure_vs_amazonIaaS azure_vs_amazon
IaaS azure_vs_amazon
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)
 
Cloud Messaging with NServiceBus and Microsoft Azure
Cloud Messaging with NServiceBus and Microsoft AzureCloud Messaging with NServiceBus and Microsoft Azure
Cloud Messaging with NServiceBus and Microsoft Azure
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702
 
Hosting Ruby Web Apps
Hosting Ruby Web AppsHosting Ruby Web Apps
Hosting Ruby Web Apps
 
Powering Remote Developers with Amazon Workspaces
Powering Remote Developers with Amazon WorkspacesPowering Remote Developers with Amazon Workspaces
Powering Remote Developers with Amazon Workspaces
 
Global Windows Azure Bootcamp - San Diego
Global Windows Azure Bootcamp - San DiegoGlobal Windows Azure Bootcamp - San Diego
Global Windows Azure Bootcamp - San Diego
 
Cloud-Native DevOps: Simplifying application lifecycle management with AWS | ...
Cloud-Native DevOps: Simplifying application lifecycle management with AWS | ...Cloud-Native DevOps: Simplifying application lifecycle management with AWS | ...
Cloud-Native DevOps: Simplifying application lifecycle management with AWS | ...
 
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless DreamsRainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
 
Cloudstack for beginners
Cloudstack for beginnersCloudstack for beginners
Cloudstack for beginners
 
Nuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloudNuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloud
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…
 
London Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben Coughlan
London Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben CoughlanLondon Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben Coughlan
London Hashicorp Meetup #22 - Congruent infrastructure @zopa by Ben Coughlan
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
 
More Cache for Less Cash
More Cache for Less CashMore Cache for Less Cash
More Cache for Less Cash
 
Massive Lift & Shift Migrations to Microsoft Azure with the Microsoft Migrati...
Massive Lift & Shift Migrations to Microsoft Azure with the Microsoft Migrati...Massive Lift & Shift Migrations to Microsoft Azure with the Microsoft Migrati...
Massive Lift & Shift Migrations to Microsoft Azure with the Microsoft Migrati...
 
Building Real World Application with Azure
Building Real World Application with AzureBuilding Real World Application with Azure
Building Real World Application with Azure
 

More from Particular Software

Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBusScaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBusParticular Software
 
Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code Particular Software
 
An exception occurred - Please try again
An exception occurred - Please try againAn exception occurred - Please try again
An exception occurred - Please try againParticular Software
 
Tales from the trenches creating complex distributed systems
Tales from the trenches  creating complex distributed systemsTales from the trenches  creating complex distributed systems
Tales from the trenches creating complex distributed systemsParticular Software
 
Implementing outbox model-checking first
Implementing outbox   model-checking firstImplementing outbox   model-checking first
Implementing outbox model-checking firstParticular Software
 
Reports from the field azure functions in practice
Reports from the field   azure functions in practiceReports from the field   azure functions in practice
Reports from the field azure functions in practiceParticular Software
 
Finding your service boundaries - a practical guide
Finding your service boundaries - a practical guideFinding your service boundaries - a practical guide
Finding your service boundaries - a practical guideParticular Software
 
Decomposing .NET Monoliths with NServiceBus and Docker
Decomposing .NET Monoliths with NServiceBus and DockerDecomposing .NET Monoliths with NServiceBus and Docker
Decomposing .NET Monoliths with NServiceBus and DockerParticular Software
 
DIY Async Message Pump: Lessons from the trenches
DIY Async Message Pump: Lessons from the trenchesDIY Async Message Pump: Lessons from the trenches
DIY Async Message Pump: Lessons from the trenchesParticular Software
 
Share the insight of ServiceInsight
Share the insight of ServiceInsightShare the insight of ServiceInsight
Share the insight of ServiceInsightParticular Software
 
What to consider when monitoring microservices
What to consider when monitoring microservicesWhat to consider when monitoring microservices
What to consider when monitoring microservicesParticular Software
 
Making communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBusMaking communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBusParticular Software
 
Making communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusMaking communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusParticular Software
 
How to avoid microservice pitfalls
How to avoid microservice pitfallsHow to avoid microservice pitfalls
How to avoid microservice pitfallsParticular Software
 
Connect front end to back end using SignalR and Messaging
Connect front end to back end using SignalR and MessagingConnect front end to back end using SignalR and Messaging
Connect front end to back end using SignalR and MessagingParticular Software
 
Async/Await: NServiceBus v6 API Update
Async/Await: NServiceBus v6 API UpdateAsync/Await: NServiceBus v6 API Update
Async/Await: NServiceBus v6 API UpdateParticular Software
 
Async/Await: TPL & Message Pumps
Async/Await: TPL & Message Pumps Async/Await: TPL & Message Pumps
Async/Await: TPL & Message Pumps Particular Software
 
Making workflow implementation easy with CQRS
Making workflow implementation easy with CQRSMaking workflow implementation easy with CQRS
Making workflow implementation easy with CQRSParticular Software
 

More from Particular Software (20)

Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBusScaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
 
Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code
 
An exception occurred - Please try again
An exception occurred - Please try againAn exception occurred - Please try again
An exception occurred - Please try again
 
Tales from the trenches creating complex distributed systems
Tales from the trenches  creating complex distributed systemsTales from the trenches  creating complex distributed systems
Tales from the trenches creating complex distributed systems
 
Got the time?
Got the time?Got the time?
Got the time?
 
Implementing outbox model-checking first
Implementing outbox   model-checking firstImplementing outbox   model-checking first
Implementing outbox model-checking first
 
Reports from the field azure functions in practice
Reports from the field   azure functions in practiceReports from the field   azure functions in practice
Reports from the field azure functions in practice
 
Finding your service boundaries - a practical guide
Finding your service boundaries - a practical guideFinding your service boundaries - a practical guide
Finding your service boundaries - a practical guide
 
Decomposing .NET Monoliths with NServiceBus and Docker
Decomposing .NET Monoliths with NServiceBus and DockerDecomposing .NET Monoliths with NServiceBus and Docker
Decomposing .NET Monoliths with NServiceBus and Docker
 
DIY Async Message Pump: Lessons from the trenches
DIY Async Message Pump: Lessons from the trenchesDIY Async Message Pump: Lessons from the trenches
DIY Async Message Pump: Lessons from the trenches
 
Share the insight of ServiceInsight
Share the insight of ServiceInsightShare the insight of ServiceInsight
Share the insight of ServiceInsight
 
What to consider when monitoring microservices
What to consider when monitoring microservicesWhat to consider when monitoring microservices
What to consider when monitoring microservices
 
Making communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBusMaking communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBus
 
Making communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusMaking communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service Bus
 
How to avoid microservice pitfalls
How to avoid microservice pitfallsHow to avoid microservice pitfalls
How to avoid microservice pitfalls
 
Connect front end to back end using SignalR and Messaging
Connect front end to back end using SignalR and MessagingConnect front end to back end using SignalR and Messaging
Connect front end to back end using SignalR and Messaging
 
Async/Await: NServiceBus v6 API Update
Async/Await: NServiceBus v6 API UpdateAsync/Await: NServiceBus v6 API Update
Async/Await: NServiceBus v6 API Update
 
Async/Await: TPL & Message Pumps
Async/Await: TPL & Message Pumps Async/Await: TPL & Message Pumps
Async/Await: TPL & Message Pumps
 
Async/Await Best Practices
Async/Await Best PracticesAsync/Await Best Practices
Async/Await Best Practices
 
Making workflow implementation easy with CQRS
Making workflow implementation easy with CQRSMaking workflow implementation easy with CQRS
Making workflow implementation easy with CQRS
 

Recently uploaded

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

NSBCon UK nservicebus on Azure by Yves Goeleven

  • 2. Yves Goeleven Founder of MessageHandler.net • Developer on NServiceBus • Windows Azure MVP • @YvesGoeleven
  • 3. Agenda NServiceBus on Azure • Tour d’Azure • Hosting options • Transports • Persistence • Tips & tricks || Q&A
  • 5. Why people are interested in Azure? Various reasons • Automated, • Scalability (scale out) • Elasticity (scale in again) • Cost • Globally available
  • 6. NServiceBus & Azure: Perfect match All this goodness comes at a cost though • Serious learning curve • Different development paradigm • Need to understand infrastructure • NServiceBus helps reduce that learning curve, • makes it easy to develop for Azure
  • 7. What is Azure? Global network of huge data centers operated by Microsoft
  • 8.
  • 9.
  • 10. Some numbers Just to illustrate how huge it is • 13 regions • 321 IP ranges • 250.000+ customers • 2.000.000+ VM’s • 25+ trillion objects stored
  • 12. Implications Of such a huge network • Latency is normal • Machine failure is normal • Network partitioning is normal • No distributed transactions!
  • 13. Implications Of ‘as a service’ model • Microsoft doesn’t trust you! • Individual resources are limited • Throttling • Your resources are moved around • Unpredictable resource performance • Transient errors • No locks or very short locks • No local transactions! • 1 exception: Sql as it is build into the protocol
  • 14. How to deal with it NServiceBus helps a lot, but you need to code to it as well • Retry, retry, retry! • Pick a transport that retries instead of relying on transactions • Enable First Level Retry • Enable Second Level Retry
  • 15. How to deal with it NServiceBus helps a lot, but you need to code to it as well • Take care of idempotency • Atomic messagehandler implementations • Saga’s too! Update saga state & nothing else! • Use saga’s to coordinate compensation logic • Check for retries • Check side effects See, http://docs.particular.net/nservicebus/understanding-transactions-in-windows-azure for more options
  • 16. How to deal with it Do not trust your disk! • Do not put anything on disk! • The machine will fail, the disk will be gone! • Anyone noticed there is no SLA for individual VM’s? • Put your stuff in storage • 99.99% SLA • Local Redundant & Geo Redunant
  • 18. 3 hosting options Same underlying infrastructure, built on top of each other
  • 20. Cloud services Many identical vm’s managed by azure • Stateless • Based on a template (role) • Includes agents • Health reporting • Diagnostics collection • Runtime & configuration environment
  • 21.
  • 22. Server Rack 1 Server Rack 2
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Cloud services Specific NServiceBus host • Make use of agents present on the vm • Runtime & configuration environment • Diagnostics • Found in NServiceBus.Hosting.Azure
  • 28. Cloud services Use NServiceBusRoleEntrypoint • Just call start & stop public class WorkerRole : RoleEntryPoint { private readonly NServiceBusRoleEntrypoint nsb = new NServiceBusRoleEntrypoint(); public override bool OnStart() { nsb.Start(); return base.OnStart(); } public override void OnStop() { nsb.Stop(); base.OnStop(); } }
  • 29. Cloud services And Configure your endpoint as a worker • AsA_Worker: Specific profile, similar to AsA_Publisher on-premises but different defaults public class EndpointConfig : IConfigureThisEndpoint, AsA_Worker, UsingTransport<AzureServiceBus> { } • Configured for local emulator by default • Don’t forget to change config settings before deploying to azure itself
  • 30. Cloud services Is designed for massive scale, what if you don’t need that • AsA_Host: Specific profile for colocation public class EndpointConfig : IConfigureThisEndpoint, AsA_Host { } • Reference nservicebus.hosting.azure.hostprocess from your AsA_Worker endpoint • Zip your endpoint & put in blob storage container • AsA_Host endpoint will • Download them on startup • Run them • Manage them (including updates)
  • 32. Virtual Machines Just like regular VM’s, except • Built on cloud services, yet single VM • No SLA unless you run multiple (stateless) copies • You manage the os • You are responsible for failover & backups! • Disk persisted remotely • In azure storage services • No local write cache by default, subject to throttling • Impacts IOPS • May loose local data during geo disaster • 1 minute local replication (lease held by original node) • 5 minute geo-replication SLA • Happened 3 times in past 5 years, no data loss yet
  • 33. Virtual Machines Regular NServiceBus host can be used, but • Do not setup DTC • Do not rely on transports that rely on DTC • no msmq • If you use other transports that rely on local disk • Make sure they are configured for failover or clustered • Do not rely on persistance that rely on DTC • share connection to prevent auto promotion • If you use persistence that relies on local disk • Make sure it’s configured for failover or clustered
  • 35. Websites Shared website hosting • IIS as a service • With Continuous Integration built in • Deploy straight from github/bitbucket/tfs/... • You only controle your code • Nothing else
  • 36. Websites NServiceBus self hosting can be used • Only public remote transports can be used • Only public remote persistance can be used • Remote: No option to install on the machine • Public: No option to setup virtual networking with cloudservices or virtual machines
  • 38. Best transports Because they retry and are built for failover
  • 39. Optional transports If you manage it correctly (Failover, clustering, sharding, etc…)
  • 40. Azure Storage Queues Queue construct in Azure Storage Services • Highly reliable • Very cheap • 200TB/500TB capacity limit • HTTP(S) based • Queue Peek Lock for retries • Max 7 days TTL!
  • 41. Azure Storage Queues Configure NServiceBus to use azure storage queues • Found in NServiceBus.Azure.Transports.WindowsAzureStorageQueues public class EndpointConfig : IConfigureThisEndpoint, AsA_Worker, UsingTransport<AzureStorageQueues> { } • Connection string DefaultEndpointsProtocol=https;AccountName=myAccount;AccountKey=myKey; • Detailed configuration http://docs.particular.net/nservicebus/using-azure-storage-queues-as-transport-in-nservicebus
  • 42. Azure ServiceBus Broker service in azure • Reliable • Supports queues, topics & subscriptions • 5GB capacity limit • No limit on TTL • TCP based, lower latency • Queue Peek Lock for retries • Emulates local transactions • Loads of additional features • Dedupe, sessions, partitioning, ... • Relatively expensive
  • 43. Azure ServiceBus Configure NServiceBus to use azure servicebus • Found in NServiceBus.Azure.Transports.WindowsAzureServiceBus public class EndpointConfig : IConfigureThisEndpoint, AsA_Worker, UsingTransport<AzureServiceBus> { } • Connection string Endpoint=sb://{yournamespace}.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue={yourkey} • Detailed configuration http://docs.particular.net/nservicebus/using-azure-servicebus-as-transport-in-nservicebus
  • 44. Azure ServiceBus Additional features & applicability • Applicable • Duplicate detection: time window • Partitioning: Bundle of queues/topics • Message ordering • Deadlettering • Batched operations • Not applicable: • Sessions: instance affinity for message set, used for large messages, use databus instead
  • 46. Best persistence Because it is built for failover
  • 47. Optional persistence If you manage it correctly (Failover, clustering, sharding, etc…)
  • 48. Azure Storage Found in NServiceBus.Azure • Uses Azure Table Storage & Azure Blob Storage • Supports Subscriptions, Saga’s, Timeouts & Databus public class EnableStorage : INeedInitialization { public void Init() { Configure.Instance .AzureSubscriptionStorage() .AzureSagaPersister() .UseAzureTimeoutPersister() .AzureDatabus(); } } • Configured for local emulator by default, detailed configuration; http://docs.particular.net/nservicebus/using-azure-servicebus-as-transport-in-nservicebus
  • 49. Tips & tricks || Q&A
  • 50. Tips & tricks Lessons learned the hard way • Do not develop with the emulator (Compute nor storage) • Slow & behaves differently • Use nservicebus.hosting.azure.hostprocess for your workers • Use IISExpress for your websites • Use azure storage or azure servicebus online
  • 51. Tips & tricks Lessons learned the hard way • Deploy asap • Your machine != huge cloud • Test as if ‘in production’
  • 52. Tips & tricks Lessons learned the hard way • Tune the machine for lot’s of small requests System.Net.ServicePointManager.DefaultConnectionLimit = 5000; System.Net.ServicePointManager.UseNagleAlgorithm = false; System.Net.ServicePointManager.Expect100Continue = false;
  • 53. Tips & tricks Lessons learned the hard way • Intellitrace is your best friend for remote debugging
  • 54. Tips & tricks Lessons learned the hard way • Log file shipping instead of default trace logs • Ship eventlog & log files via diagnostics service • Configured in .wadcfg file • Trace logs in table storage is to unfriendly
  • 56. Resources Want to know more? • Overview: http://docs.particular.net/nservicebus/windows-azure-transport • Hosting: http://docs.particular.net/nservicebus/hosting-nservicebus-in-windows-azure • Cloud services: http://docs.particular.net/nservicebus/hosting-nservicebus-in-windows-azure-cloud-services • Shared host: http://docs.particular.net/nservicebus/shared-hosting-nservicebus-in-windows-azure-cloud-services • Azure servicebus: http://docs.particular.net/nservicebus/using-azure-servicebus-as-transport-in-nservicebus • Azure storage queues: http://docs.particular.net/nservicebus/using-azure-storage-queues-as-transport-in-nservicebus • Storage persistence: http://docs.particular.net/nservicebus/using-azure-storage-persistence-in-nservicebus • Transactions: http://docs.particular.net/nservicebus/understanding-transactions-in-windows-azure
  • 57. Resources Or get your hands dirty? • Samples: https://github.com/particular/nservicebus.azure.samples

Editor's Notes

  1. 13 Regions globally - regions may exist of multiple datacenters (europe north = 4 datacenter buildings in dublin) 29 CDN nodes
  2. Modular buildings Containers Itpac’s Inside or outside Different depending on location conditions (air/water cooling etc...)
  3. IT Pac example Up to 2500 physical servers per itpac (avg 10.000 virtual machines) Commodity hardware Little redundancy
  4. Transition: Let’s spend a few minutes talking about what happens when we deploy a cloud service in Windows Azure.