SlideShare a Scribd company logo
Architecting with Queues for
Scale, Speed and Separation
Sandy Smith
DCPHP 3/11/15
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
The Challenge
2
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Social Contest
•Show off Azure + PHP
•People submit tweets to enter contest
•Pull specified keywords from Twitter queue (prefiltered by
Node.js app)
•Human admins filter out inappropriate content
•Humans or computer pulls out winner from approved entries,
on timer or arbitrarily
•Display latest entries and latest winners to public
3
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Stretch goals
•Allow any size contest
•Assume global contest with distributed moderators
4
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Initial design
5
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
The real bottleneck
What’s the slowest and
most variable part of any
application?
6
Insert Text Here
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
The real bottleneck
7
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Quick refresher
Performance vs. Scaling

Vertical vs. Horizontal Scaling
8
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Traditional database design
•Group by kind
•Keep metadata with object or in metadata tables
•Objects (Document, Person, Account) are most important
•Reinforced by TableGateway, ActiveRecord patterns, and ORM
and framework module generator defaults
•Works for 80% of cases
9
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Tradeoffs of traditional design
•Everything’s in one table, even when you routinely only need a
subset
•Typically one master writes, replicants read
•Design is focused around what something is, not its state or
other attribute
•Requires creative solutions for horizontal scaling
•Encourages (but does not require) centralizing logic for a given
type of data
10
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Worst of all…
•This design really didn’t show off all the stuff in Azure
11
(We had a week left)
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Redesign time
12
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Redesign goals
•Include as much Azure stuff as is reasonable
•Implement the stretch goals of scalability
13
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Queues to the rescue!
(Plus some other cool stuff)
14
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
New approach
•Keep long term but fast storage
•Central concern is not the Thing (Entry) but Status
– Unapproved

– Approved

– Denied

– Winner

•Separate updates to long term storage from status changes
•Minimal impact to working code
15
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Azure queuing options
Azure Queues (duh)
•Simple
•“Short”-lived (<7 days)
•Used within Azure
•Uses REST
•Can track message
processing
16
Azure Service Bus
•Enterprisey
•Long-lived
•In Azure or private cloud
•Can use AMQP, REST, or
API
•Can publish/subscribe
•Can batch requests
•Can guarantee FIFO
•etc.
See https://msdn.microsoft.com/en-us/library/azure/hh767287.aspx
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
More options
•Anything you can install on Linux or Windows (RabbitMQ,
ZeroMQ, Kafka, Kestrel, ActiveMQ, etc.)
•Any relational or NoSQL database
•Azure Tables - Simple REST NoSQL store with a twist
17
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Solutions
•Long term storage and display retrieval: Azure Table
•Since entries could begin long before a conference, use
Service Bus to store changes in status
•Have daemons pull incoming status changes out and write
them to the Table
18
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
New design
19
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Azure Table basics
20
require_once 'vendorautoload.php';

use WindowsAzureCommonServicesBuilder;

use WindowsAzureCommonServiceException;

use WindowsAzureTableModelsEntity;

use WindowsAzureTableModelsEdmType;



// Create table REST proxy.

$tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString);



try {

// Create table.

$tableRestProxy->createTable("mytable");

} catch(ServiceException $e){

// Handle exception based on error codes and messages.

}



$entity = new Entity();

$entity->setPartitionKey("pk");

$entity->setRowKey("1");

$entity->addProperty("PropertyName", EdmType::STRING, "Sample");



try {

$tableRestProxy->insertEntity("mytable", $entity);

} catch(ServiceException $e){

// Handle exception based on error codes and messages.

}
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Create and send with Service Bus
21
require_once 'vendorautoload.php';

use WindowsAzureServiceBusModelsQueueInfo;

use WindowsAzureCommonServiceException;

use WindowsAzureCommonServicesBuilder;



$serviceBusRestProxy = ServicesBuilder::getInstance()-
>createServiceBusService($connectionString);



try {

$queueInfo = new QueueInfo("myqueue");

$serviceBusRestProxy->createQueue($queueInfo);

} catch(ServiceException $e) {

// handle error

}



try {

// Create message.

$message = new BrokeredMessage();

$message->setBody("my message");



// Send message.

$serviceBusRestProxy->sendQueueMessage("myqueue", $message);

} catch(ServiceException $e) {

// handle error

}
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Receive with Service Bus
22
require_once 'vendorautoload.php';

use WindowsAzureServiceBusModelsQueueInfo;

use WindowsAzureCommonServiceException;

use WindowsAzureCommonServicesBuilder;



$serviceBusRestProxy = ServicesBuilder::getInstance()-
>createServiceBusService($connectionString);



try {

// Set the receive mode to PeekLock (default is ReceiveAndDelete).

$options = new ReceiveMessageOptions();

$options->setPeekLock(true);



// Receive message.

$message = $serviceBusRestProxy->receiveQueueMessage("myqueue", $options);

echo "Body: ".$message->getBody()."<br />";

echo "MessageID: ".$message->getMessageId()."<br />";



// *** Process message here ***



// Delete message.

$serviceBusRestProxy->deleteMessage($message);

} catch(ServiceException $e){

// handle error

}
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Benefits
•Queues add safety: if processing fails, main store is unchanged
•App doesn’t wait for process-update-delete cycle
– Concerns more separated

•Can move queue processing to separate machines
•Trivial to move to different stores for each status
•Very performant with up-to-second data
23
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Challenges
•No full ACID
•Safety is largely in the application layer
•Potential for race conditions
– Humans suck
24
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Takeaways
•Look for more than just long processes
•Use to decouple functions
•Look for status changes
•Is the type of data the most important aspect of your data?
– It usually is!

•Design for replacement of components
– Makes changes easier (not easy)
25
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Links
•Azure: http://azure.microsoft.com/en-us/
•Social Contest:

https://github.com/MusketeersMe/SocialContest
•Me
– @SandyS1

– http://phparch.com/

•Feedback! https://joind.in/event/dc-php-march-2015
•Lone Star PHP (April 16–18): http://lonestarphp.com
•php[tek] (May 18–22) http://tek.phparch.com
•Slides will be at: http://www.slideshare.net/SandySmith
26
Architecting with Queues - Sandy Smith - DCPHP - 3/11/15
Image credits
•Questions? by Valerie Everett

https://flic.kr/p/5zEjFG
•Expanded coke zero can! by Audin Malmin

https://flic.kr/p/5Ldjx8
27

More Related Content

What's hot

Windows Azure Drive
Windows Azure DriveWindows Azure Drive
Windows Azure Drive
Pavel Revenkov
 
Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...
Jelastic Multi-Cloud PaaS
 
Atom: A cloud native deep learning platform at Supremind
Atom: A cloud native deep learning platform at SupremindAtom: A cloud native deep learning platform at Supremind
Atom: A cloud native deep learning platform at Supremind
Alluxio, Inc.
 
Storage Services
Storage ServicesStorage Services
Storage Services
Pavel Revenkov
 
Paul Angus - CloudStack Container Service
Paul  Angus - CloudStack Container ServicePaul  Angus - CloudStack Container Service
Paul Angus - CloudStack Container Service
ShapeBlue
 
Performance tuning in BlueStore & RocksDB - Li Xiaoyan
Performance tuning in BlueStore & RocksDB - Li XiaoyanPerformance tuning in BlueStore & RocksDB - Li Xiaoyan
Performance tuning in BlueStore & RocksDB - Li Xiaoyan
Ceph Community
 
Bacd zenoss
Bacd zenossBacd zenoss
Bacd zenoss
ke4qqq
 
Integration of Glusterfs in to commvault simpana
Integration of Glusterfs in to commvault simpanaIntegration of Glusterfs in to commvault simpana
Integration of Glusterfs in to commvault simpana
Gluster.org
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
Ratnesh kumar, CSM
 
Architectural patterns for high performance microservices in kubernetes
Architectural patterns for high performance microservices in kubernetesArchitectural patterns for high performance microservices in kubernetes
Architectural patterns for high performance microservices in kubernetes
Rafał Leszko
 
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen OxfordASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen Oxford
Phil Pursglove
 
CEPH DAY BERLIN - CEPH MANAGEMENT THE EASY AND RELIABLE WAY
CEPH DAY BERLIN - CEPH MANAGEMENT THE EASY AND RELIABLE WAYCEPH DAY BERLIN - CEPH MANAGEMENT THE EASY AND RELIABLE WAY
CEPH DAY BERLIN - CEPH MANAGEMENT THE EASY AND RELIABLE WAY
Ceph Community
 
Adam Dagnall: Advanced S3 compatible storage integration in CloudStack
Adam Dagnall: Advanced S3 compatible storage integration in CloudStackAdam Dagnall: Advanced S3 compatible storage integration in CloudStack
Adam Dagnall: Advanced S3 compatible storage integration in CloudStack
ShapeBlue
 
Kubernetes #2 monitoring
Kubernetes #2   monitoring Kubernetes #2   monitoring
Kubernetes #2 monitoring
Terry Cho
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetesArchitectural caching patterns for kubernetes
Architectural caching patterns for kubernetes
Rafał Leszko
 
Red Hat Gluster Storage, Container Storage and CephFS Plans
Red Hat Gluster Storage, Container Storage and CephFS PlansRed Hat Gluster Storage, Container Storage and CephFS Plans
Red Hat Gluster Storage, Container Storage and CephFS Plans
Red_Hat_Storage
 
Architecting with Queues - Northeast PHP 2015
Architecting with Queues - Northeast PHP 2015Architecting with Queues - Northeast PHP 2015
Architecting with Queues - Northeast PHP 2015
Sandy Smith
 
Redis Labs and SQL Server
Redis Labs and SQL ServerRedis Labs and SQL Server
Redis Labs and SQL Server
Lynn Langit
 
Device Synchronization with Javascript and PouchDB
Device Synchronization with Javascript and PouchDBDevice Synchronization with Javascript and PouchDB
Device Synchronization with Javascript and PouchDB
Frank Rousseau
 
Sdc challenges-2012
Sdc challenges-2012Sdc challenges-2012
Sdc challenges-2012
Gluster.org
 

What's hot (20)

Windows Azure Drive
Windows Azure DriveWindows Azure Drive
Windows Azure Drive
 
Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...
 
Atom: A cloud native deep learning platform at Supremind
Atom: A cloud native deep learning platform at SupremindAtom: A cloud native deep learning platform at Supremind
Atom: A cloud native deep learning platform at Supremind
 
Storage Services
Storage ServicesStorage Services
Storage Services
 
Paul Angus - CloudStack Container Service
Paul  Angus - CloudStack Container ServicePaul  Angus - CloudStack Container Service
Paul Angus - CloudStack Container Service
 
Performance tuning in BlueStore & RocksDB - Li Xiaoyan
Performance tuning in BlueStore & RocksDB - Li XiaoyanPerformance tuning in BlueStore & RocksDB - Li Xiaoyan
Performance tuning in BlueStore & RocksDB - Li Xiaoyan
 
Bacd zenoss
Bacd zenossBacd zenoss
Bacd zenoss
 
Integration of Glusterfs in to commvault simpana
Integration of Glusterfs in to commvault simpanaIntegration of Glusterfs in to commvault simpana
Integration of Glusterfs in to commvault simpana
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
 
Architectural patterns for high performance microservices in kubernetes
Architectural patterns for high performance microservices in kubernetesArchitectural patterns for high performance microservices in kubernetes
Architectural patterns for high performance microservices in kubernetes
 
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen OxfordASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen Oxford
 
CEPH DAY BERLIN - CEPH MANAGEMENT THE EASY AND RELIABLE WAY
CEPH DAY BERLIN - CEPH MANAGEMENT THE EASY AND RELIABLE WAYCEPH DAY BERLIN - CEPH MANAGEMENT THE EASY AND RELIABLE WAY
CEPH DAY BERLIN - CEPH MANAGEMENT THE EASY AND RELIABLE WAY
 
Adam Dagnall: Advanced S3 compatible storage integration in CloudStack
Adam Dagnall: Advanced S3 compatible storage integration in CloudStackAdam Dagnall: Advanced S3 compatible storage integration in CloudStack
Adam Dagnall: Advanced S3 compatible storage integration in CloudStack
 
Kubernetes #2 monitoring
Kubernetes #2   monitoring Kubernetes #2   monitoring
Kubernetes #2 monitoring
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetesArchitectural caching patterns for kubernetes
Architectural caching patterns for kubernetes
 
Red Hat Gluster Storage, Container Storage and CephFS Plans
Red Hat Gluster Storage, Container Storage and CephFS PlansRed Hat Gluster Storage, Container Storage and CephFS Plans
Red Hat Gluster Storage, Container Storage and CephFS Plans
 
Architecting with Queues - Northeast PHP 2015
Architecting with Queues - Northeast PHP 2015Architecting with Queues - Northeast PHP 2015
Architecting with Queues - Northeast PHP 2015
 
Redis Labs and SQL Server
Redis Labs and SQL ServerRedis Labs and SQL Server
Redis Labs and SQL Server
 
Device Synchronization with Javascript and PouchDB
Device Synchronization with Javascript and PouchDBDevice Synchronization with Javascript and PouchDB
Device Synchronization with Javascript and PouchDB
 
Sdc challenges-2012
Sdc challenges-2012Sdc challenges-2012
Sdc challenges-2012
 

Viewers also liked

Intoduction to php strings
Intoduction to php  stringsIntoduction to php  strings
Grokking regex
Grokking regexGrokking regex
Grokking regex
David Stockton
 
Don't Fear the Regex LSP15
Don't Fear the Regex LSP15Don't Fear the Regex LSP15
Don't Fear the Regex LSP15
Sandy Smith
 
TDA Center Depok update 2014 (Concept)
TDA Center Depok update 2014 (Concept)TDA Center Depok update 2014 (Concept)
TDA Center Depok update 2014 (Concept)
Herri Setiawan
 
Don't Fear the Regex - CapitalCamp/GovDays 2014
Don't Fear the Regex - CapitalCamp/GovDays 2014Don't Fear the Regex - CapitalCamp/GovDays 2014
Don't Fear the Regex - CapitalCamp/GovDays 2014
Sandy Smith
 
Unicode Regular Expressions
Unicode Regular ExpressionsUnicode Regular Expressions
Unicode Regular Expressions
Nova Patch
 
Multibyte string handling in PHP
Multibyte string handling in PHPMultibyte string handling in PHP
Multibyte string handling in PHP
Daniel_Rhodes
 
GAIQ - Regular expressions-google-analytics
GAIQ - Regular expressions-google-analyticsGAIQ - Regular expressions-google-analytics
GAIQ - Regular expressions-google-analytics
Ankita Kishore
 
Dom
DomDom
Regular expressions
Regular expressionsRegular expressions
Regular expressions
davidfstr
 
Hyperlocalisation or "localising everything"
Hyperlocalisation or "localising everything"Hyperlocalisation or "localising everything"
Hyperlocalisation or "localising everything"
Daniel_Rhodes
 
Lessons from a Dying CMS
Lessons from a Dying CMSLessons from a Dying CMS
Lessons from a Dying CMS
Sandy Smith
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
James Gray
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Nicole Ryan
 
Iterators, ArrayAccess & Countable (Oh My!) - Madison PHP 2014
Iterators, ArrayAccess & Countable (Oh My!) - Madison PHP 2014Iterators, ArrayAccess & Countable (Oh My!) - Madison PHP 2014
Iterators, ArrayAccess & Countable (Oh My!) - Madison PHP 2014
Sandy Smith
 
Regular Expressions: Backtracking, and The Little Engine that Could(n't)?
Regular Expressions: Backtracking, and The Little Engine that Could(n't)?Regular Expressions: Backtracking, and The Little Engine that Could(n't)?
Regular Expressions: Backtracking, and The Little Engine that Could(n't)?
daoswald
 
Working with Databases and MySQL
Working with Databases and MySQLWorking with Databases and MySQL
Working with Databases and MySQL
Nicole Ryan
 
How to report a bug
How to report a bugHow to report a bug
How to report a bug
Sandy Smith
 
Don't Fear the Regex - Northeast PHP 2015
Don't Fear the Regex - Northeast PHP 2015Don't Fear the Regex - Northeast PHP 2015
Don't Fear the Regex - Northeast PHP 2015
Sandy Smith
 
Learning Regular Expressions for the Extraction of Product Attributes from E-...
Learning Regular Expressions for the Extraction of Product Attributes from E-...Learning Regular Expressions for the Extraction of Product Attributes from E-...
Learning Regular Expressions for the Extraction of Product Attributes from E-...
Volha Bryl
 

Viewers also liked (20)

Intoduction to php strings
Intoduction to php  stringsIntoduction to php  strings
Intoduction to php strings
 
Grokking regex
Grokking regexGrokking regex
Grokking regex
 
Don't Fear the Regex LSP15
Don't Fear the Regex LSP15Don't Fear the Regex LSP15
Don't Fear the Regex LSP15
 
TDA Center Depok update 2014 (Concept)
TDA Center Depok update 2014 (Concept)TDA Center Depok update 2014 (Concept)
TDA Center Depok update 2014 (Concept)
 
Don't Fear the Regex - CapitalCamp/GovDays 2014
Don't Fear the Regex - CapitalCamp/GovDays 2014Don't Fear the Regex - CapitalCamp/GovDays 2014
Don't Fear the Regex - CapitalCamp/GovDays 2014
 
Unicode Regular Expressions
Unicode Regular ExpressionsUnicode Regular Expressions
Unicode Regular Expressions
 
Multibyte string handling in PHP
Multibyte string handling in PHPMultibyte string handling in PHP
Multibyte string handling in PHP
 
GAIQ - Regular expressions-google-analytics
GAIQ - Regular expressions-google-analyticsGAIQ - Regular expressions-google-analytics
GAIQ - Regular expressions-google-analytics
 
Dom
DomDom
Dom
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Hyperlocalisation or "localising everything"
Hyperlocalisation or "localising everything"Hyperlocalisation or "localising everything"
Hyperlocalisation or "localising everything"
 
Lessons from a Dying CMS
Lessons from a Dying CMSLessons from a Dying CMS
Lessons from a Dying CMS
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Iterators, ArrayAccess & Countable (Oh My!) - Madison PHP 2014
Iterators, ArrayAccess & Countable (Oh My!) - Madison PHP 2014Iterators, ArrayAccess & Countable (Oh My!) - Madison PHP 2014
Iterators, ArrayAccess & Countable (Oh My!) - Madison PHP 2014
 
Regular Expressions: Backtracking, and The Little Engine that Could(n't)?
Regular Expressions: Backtracking, and The Little Engine that Could(n't)?Regular Expressions: Backtracking, and The Little Engine that Could(n't)?
Regular Expressions: Backtracking, and The Little Engine that Could(n't)?
 
Working with Databases and MySQL
Working with Databases and MySQLWorking with Databases and MySQL
Working with Databases and MySQL
 
How to report a bug
How to report a bugHow to report a bug
How to report a bug
 
Don't Fear the Regex - Northeast PHP 2015
Don't Fear the Regex - Northeast PHP 2015Don't Fear the Regex - Northeast PHP 2015
Don't Fear the Regex - Northeast PHP 2015
 
Learning Regular Expressions for the Extraction of Product Attributes from E-...
Learning Regular Expressions for the Extraction of Product Attributes from E-...Learning Regular Expressions for the Extraction of Product Attributes from E-...
Learning Regular Expressions for the Extraction of Product Attributes from E-...
 

Similar to Architecting with Queues for Scale, Speed, and Separation (DCPHP 3/11/15)

Troubleshooting a XenDesktop Environment using the PowerShell SDK
Troubleshooting a XenDesktop Environment using the PowerShell SDKTroubleshooting a XenDesktop Environment using the PowerShell SDK
Troubleshooting a XenDesktop Environment using the PowerShell SDK
David McGeough
 
Clug 2012 March web server optimisation
Clug 2012 March   web server optimisationClug 2012 March   web server optimisation
Clug 2012 March web server optimisation
grooverdan
 
Tips, Tricks & Best Practices for large scale HDInsight Deployments
Tips, Tricks & Best Practices for large scale HDInsight DeploymentsTips, Tricks & Best Practices for large scale HDInsight Deployments
Tips, Tricks & Best Practices for large scale HDInsight Deployments
Ashish Thapliyal
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
Doris Chen
 
Advanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotAdvanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien Pouliot
Xamarin
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best Practices
Doris Chen
 
Real-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
Real-Time Streaming: Move IMS Data to Your Cloud Data WarehouseReal-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
Real-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
Precisely
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
Drupalcon Paris
 
BigData Developers MeetUp
BigData Developers MeetUpBigData Developers MeetUp
BigData Developers MeetUp
Christian Johannsen
 
Dok Talks #124 - Intro to Druid on Kubernetes
Dok Talks #124 - Intro to Druid on KubernetesDok Talks #124 - Intro to Druid on Kubernetes
Dok Talks #124 - Intro to Druid on Kubernetes
DoKC
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
Achieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
Achieve Internet
 
Dsdt meetup 2017 11-21
Dsdt meetup 2017 11-21Dsdt meetup 2017 11-21
Dsdt meetup 2017 11-21
JDA Labs MTL
 
DSDT Meetup Nov 2017
DSDT Meetup Nov 2017DSDT Meetup Nov 2017
DSDT Meetup Nov 2017
DSDT_MTL
 
Speed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudSpeed up R with parallel programming in the Cloud
Speed up R with parallel programming in the Cloud
Revolution Analytics
 
Performance and Scale: Billions of request per day (DDD2019)
Performance and Scale: Billions of request per day (DDD2019)Performance and Scale: Billions of request per day (DDD2019)
Performance and Scale: Billions of request per day (DDD2019)
Marcel Dempers
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
DataWorks Summit
 
XPDS13: Xen and XenServer Storage Performance - Felipe Franciosi, Citrix
XPDS13: Xen and XenServer Storage Performance - Felipe Franciosi, CitrixXPDS13: Xen and XenServer Storage Performance - Felipe Franciosi, Citrix
XPDS13: Xen and XenServer Storage Performance - Felipe Franciosi, Citrix
The Linux Foundation
 
Splitgraph: AHL talk
Splitgraph: AHL talkSplitgraph: AHL talk
Splitgraph: AHL talk
Splitgraph
 
E2E PVS Technical Overview Stephane Thirion
E2E PVS Technical Overview Stephane ThirionE2E PVS Technical Overview Stephane Thirion
E2E PVS Technical Overview Stephane Thirion
sthirion
 

Similar to Architecting with Queues for Scale, Speed, and Separation (DCPHP 3/11/15) (20)

Troubleshooting a XenDesktop Environment using the PowerShell SDK
Troubleshooting a XenDesktop Environment using the PowerShell SDKTroubleshooting a XenDesktop Environment using the PowerShell SDK
Troubleshooting a XenDesktop Environment using the PowerShell SDK
 
Clug 2012 March web server optimisation
Clug 2012 March   web server optimisationClug 2012 March   web server optimisation
Clug 2012 March web server optimisation
 
Tips, Tricks & Best Practices for large scale HDInsight Deployments
Tips, Tricks & Best Practices for large scale HDInsight DeploymentsTips, Tricks & Best Practices for large scale HDInsight Deployments
Tips, Tricks & Best Practices for large scale HDInsight Deployments
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 
Advanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotAdvanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien Pouliot
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best Practices
 
Real-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
Real-Time Streaming: Move IMS Data to Your Cloud Data WarehouseReal-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
Real-Time Streaming: Move IMS Data to Your Cloud Data Warehouse
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
BigData Developers MeetUp
BigData Developers MeetUpBigData Developers MeetUp
BigData Developers MeetUp
 
Dok Talks #124 - Intro to Druid on Kubernetes
Dok Talks #124 - Intro to Druid on KubernetesDok Talks #124 - Intro to Druid on Kubernetes
Dok Talks #124 - Intro to Druid on Kubernetes
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Dsdt meetup 2017 11-21
Dsdt meetup 2017 11-21Dsdt meetup 2017 11-21
Dsdt meetup 2017 11-21
 
DSDT Meetup Nov 2017
DSDT Meetup Nov 2017DSDT Meetup Nov 2017
DSDT Meetup Nov 2017
 
Speed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudSpeed up R with parallel programming in the Cloud
Speed up R with parallel programming in the Cloud
 
Performance and Scale: Billions of request per day (DDD2019)
Performance and Scale: Billions of request per day (DDD2019)Performance and Scale: Billions of request per day (DDD2019)
Performance and Scale: Billions of request per day (DDD2019)
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
 
XPDS13: Xen and XenServer Storage Performance - Felipe Franciosi, Citrix
XPDS13: Xen and XenServer Storage Performance - Felipe Franciosi, CitrixXPDS13: Xen and XenServer Storage Performance - Felipe Franciosi, Citrix
XPDS13: Xen and XenServer Storage Performance - Felipe Franciosi, Citrix
 
Splitgraph: AHL talk
Splitgraph: AHL talkSplitgraph: AHL talk
Splitgraph: AHL talk
 
E2E PVS Technical Overview Stephane Thirion
E2E PVS Technical Overview Stephane ThirionE2E PVS Technical Overview Stephane Thirion
E2E PVS Technical Overview Stephane Thirion
 

Recently uploaded

DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 

Recently uploaded (20)

DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 

Architecting with Queues for Scale, Speed, and Separation (DCPHP 3/11/15)

  • 1. Architecting with Queues for Scale, Speed and Separation Sandy Smith DCPHP 3/11/15
  • 2. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 The Challenge 2
  • 3. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Social Contest •Show off Azure + PHP •People submit tweets to enter contest •Pull specified keywords from Twitter queue (prefiltered by Node.js app) •Human admins filter out inappropriate content •Humans or computer pulls out winner from approved entries, on timer or arbitrarily •Display latest entries and latest winners to public 3
  • 4. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Stretch goals •Allow any size contest •Assume global contest with distributed moderators 4
  • 5. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Initial design 5
  • 6. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 The real bottleneck What’s the slowest and most variable part of any application? 6
  • 7. Insert Text Here Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 The real bottleneck 7
  • 8. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Quick refresher Performance vs. Scaling Vertical vs. Horizontal Scaling 8
  • 9. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Traditional database design •Group by kind •Keep metadata with object or in metadata tables •Objects (Document, Person, Account) are most important •Reinforced by TableGateway, ActiveRecord patterns, and ORM and framework module generator defaults •Works for 80% of cases 9
  • 10. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Tradeoffs of traditional design •Everything’s in one table, even when you routinely only need a subset •Typically one master writes, replicants read •Design is focused around what something is, not its state or other attribute •Requires creative solutions for horizontal scaling •Encourages (but does not require) centralizing logic for a given type of data 10
  • 11. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Worst of all… •This design really didn’t show off all the stuff in Azure 11
  • 12. (We had a week left) Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Redesign time 12
  • 13. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Redesign goals •Include as much Azure stuff as is reasonable •Implement the stretch goals of scalability 13
  • 14. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Queues to the rescue! (Plus some other cool stuff) 14
  • 15. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 New approach •Keep long term but fast storage •Central concern is not the Thing (Entry) but Status – Unapproved – Approved – Denied – Winner •Separate updates to long term storage from status changes •Minimal impact to working code 15
  • 16. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Azure queuing options Azure Queues (duh) •Simple •“Short”-lived (<7 days) •Used within Azure •Uses REST •Can track message processing 16 Azure Service Bus •Enterprisey •Long-lived •In Azure or private cloud •Can use AMQP, REST, or API •Can publish/subscribe •Can batch requests •Can guarantee FIFO •etc. See https://msdn.microsoft.com/en-us/library/azure/hh767287.aspx
  • 17. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 More options •Anything you can install on Linux or Windows (RabbitMQ, ZeroMQ, Kafka, Kestrel, ActiveMQ, etc.) •Any relational or NoSQL database •Azure Tables - Simple REST NoSQL store with a twist 17
  • 18. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Solutions •Long term storage and display retrieval: Azure Table •Since entries could begin long before a conference, use Service Bus to store changes in status •Have daemons pull incoming status changes out and write them to the Table 18
  • 19. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 New design 19
  • 20. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Azure Table basics 20 require_once 'vendorautoload.php';
 use WindowsAzureCommonServicesBuilder;
 use WindowsAzureCommonServiceException;
 use WindowsAzureTableModelsEntity;
 use WindowsAzureTableModelsEdmType;
 
 // Create table REST proxy.
 $tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString);
 
 try {
 // Create table.
 $tableRestProxy->createTable("mytable");
 } catch(ServiceException $e){
 // Handle exception based on error codes and messages.
 }
 
 $entity = new Entity();
 $entity->setPartitionKey("pk");
 $entity->setRowKey("1");
 $entity->addProperty("PropertyName", EdmType::STRING, "Sample");
 
 try {
 $tableRestProxy->insertEntity("mytable", $entity);
 } catch(ServiceException $e){
 // Handle exception based on error codes and messages.
 }
  • 21. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Create and send with Service Bus 21 require_once 'vendorautoload.php';
 use WindowsAzureServiceBusModelsQueueInfo;
 use WindowsAzureCommonServiceException;
 use WindowsAzureCommonServicesBuilder;
 
 $serviceBusRestProxy = ServicesBuilder::getInstance()- >createServiceBusService($connectionString);
 
 try {
 $queueInfo = new QueueInfo("myqueue");
 $serviceBusRestProxy->createQueue($queueInfo);
 } catch(ServiceException $e) {
 // handle error
 }
 
 try {
 // Create message.
 $message = new BrokeredMessage();
 $message->setBody("my message");
 
 // Send message.
 $serviceBusRestProxy->sendQueueMessage("myqueue", $message);
 } catch(ServiceException $e) {
 // handle error
 }
  • 22. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Receive with Service Bus 22 require_once 'vendorautoload.php';
 use WindowsAzureServiceBusModelsQueueInfo;
 use WindowsAzureCommonServiceException;
 use WindowsAzureCommonServicesBuilder;
 
 $serviceBusRestProxy = ServicesBuilder::getInstance()- >createServiceBusService($connectionString);
 
 try {
 // Set the receive mode to PeekLock (default is ReceiveAndDelete).
 $options = new ReceiveMessageOptions();
 $options->setPeekLock(true);
 
 // Receive message.
 $message = $serviceBusRestProxy->receiveQueueMessage("myqueue", $options);
 echo "Body: ".$message->getBody()."<br />";
 echo "MessageID: ".$message->getMessageId()."<br />";
 
 // *** Process message here ***
 
 // Delete message.
 $serviceBusRestProxy->deleteMessage($message);
 } catch(ServiceException $e){
 // handle error
 }
  • 23. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Benefits •Queues add safety: if processing fails, main store is unchanged •App doesn’t wait for process-update-delete cycle – Concerns more separated •Can move queue processing to separate machines •Trivial to move to different stores for each status •Very performant with up-to-second data 23
  • 24. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Challenges •No full ACID •Safety is largely in the application layer •Potential for race conditions – Humans suck 24
  • 25. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Takeaways •Look for more than just long processes •Use to decouple functions •Look for status changes •Is the type of data the most important aspect of your data? – It usually is! •Design for replacement of components – Makes changes easier (not easy) 25
  • 26. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Links •Azure: http://azure.microsoft.com/en-us/ •Social Contest:
 https://github.com/MusketeersMe/SocialContest •Me – @SandyS1 – http://phparch.com/ •Feedback! https://joind.in/event/dc-php-march-2015 •Lone Star PHP (April 16–18): http://lonestarphp.com •php[tek] (May 18–22) http://tek.phparch.com •Slides will be at: http://www.slideshare.net/SandySmith 26
  • 27. Architecting with Queues - Sandy Smith - DCPHP - 3/11/15 Image credits •Questions? by Valerie Everett
 https://flic.kr/p/5zEjFG •Expanded coke zero can! by Audin Malmin
 https://flic.kr/p/5Ldjx8 27