WEB06

WEB IN REAL TIME CON
ASP.NET SIGNALR

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Grazie a
Sponsor

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Agenda
•

What / Why / When

•

Event-driven architecture and SignlaR

•

Scale-out SignalR

•

Performance tips

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
About me
Alessandro Melchiori
Software architect @ codiceplastico
@amelchiori
http://melkio.blog.codiceplastico.com

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
demo
SignalR.Intro

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
#CDays14 – Milano 25, 26 e 27 Febbraio 2014

Domain Model

Service Layer

Presentation Layer

Da qui…

Storage
Domain Model

Service Layer

Presentation Layer

…a qui
Write storage

Read storage

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
SignalR core architecture: pub/sub
publisher

message bus
message cache

client

client

client

client

client
Pattern 1. Server broadcast
•

Low rate broadcast of the same payload to all clients

•

One message bus send maps to many users (fan out)

•

More clients don’t increase message bus traffic
Pattern 2. Server push
•

Low rate broadcast of the unique payload to each client

•

One message bus send maps to one user (no fan out)

•

More clients means more message bus traffic
Pattern 3. User event driven
•

Broadcast on client actions

•

One message bus send maps to many users (fan out)

•

More clients means more message bus traffic
Pattern 4. High frequency real-time
•

Fixed high rate broadcast from servers and clients

•

One message bus send maps to one user (no fan out)

•

More clients means more message bus traffic
demo
Event-driven architecture & SignalR

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Remember…
Have your app do as little as possible. If
you do nothing, you can scale infinitely.
Scott Hanselman

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Scale-out issues: message delivery
Scale-out issues: client transience

server 1

server 2
Scale-out issues: client distribution

server 1

server 2
Scale-out SignalR
•

SQL Server, Redis & Windows Azure Service Bus

•

Great for the server broadcast load pattern

•

Limited for other scenarios

 Every message goes to every server, so as traffic increases you’re limited by
how fast any one web server can pull messages off of the backplane

Backplanes are *much* slower
than single-server performance
Scale-out provider architecture
backplane

web nodes

clients
demo
Scale-out SignalR

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Q&A
Tutto il materiale di questa sessione su

http://www.communitydays.it/
Lascia il feedback su questa sessione,
potrai essere estratto per i nostri premi!
Seguici su
Twitter @CommunityDaysIT
Facebook http://facebook.com/cdaysit
#CDays14

#CDays14 – Milano 25, 26 e 27 Febbraio 2014

Real time web with SignalR

  • 1.
    WEB06 WEB IN REALTIME CON ASP.NET SIGNALR #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 2.
    Grazie a Sponsor #CDays14 –Milano 25, 26 e 27 Febbraio 2014
  • 3.
    Agenda • What / Why/ When • Event-driven architecture and SignlaR • Scale-out SignalR • Performance tips #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 4.
    About me Alessandro Melchiori Softwarearchitect @ codiceplastico @amelchiori http://melkio.blog.codiceplastico.com #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 5.
    demo SignalR.Intro #CDays14 – Milano25, 26 e 27 Febbraio 2014
  • 6.
    #CDays14 – Milano25, 26 e 27 Febbraio 2014 Domain Model Service Layer Presentation Layer Da qui… Storage
  • 7.
    Domain Model Service Layer PresentationLayer …a qui Write storage Read storage #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 8.
    SignalR core architecture:pub/sub publisher message bus message cache client client client client client
  • 9.
    Pattern 1. Serverbroadcast • Low rate broadcast of the same payload to all clients • One message bus send maps to many users (fan out) • More clients don’t increase message bus traffic
  • 10.
    Pattern 2. Serverpush • Low rate broadcast of the unique payload to each client • One message bus send maps to one user (no fan out) • More clients means more message bus traffic
  • 11.
    Pattern 3. Userevent driven • Broadcast on client actions • One message bus send maps to many users (fan out) • More clients means more message bus traffic
  • 12.
    Pattern 4. Highfrequency real-time • Fixed high rate broadcast from servers and clients • One message bus send maps to one user (no fan out) • More clients means more message bus traffic
  • 13.
    demo Event-driven architecture &SignalR #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 14.
    Remember… Have your appdo as little as possible. If you do nothing, you can scale infinitely. Scott Hanselman #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 15.
  • 16.
    Scale-out issues: clienttransience server 1 server 2
  • 17.
    Scale-out issues: clientdistribution server 1 server 2
  • 18.
    Scale-out SignalR • SQL Server,Redis & Windows Azure Service Bus • Great for the server broadcast load pattern • Limited for other scenarios  Every message goes to every server, so as traffic increases you’re limited by how fast any one web server can pull messages off of the backplane Backplanes are *much* slower than single-server performance
  • 19.
  • 20.
    demo Scale-out SignalR #CDays14 –Milano 25, 26 e 27 Febbraio 2014
  • 21.
    Q&A Tutto il materialedi questa sessione su http://www.communitydays.it/ Lascia il feedback su questa sessione, potrai essere estratto per i nostri premi! Seguici su Twitter @CommunityDaysIT Facebook http://facebook.com/cdaysit #CDays14 #CDays14 – Milano 25, 26 e 27 Febbraio 2014

Editor's Notes

  • #3 Slide da mostrare prima di iniziare la sessione – non rimuovere!
  • #22 Ultima slide, obbligatoria