Upload
radu-vunvulea
View
510
Download
5
Tags:
Embed Size (px)
Citation preview
Microsoft Summit 2013the ultimate business and
technology conferenceArchitecture & Best
Practices Track
Real-time fluent communication using SignalR and CloudRadu VunvuleaiQuest Group
Scope
What?Why?
When?Where?
How?
Agenda• Internet in our days• Fluent communication• Connection methods• Security• Performance• Scalability• Conclusion
{“name” : “Radu Vunvulea,“company” : “iQuest Group”,“userType” : “enthusiastic”“technologies” : [“Azure”, “.NET”, “JS”, “Web”, “Mobile”, “WPF”, “SL” ],“expertise” : [“enterprise”, “pharma”, “automotive”, “home automation”, “e-Commerce” ],“blog” : “vunvulearadu.blogspot.com”,“email” : ”[email protected]”,“socialMedia” :
{“twitter” :
“@RaduVunvulea”,“fb” : “radu.vunvulea”
}
}
Who am I?
Internet in our days
Internet during the time• Real Time Web• Real Time Libraries & Web
SocketFuture
• Ajax• jQuery & Prototype
Present
• Static Web• HTML & Request/ResponsePast
Fluent communication
Real Time InteractionChatNotificationsWeatherStock marketCommerce
AuctionGamesMonitoringDashboardDocument editing
Current solutions
WebSocketForever FrameServer Send EventsPoolingSPDY
Available FrameworksCommetPusherSockJSSocketIOFaye
Now.jsSseDjango-sseCrampOpenPush
Available FrameworksCommetPusherSockJSSocketIOFaye
Now.jsSseDjango-sseCrampOpenPush
SignalR
What is SignalR• Async library for .NET to help build real-
time, multiuser interactive web applications
• Bidirectional communication• Adopted by Microsoft• Open Source• GitHub
Supported PlatformsServer• Windows (.NET)• Linux (Mono)Clients• IE, Chrome, Firefox, Safari, Opera, Android
Brower • IoS, Windows Desktop, Silverlight,
Windows Store, Windows Phone …
Connection Methods
Connection Methods
WebSocket
Server Side Events
Forever Frame
Ajax long pooling
Persistent ConnectionSimilar with WebSocket• Persistent• Events• Connect• Disconnect• Receive• Error
Methods• Send• Broadcast
HubsOver Persistent ConnectionsShare variablesCalls between client and serverSerialization
Capture connect/disconnect Everything works by magic
HubsWhen you have multiple hubs• Same connection is
shared by a client• Groups are
maintained separately for each hub
• One proxy JS file for all hubs
Async support• OnConnected• OnDisconnected• OnReconnected• proxy.State (JS)• Client.Caller (C#)
Demo
Hubs vs Persistent ConnectionsHubs• Remote invocation• Easy to use and
manage• Best for simple use
cases
Persistent Connections• Message format
needs to be specified
• Messaging and dispatching model
• An existing app is ported to SignalR
Security
SecurityConnection Token • Connection
Id+Username• Unique• Managed by server• Encrypted with a digital
signature
SecurityConnection Id • Exists until the end of
connectionUsername• Only for authenticated
users• Passed between client
and server for each request
CSRF
Disable cross domain requests
Verify connection token
Put connection token in query string
The connection token is not persisted on the client
Performance
PerformanceSingle Box• Over 450.000 messages
per second• 15.000 – 20.000
connections (hardware limitations – ports)
PerformanceWeb farm• You have “NO” limit • You need to synchronize
each node from the farm
Solution
SignalR FarmBackplanes:• Windows Azure Service
Bus• Redis• SQLServer
Server broadcast High-frequency realtime Client to client
Server Server
Backplane
Demo
Conclusion
ConclusionSignalR is great for:• Client to Server communication• Server to Client communication• Broadcasting• Real Time Applications• Scalable Solutions• Low latency
Question
Answers
Thank you{
“name” : “Radu Vunvulea, “blog” : “vunvulearadu.blogspot.com”, “email” : ”[email protected]”,“socialMedia” :
{“twitter” :
“@RaduVunvulea”,“fb” : “radu.vunvulea”
}}