Download - Signal r azurepresentation
![Page 1: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/1.jpg)
The Real-Time Web with SignalRand Azure Service BusJustin Wendlandt
Senior Consultant – Magenic Technologies
http://jwendl.net/
@jwendl on Twitter
![Page 2: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/2.jpg)
Overview
Real Time Web
Implementations
Examples
Signal R
Horizontal Scaling with Azure
Demo
Questions and Answers
![Page 3: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/3.jpg)
Real-Time Web Overview• Content on Demand vs. Published
• UX Similar to Desktop Applications
• More Social and Interactive
![Page 4: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/4.jpg)
Forced Video Feed Switching• Scott Hanselman for DotNetConf
• Problem – Google Hangouts required users to refresh browser to see next video
• Solution – Have SignalR and Azure Service bus switch out the videos when an administrator published them
![Page 5: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/5.jpg)
Real-time Deals on Amazon.com• Real time deals based on
purchased data
• More social and interactive experience for users
![Page 6: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/6.jpg)
Real-Time Map API Hooks• Use Bing Api
• Provide Locations of Users When Discovered
![Page 7: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/7.jpg)
The Web and HTTP•Browser asks for document
•Server replies with 200 ok and bodyGET
•Browser uploads a document
•Server replies with 200 ok PUT
•Browser takes previous response
•Sends modified data to server
•Server replies with 200 okPOST
•Browser asks server to remove a document
•Server replies with 200 ok and deletes document
DELETE
•Browser takes previous response
•Browser sends only merged data to server
•Server replies with 200 okMERGE
![Page 8: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/8.jpg)
Publish Subscriber Pattern
Publisher
Subscribers
Service Bus
or Hub
Devices
![Page 9: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/9.jpg)
Publish Subscriber Pattern on the Web• Implemented using Web Sockets
– RFC 6455
http://www.rfc-editor.org/rfc/rfc6455.txt
![Page 10: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/10.jpg)
Introduction to SignalR• https://github.com/SignalR
• Most popular implementations
– Jabbr - https://jabbr.net/
![Page 11: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/11.jpg)
Failover Methods if Web Sockets Fail
Web Sockets
Server Sent Events (EventSource)
Forever Frame
Ajax Long Polling
![Page 12: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/12.jpg)
Why Azure?• Highly Scalable
• Unlimited Bandwidth (for a cost)
• Easy Deployment and Configuration models
![Page 13: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/13.jpg)
Continuous Integration and Azure
Write Code
Check In to cloud
A Build is Kicked off
Deployment Sent to Azure
![Page 14: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/14.jpg)
SignalR Demonstration• Hosted on Azure with TFS (http://tfs.visualstudio.com/)
• Requirements to run Demo
– Windows Azure SDK
– SignalR NuGet package
– ASP.NET MVC 4
![Page 15: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/15.jpg)
Horizontal Scaling Concepts• Server hardware is expensive
• Configuring more instances is complex
![Page 16: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/16.jpg)
Azure Service Bus• Queues
– Holds Messages
– Pushes to Subscribers
• Topics
– Contract
– Specific Messages / Connections
![Page 17: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/17.jpg)
Demo of Azure Service Bus• Simple demo of Azure Service Bus
![Page 18: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/18.jpg)
Scale out using Azure Service Bus• Integrated in 1.1 beta for SignalR
• One line of code that does so much
![Page 19: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/19.jpg)
Performance Configurations for IIS
Increase number of concurrent requests per application
Increase number of concurrent requests per CPU
Increase the request queue limit
Scale out more instances if on Azure or another Service Bus like Redis
![Page 20: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/20.jpg)
References• SignalR
– http://signalr.net/– http://www.asp.net/signalr/overview– https://github.com/SignalR/SignalR– http://weblogs.asp.net/davidfowler/– http://damianedwards.wordpress.com/– http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongru
nningConnectionsWithSignalR.aspx• Azure Service Bus
– http://www.windowsazure.com/en-us/develop/net/tutorials/multi-tier-application/– http://www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-queues/– https://github.com/SignalR/SignalR/wiki/Azure-service-bus
• Web Sockets– http://www.w3.org/TR/websockets/– http://www.rfc-editor.org/rfc/rfc6455.txt
![Page 21: Signal r azurepresentation](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b53ab1a28ab8e4e8b482e/html5/thumbnails/21.jpg)
Questions?@jwendl on Twitter
http://www.jwendl.net/