SlideShare a Scribd company logo
1 of 38
Copyright © 2018 ONE BCG. All rights reserved.
SignalR With ASP.NET MVC
2
Copyright © 2018 ONE BCG. All rights reserved.
Introduction
• What is SignalR?
• Why do we need it?
• Where can we use it?
• How does it work?
• SignalR backplanes
3
Copyright © 2018 ONE BCG. All rights reserved.
What is SignalR?
WHAT
4
Copyright © 2018 ONE BCG. All rights reserved.
SignalR?
• Real-time, open-source library, persistent connection
abstraction over HTTP for .NET
• Simple and powerful API’s
• Many techniques use to keep the logical connection up,
including retry logic if transport fail.
• Scaleout back plans.
5
Copyright © 2018 ONE BCG. All rights reserved.
Why do we need signalR?
WHY
6
Copyright © 2018 ONE BCG. All rights reserved.
Why do we need signalR?
• SignalR provides a simple API for creating server-to-client
remote procedure call(RPC) that call javascript functions in
client browsers from server-side .NET code.
• SignalR also includes API for connection management(for
instance, connect and disconnect events). It handle connection
management automatically.
7
Copyright © 2018 ONE BCG. All rights reserved.
Why do we need signalR?
• It can reach out to thousands of clients using service bus, SQL
server or Redis cache.
• Abstract away the network layer for bidirectional real-time
communications, thus helping developers focus on building the
application.
8
Copyright © 2018 ONE BCG. All rights reserved.
Where can we use it?
WHERE
9
Copyright © 2018 ONE BCG. All rights reserved.
Where can we use it?
• Dashboards
• Monitoring
• Job progress
• Real-time form
• Web games/ Chat rooms
• Trading
10
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
HOW
11
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
12
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
Order of network transports:-
HTML 5 Transports:-
• WebSockets
• Server Sent Events
Comet Transports (long-held HTTP request):-
• Forever Frame
• Ajax Long Polling
13
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
WebSockets
• A new HTML5 API enables bi-directional, full-duplex
communication between the browser and the server.
• It is the new standard defined as a part of HTML 5 to solve
two major problems of the current web:
- Overhead of HTTP (Network Throughput)
- Low Latency
14
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
Server sent event
• A technology, where a browser receives automatic updates
from a server via an HTTP connection, the Server-Sent Events
EventSource API is standardized as part of HTML5.
• The situation was also possible before, but the web page
would seek updates. With server-sent events, the updates
come automatically.
• It supports all major browsers, except Internet Explorer.
15
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
Forever Frame
● Forever Frame creates a hidden IFrame which requests to an
endpoint on the server that does not complete. The server then
continually sends a script to the client which is immediately
executed, providing a one-way realtime connection from server to
client.
16
Copyright © 2018 ONE BCG. All rights reserved.
Forever Frame continued..
● The connection from the client to server uses a separate
attachment from the server to client connection, and like a
standard HTML request, creates a new link for each piece of
data sent.
17
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
Ajax Long Polling
• Long polling does not create a persistent connection, but instead
polls the server with a request that stays open until the server
responds, at which point the connection closes, and a new
connection is requested immediately.
• This may introduce some latency while the connection resets.
18
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
• Fallback.
19
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
SignalR API & Architecture
The SignalR API contains two models for communicating between
clients and servers: Persistent Connections & Hubs Connection
Persistent Connections
• Low level access to communication.
• Direct developer access to network pipeline.
• Access to lot more communication events.
• Will be familiar to developers who have used connection-based
APIs such as WCF.
20
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
Hubs
• High level abstraction
• Built on top of Persistent Connections
• Least developer work.
• Works for majority of user.
• Will be familiar to developers who have used remote invocation
APIs such as .Net Remoting.
21
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
22
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
23
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
Demo Link
https://sahilsaini.azurewebsites.net/
24
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
Selecting which clients will receive the RPC
• Clients.All.refresh(message); // All connected clients
• Clients.Caller.refresh(message); // Only the calling client
• Clients.others.refresh(message); // All clients except the calling
client
• Clients.Client(Context.ConnectionId).refresh(message); // A specific
client identified by connection ID
25
Copyright © 2018 ONE BCG. All rights reserved.
How does it work?
Selecting which clients will receive the RPC
• clients.AllExcept(connectionId1,
connectionId2).refresh(message); // All connected clients except
the specified clients, identified by connection ID.
• clients.Group(groupName).refresh(message); // All connected
clients in a specified group.
• clients.Group(groupName).refresh(message); // All connected
clients in a specified group.
26
Copyright © 2018 ONE BCG. All rights reserved.
SignalR Backplanes
Backplane is basically for forward messages between servers in
scaleout environments.
Why we need it?
When you application scale out, clients can get routed to different
servers. A client that is connected to one server will not receive
messages sent from another server.
27
Copyright © 2018 ONE BCG. All rights reserved.
SignalR Backplanes
28
Copyright © 2018 ONE BCG. All rights reserved.
SignalR Backplanes
SignalR currently provides three backplanes:
• Azure Service Bus
• Redis
• SQL Server
29
Copyright © 2018 ONE BCG. All rights reserved.
SignalR Backplanes
SignalR scaleout with SQL Server:
30
Copyright © 2018 ONE BCG. All rights reserved.
SignalR Backplanes
SignalR scaleout with SQL Server:
• Install Microsoft.AspNet.SignalR.SqlServer package to signalR
application.
• Write below code in startup file:-
public void Configuration(IAppBuilder app)
{
// Any connection or hub wire up and configuration should go here
string sqlConnectionString = "Connecton string to your SQL DB";
GlobalHost.DependencyResolver.UseSqlServer(sqlConnectionString);
app.MapSignalR();
}
31
Copyright © 2018 ONE BCG. All rights reserved.
SignalR Backplanes
SignalR scaleout with Redis:
• Install Microsoft.AspNet.SignalR.StackExchangeRedis package to
web application
• Write below code in Startup file:-
32
Copyright © 2018 ONE BCG. All rights reserved.
SignalR Backplanes
SignalR scaleout with Azure service bus:
• Install Microsoft.AspNet.SignalR.ServiceBus package to web
application
• Write below code in Startup file:-
33
Copyright © 2018 ONE BCG. All rights reserved.
Azure SignalR
WHAT is Azure SignalR
• Azure SignalR Service simplifies the process of adding real-time web
functionality to applications over HTTP.
• This real-time functionality allows the service to push content
updates to connected clients, such as a single page web or mobile
application.
• Fully managed service.
34
Copyright © 2018 ONE BCG. All rights reserved.
Azure SignalR
Benefits using Azure SignalR Service
• Standard based
• Native ASP.NET Core support
• Broad client support
• Handle large-scale client connections
• Remove the burden to self-host SignalR
35
Copyright © 2018 ONE BCG. All rights reserved.
Azure SignalR
How to use Azure signalR
• Install Microsoft.Azure.SignalR.AspNet to web application
• Write below code in Startup file:-
36
Copyright © 2018 ONE BCG. All rights reserved.
Azure SignalR
How to use Azure signalR
37
Copyright © 2018 ONE BCG. All rights reserved.
Azure SignalR
Demo Link
https://testazuresignalr.azurewebsites.net/
38
Copyright © 2018 ONE BCG. All rights reserved.
Thank You
THANK YOU

More Related Content

What's hot

Using an API Gateway for Microservices
Using an API Gateway for MicroservicesUsing an API Gateway for Microservices
Using an API Gateway for MicroservicesNGINX, Inc.
 
Building a scalable microservice architecture with envoy, kubernetes and istio
Building a scalable microservice architecture with envoy, kubernetes and istioBuilding a scalable microservice architecture with envoy, kubernetes and istio
Building a scalable microservice architecture with envoy, kubernetes and istioSAMIR BEHARA
 
Fundamentals of microservices
Fundamentals of microservicesFundamentals of microservices
Fundamentals of microservicesNGINX, Inc.
 
OAuth2 Authorization Server Under the Hood
OAuth2 Authorization Server Under the HoodOAuth2 Authorization Server Under the Hood
OAuth2 Authorization Server Under the HoodLohika_Odessa_TechTalks
 
APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...
APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...
APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...apidays
 
Navigating the service mesh landscape with Istio, Consul Connect, and Linkerd
Navigating the service mesh landscape with Istio, Consul Connect, and LinkerdNavigating the service mesh landscape with Istio, Consul Connect, and Linkerd
Navigating the service mesh landscape with Istio, Consul Connect, and LinkerdChristian Posta
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?NGINX, Inc.
 
Consul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesConsul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesArmonDadgar
 
Managing microservices with Istio Service Mesh
Managing microservices with Istio Service MeshManaging microservices with Istio Service Mesh
Managing microservices with Istio Service MeshRafik HARABI
 
Microservice: starting point
Microservice:  starting pointMicroservice:  starting point
Microservice: starting pointinovia
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway Chris Mague
 
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...ScyllaDB
 
Voxxed Days Minsk. Microservices:
 The phantom menace
. Istio Service Mesh: 
...
Voxxed Days Minsk. Microservices:
 The phantom menace
. Istio Service Mesh: 
...Voxxed Days Minsk. Microservices:
 The phantom menace
. Istio Service Mesh: 
...
Voxxed Days Minsk. Microservices:
 The phantom menace
. Istio Service Mesh: 
...Sergii Bishyr
 
AWS Api Gateway by Łukasz Marchewka Scalacc
AWS Api Gateway by Łukasz Marchewka ScalaccAWS Api Gateway by Łukasz Marchewka Scalacc
AWS Api Gateway by Łukasz Marchewka ScalaccScalac
 
Microservices in GO lang
Microservices in GO langMicroservices in GO lang
Microservices in GO langSHAKIL AKHTAR
 

What's hot (20)

Opa in the api management world
Opa in the api management worldOpa in the api management world
Opa in the api management world
 
Using an API Gateway for Microservices
Using an API Gateway for MicroservicesUsing an API Gateway for Microservices
Using an API Gateway for Microservices
 
Building a scalable microservice architecture with envoy, kubernetes and istio
Building a scalable microservice architecture with envoy, kubernetes and istioBuilding a scalable microservice architecture with envoy, kubernetes and istio
Building a scalable microservice architecture with envoy, kubernetes and istio
 
Fundamentals of microservices
Fundamentals of microservicesFundamentals of microservices
Fundamentals of microservices
 
OAuth2 Authorization Server Under the Hood
OAuth2 Authorization Server Under the HoodOAuth2 Authorization Server Under the Hood
OAuth2 Authorization Server Under the Hood
 
Intro to signalR
Intro to signalRIntro to signalR
Intro to signalR
 
APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...
APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...
APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...
 
Navigating the service mesh landscape with Istio, Consul Connect, and Linkerd
Navigating the service mesh landscape with Istio, Consul Connect, and LinkerdNavigating the service mesh landscape with Istio, Consul Connect, and Linkerd
Navigating the service mesh landscape with Istio, Consul Connect, and Linkerd
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
 
Consul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesConsul: Service Mesh for Microservices
Consul: Service Mesh for Microservices
 
Scribe Online CDK & Connector Development
Scribe Online CDK & Connector DevelopmentScribe Online CDK & Connector Development
Scribe Online CDK & Connector Development
 
Managing microservices with Istio Service Mesh
Managing microservices with Istio Service MeshManaging microservices with Istio Service Mesh
Managing microservices with Istio Service Mesh
 
Microservice: starting point
Microservice:  starting pointMicroservice:  starting point
Microservice: starting point
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
 
Voxxed Days Minsk. Microservices:
 The phantom menace
. Istio Service Mesh: 
...
Voxxed Days Minsk. Microservices:
 The phantom menace
. Istio Service Mesh: 
...Voxxed Days Minsk. Microservices:
 The phantom menace
. Istio Service Mesh: 
...
Voxxed Days Minsk. Microservices:
 The phantom menace
. Istio Service Mesh: 
...
 
AWS Api Gateway by Łukasz Marchewka Scalacc
AWS Api Gateway by Łukasz Marchewka ScalaccAWS Api Gateway by Łukasz Marchewka Scalacc
AWS Api Gateway by Łukasz Marchewka Scalacc
 
Kong
KongKong
Kong
 
Microservices in GO lang
Microservices in GO langMicroservices in GO lang
Microservices in GO lang
 

Similar to Brushing skills on SignalR for ASP.NET developers

IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018Chris Phillips
 
IoT Physical Servers and Cloud Offerings.pdf
IoT Physical Servers and Cloud Offerings.pdfIoT Physical Servers and Cloud Offerings.pdf
IoT Physical Servers and Cloud Offerings.pdfGVNSK Sravya
 
Hyperledger Composer architecture
Hyperledger Composer architectureHyperledger Composer architecture
Hyperledger Composer architectureSimon Stone
 
Serverless patterns
Serverless patternsServerless patterns
Serverless patternsJesse Butler
 
HostBridge Virtual User Group December 2020
HostBridge Virtual User Group December 2020HostBridge Virtual User Group December 2020
HostBridge Virtual User Group December 2020HostBridge Technology
 
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...Amazon Web Services
 
How to add stuff to MySQL
How to add stuff to MySQLHow to add stuff to MySQL
How to add stuff to MySQLGeorgi Kodinov
 
Deep Dive on Amazon Managed Blockchain: re:Invent 2018 Recap at the AWS Loft ...
Deep Dive on Amazon Managed Blockchain: re:Invent 2018 Recap at the AWS Loft ...Deep Dive on Amazon Managed Blockchain: re:Invent 2018 Recap at the AWS Loft ...
Deep Dive on Amazon Managed Blockchain: re:Invent 2018 Recap at the AWS Loft ...Amazon Web Services
 
Akachain Hyperledger Fabric best practices
Akachain Hyperledger Fabric best practicesAkachain Hyperledger Fabric best practices
Akachain Hyperledger Fabric best practicesEledra Nguyen
 
SignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsSignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsEugene Zharkov
 
Introduction to Hyperledger Composer
Introduction to Hyperledger ComposerIntroduction to Hyperledger Composer
Introduction to Hyperledger ComposerSimon Stone
 
Monitor the World: Meaningful Metrics for Containerized Apps and Clusters (CO...
Monitor the World: Meaningful Metrics for Containerized Apps and Clusters (CO...Monitor the World: Meaningful Metrics for Containerized Apps and Clusters (CO...
Monitor the World: Meaningful Metrics for Containerized Apps and Clusters (CO...Amazon Web Services
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Deepak Gupta
 
Designing Network Architectures with Direct Connect for Multiple Traffic Stre...
Designing Network Architectures with Direct Connect for Multiple Traffic Stre...Designing Network Architectures with Direct Connect for Multiple Traffic Stre...
Designing Network Architectures with Direct Connect for Multiple Traffic Stre...Amazon Web Services
 
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.jsAsynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.jsChristian Heindel
 
IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0Matt Lucas
 
The Current And Future State Of Service Mesh
The Current And Future State Of Service MeshThe Current And Future State Of Service Mesh
The Current And Future State Of Service MeshRam Vennam
 
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...Amazon Web Services
 
Implementing Multi-Region AWS IoT, ft. Analog Devices (IOT401) - AWS re:Inven...
Implementing Multi-Region AWS IoT, ft. Analog Devices (IOT401) - AWS re:Inven...Implementing Multi-Region AWS IoT, ft. Analog Devices (IOT401) - AWS re:Inven...
Implementing Multi-Region AWS IoT, ft. Analog Devices (IOT401) - AWS re:Inven...Amazon Web Services
 

Similar to Brushing skills on SignalR for ASP.NET developers (20)

IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018
 
IoT Physical Servers and Cloud Offerings.pdf
IoT Physical Servers and Cloud Offerings.pdfIoT Physical Servers and Cloud Offerings.pdf
IoT Physical Servers and Cloud Offerings.pdf
 
WebRTC Seminar Report
WebRTC  Seminar ReportWebRTC  Seminar Report
WebRTC Seminar Report
 
Hyperledger Composer architecture
Hyperledger Composer architectureHyperledger Composer architecture
Hyperledger Composer architecture
 
Serverless patterns
Serverless patternsServerless patterns
Serverless patterns
 
HostBridge Virtual User Group December 2020
HostBridge Virtual User Group December 2020HostBridge Virtual User Group December 2020
HostBridge Virtual User Group December 2020
 
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FS...
 
How to add stuff to MySQL
How to add stuff to MySQLHow to add stuff to MySQL
How to add stuff to MySQL
 
Deep Dive on Amazon Managed Blockchain: re:Invent 2018 Recap at the AWS Loft ...
Deep Dive on Amazon Managed Blockchain: re:Invent 2018 Recap at the AWS Loft ...Deep Dive on Amazon Managed Blockchain: re:Invent 2018 Recap at the AWS Loft ...
Deep Dive on Amazon Managed Blockchain: re:Invent 2018 Recap at the AWS Loft ...
 
Akachain Hyperledger Fabric best practices
Akachain Hyperledger Fabric best practicesAkachain Hyperledger Fabric best practices
Akachain Hyperledger Fabric best practices
 
SignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsSignalR: Add real-time to your applications
SignalR: Add real-time to your applications
 
Introduction to Hyperledger Composer
Introduction to Hyperledger ComposerIntroduction to Hyperledger Composer
Introduction to Hyperledger Composer
 
Monitor the World: Meaningful Metrics for Containerized Apps and Clusters (CO...
Monitor the World: Meaningful Metrics for Containerized Apps and Clusters (CO...Monitor the World: Meaningful Metrics for Containerized Apps and Clusters (CO...
Monitor the World: Meaningful Metrics for Containerized Apps and Clusters (CO...
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)
 
Designing Network Architectures with Direct Connect for Multiple Traffic Stre...
Designing Network Architectures with Direct Connect for Multiple Traffic Stre...Designing Network Architectures with Direct Connect for Multiple Traffic Stre...
Designing Network Architectures with Direct Connect for Multiple Traffic Stre...
 
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.jsAsynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
 
IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0
 
The Current And Future State Of Service Mesh
The Current And Future State Of Service MeshThe Current And Future State Of Service Mesh
The Current And Future State Of Service Mesh
 
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
 
Implementing Multi-Region AWS IoT, ft. Analog Devices (IOT401) - AWS re:Inven...
Implementing Multi-Region AWS IoT, ft. Analog Devices (IOT401) - AWS re:Inven...Implementing Multi-Region AWS IoT, ft. Analog Devices (IOT401) - AWS re:Inven...
Implementing Multi-Region AWS IoT, ft. Analog Devices (IOT401) - AWS re:Inven...
 

More from ONE BCG

A comprehensive guide to user behavioral analytics
A comprehensive guide to user behavioral analytics A comprehensive guide to user behavioral analytics
A comprehensive guide to user behavioral analytics ONE BCG
 
What is product development and its process?
What is product development and its process?What is product development and its process?
What is product development and its process?ONE BCG
 
Why effective communication with clients is necessary?
Why effective communication with clients is necessary?Why effective communication with clients is necessary?
Why effective communication with clients is necessary?ONE BCG
 
An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.ONE BCG
 
How Artificial intelligence and machine learning are different?
How Artificial intelligence and machine learning are different? How Artificial intelligence and machine learning are different?
How Artificial intelligence and machine learning are different? ONE BCG
 
What is Agile and Scrum, their guiding principles and methods?
What is Agile and Scrum, their guiding principles and methods?What is Agile and Scrum, their guiding principles and methods?
What is Agile and Scrum, their guiding principles and methods?ONE BCG
 
Prototype: Its methods, techniques, and key features.
Prototype: Its methods, techniques, and key features.Prototype: Its methods, techniques, and key features.
Prototype: Its methods, techniques, and key features.ONE BCG
 
How to prepare a project for automated deployment?
How to prepare a project for automated deployment?How to prepare a project for automated deployment?
How to prepare a project for automated deployment?ONE BCG
 
What is Load, Stress and Endurance Testing?
What is Load, Stress and Endurance Testing?What is Load, Stress and Endurance Testing?
What is Load, Stress and Endurance Testing?ONE BCG
 
Software risk analysis and management
Software risk analysis and managementSoftware risk analysis and management
Software risk analysis and managementONE BCG
 
What is security testing and why it is so important?
What is security testing and why it is so important?What is security testing and why it is so important?
What is security testing and why it is so important?ONE BCG
 

More from ONE BCG (11)

A comprehensive guide to user behavioral analytics
A comprehensive guide to user behavioral analytics A comprehensive guide to user behavioral analytics
A comprehensive guide to user behavioral analytics
 
What is product development and its process?
What is product development and its process?What is product development and its process?
What is product development and its process?
 
Why effective communication with clients is necessary?
Why effective communication with clients is necessary?Why effective communication with clients is necessary?
Why effective communication with clients is necessary?
 
An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.
 
How Artificial intelligence and machine learning are different?
How Artificial intelligence and machine learning are different? How Artificial intelligence and machine learning are different?
How Artificial intelligence and machine learning are different?
 
What is Agile and Scrum, their guiding principles and methods?
What is Agile and Scrum, their guiding principles and methods?What is Agile and Scrum, their guiding principles and methods?
What is Agile and Scrum, their guiding principles and methods?
 
Prototype: Its methods, techniques, and key features.
Prototype: Its methods, techniques, and key features.Prototype: Its methods, techniques, and key features.
Prototype: Its methods, techniques, and key features.
 
How to prepare a project for automated deployment?
How to prepare a project for automated deployment?How to prepare a project for automated deployment?
How to prepare a project for automated deployment?
 
What is Load, Stress and Endurance Testing?
What is Load, Stress and Endurance Testing?What is Load, Stress and Endurance Testing?
What is Load, Stress and Endurance Testing?
 
Software risk analysis and management
Software risk analysis and managementSoftware risk analysis and management
Software risk analysis and management
 
What is security testing and why it is so important?
What is security testing and why it is so important?What is security testing and why it is so important?
What is security testing and why it is so important?
 

Recently uploaded

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Brushing skills on SignalR for ASP.NET developers

  • 1. Copyright © 2018 ONE BCG. All rights reserved. SignalR With ASP.NET MVC
  • 2. 2 Copyright © 2018 ONE BCG. All rights reserved. Introduction • What is SignalR? • Why do we need it? • Where can we use it? • How does it work? • SignalR backplanes
  • 3. 3 Copyright © 2018 ONE BCG. All rights reserved. What is SignalR? WHAT
  • 4. 4 Copyright © 2018 ONE BCG. All rights reserved. SignalR? • Real-time, open-source library, persistent connection abstraction over HTTP for .NET • Simple and powerful API’s • Many techniques use to keep the logical connection up, including retry logic if transport fail. • Scaleout back plans.
  • 5. 5 Copyright © 2018 ONE BCG. All rights reserved. Why do we need signalR? WHY
  • 6. 6 Copyright © 2018 ONE BCG. All rights reserved. Why do we need signalR? • SignalR provides a simple API for creating server-to-client remote procedure call(RPC) that call javascript functions in client browsers from server-side .NET code. • SignalR also includes API for connection management(for instance, connect and disconnect events). It handle connection management automatically.
  • 7. 7 Copyright © 2018 ONE BCG. All rights reserved. Why do we need signalR? • It can reach out to thousands of clients using service bus, SQL server or Redis cache. • Abstract away the network layer for bidirectional real-time communications, thus helping developers focus on building the application.
  • 8. 8 Copyright © 2018 ONE BCG. All rights reserved. Where can we use it? WHERE
  • 9. 9 Copyright © 2018 ONE BCG. All rights reserved. Where can we use it? • Dashboards • Monitoring • Job progress • Real-time form • Web games/ Chat rooms • Trading
  • 10. 10 Copyright © 2018 ONE BCG. All rights reserved. How does it work? HOW
  • 11. 11 Copyright © 2018 ONE BCG. All rights reserved. How does it work?
  • 12. 12 Copyright © 2018 ONE BCG. All rights reserved. How does it work? Order of network transports:- HTML 5 Transports:- • WebSockets • Server Sent Events Comet Transports (long-held HTTP request):- • Forever Frame • Ajax Long Polling
  • 13. 13 Copyright © 2018 ONE BCG. All rights reserved. How does it work? WebSockets • A new HTML5 API enables bi-directional, full-duplex communication between the browser and the server. • It is the new standard defined as a part of HTML 5 to solve two major problems of the current web: - Overhead of HTTP (Network Throughput) - Low Latency
  • 14. 14 Copyright © 2018 ONE BCG. All rights reserved. How does it work? Server sent event • A technology, where a browser receives automatic updates from a server via an HTTP connection, the Server-Sent Events EventSource API is standardized as part of HTML5. • The situation was also possible before, but the web page would seek updates. With server-sent events, the updates come automatically. • It supports all major browsers, except Internet Explorer.
  • 15. 15 Copyright © 2018 ONE BCG. All rights reserved. How does it work? Forever Frame ● Forever Frame creates a hidden IFrame which requests to an endpoint on the server that does not complete. The server then continually sends a script to the client which is immediately executed, providing a one-way realtime connection from server to client.
  • 16. 16 Copyright © 2018 ONE BCG. All rights reserved. Forever Frame continued.. ● The connection from the client to server uses a separate attachment from the server to client connection, and like a standard HTML request, creates a new link for each piece of data sent.
  • 17. 17 Copyright © 2018 ONE BCG. All rights reserved. How does it work? Ajax Long Polling • Long polling does not create a persistent connection, but instead polls the server with a request that stays open until the server responds, at which point the connection closes, and a new connection is requested immediately. • This may introduce some latency while the connection resets.
  • 18. 18 Copyright © 2018 ONE BCG. All rights reserved. How does it work? • Fallback.
  • 19. 19 Copyright © 2018 ONE BCG. All rights reserved. How does it work? SignalR API & Architecture The SignalR API contains two models for communicating between clients and servers: Persistent Connections & Hubs Connection Persistent Connections • Low level access to communication. • Direct developer access to network pipeline. • Access to lot more communication events. • Will be familiar to developers who have used connection-based APIs such as WCF.
  • 20. 20 Copyright © 2018 ONE BCG. All rights reserved. How does it work? Hubs • High level abstraction • Built on top of Persistent Connections • Least developer work. • Works for majority of user. • Will be familiar to developers who have used remote invocation APIs such as .Net Remoting.
  • 21. 21 Copyright © 2018 ONE BCG. All rights reserved. How does it work?
  • 22. 22 Copyright © 2018 ONE BCG. All rights reserved. How does it work?
  • 23. 23 Copyright © 2018 ONE BCG. All rights reserved. How does it work? Demo Link https://sahilsaini.azurewebsites.net/
  • 24. 24 Copyright © 2018 ONE BCG. All rights reserved. How does it work? Selecting which clients will receive the RPC • Clients.All.refresh(message); // All connected clients • Clients.Caller.refresh(message); // Only the calling client • Clients.others.refresh(message); // All clients except the calling client • Clients.Client(Context.ConnectionId).refresh(message); // A specific client identified by connection ID
  • 25. 25 Copyright © 2018 ONE BCG. All rights reserved. How does it work? Selecting which clients will receive the RPC • clients.AllExcept(connectionId1, connectionId2).refresh(message); // All connected clients except the specified clients, identified by connection ID. • clients.Group(groupName).refresh(message); // All connected clients in a specified group. • clients.Group(groupName).refresh(message); // All connected clients in a specified group.
  • 26. 26 Copyright © 2018 ONE BCG. All rights reserved. SignalR Backplanes Backplane is basically for forward messages between servers in scaleout environments. Why we need it? When you application scale out, clients can get routed to different servers. A client that is connected to one server will not receive messages sent from another server.
  • 27. 27 Copyright © 2018 ONE BCG. All rights reserved. SignalR Backplanes
  • 28. 28 Copyright © 2018 ONE BCG. All rights reserved. SignalR Backplanes SignalR currently provides three backplanes: • Azure Service Bus • Redis • SQL Server
  • 29. 29 Copyright © 2018 ONE BCG. All rights reserved. SignalR Backplanes SignalR scaleout with SQL Server:
  • 30. 30 Copyright © 2018 ONE BCG. All rights reserved. SignalR Backplanes SignalR scaleout with SQL Server: • Install Microsoft.AspNet.SignalR.SqlServer package to signalR application. • Write below code in startup file:- public void Configuration(IAppBuilder app) { // Any connection or hub wire up and configuration should go here string sqlConnectionString = "Connecton string to your SQL DB"; GlobalHost.DependencyResolver.UseSqlServer(sqlConnectionString); app.MapSignalR(); }
  • 31. 31 Copyright © 2018 ONE BCG. All rights reserved. SignalR Backplanes SignalR scaleout with Redis: • Install Microsoft.AspNet.SignalR.StackExchangeRedis package to web application • Write below code in Startup file:-
  • 32. 32 Copyright © 2018 ONE BCG. All rights reserved. SignalR Backplanes SignalR scaleout with Azure service bus: • Install Microsoft.AspNet.SignalR.ServiceBus package to web application • Write below code in Startup file:-
  • 33. 33 Copyright © 2018 ONE BCG. All rights reserved. Azure SignalR WHAT is Azure SignalR • Azure SignalR Service simplifies the process of adding real-time web functionality to applications over HTTP. • This real-time functionality allows the service to push content updates to connected clients, such as a single page web or mobile application. • Fully managed service.
  • 34. 34 Copyright © 2018 ONE BCG. All rights reserved. Azure SignalR Benefits using Azure SignalR Service • Standard based • Native ASP.NET Core support • Broad client support • Handle large-scale client connections • Remove the burden to self-host SignalR
  • 35. 35 Copyright © 2018 ONE BCG. All rights reserved. Azure SignalR How to use Azure signalR • Install Microsoft.Azure.SignalR.AspNet to web application • Write below code in Startup file:-
  • 36. 36 Copyright © 2018 ONE BCG. All rights reserved. Azure SignalR How to use Azure signalR
  • 37. 37 Copyright © 2018 ONE BCG. All rights reserved. Azure SignalR Demo Link https://testazuresignalr.azurewebsites.net/
  • 38. 38 Copyright © 2018 ONE BCG. All rights reserved. Thank You THANK YOU