25
Learn. Connect. Explore. Learn. Connect. Explore.

Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Embed Size (px)

Citation preview

Page 1: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Learn. Connect. Explore.Learn. Connect. Explore.

Page 2: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Building Real-time and Responsive Applications on Azure

Girish Phadke & Maneesha Marathe

Tata Consultancy Services Ltd.

Page 3: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Real-time and Responsive Scenarios• Trading Applications for Financial Services Industry

• Real time trade orders placement and execution

• Industrial Automation Applications for Manufacturing Industry• Remote device and process management for manufacturing plants

• Real time supply chain visibility

• Citizen Service Applications for Government Agencies• Disaster Response Services

• Traffic Monitoring Services

• Smart City Initiatives

• Shipment Tracking for Logistics Industry• Shipment package delivery and pickups using Mobile Devices

• Real time visibility into shipment status for guaranteed delivery

Page 4: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Platform Needs for Responsive ApplicationsLayer Needs

Network • Low Latency

Messaging • Reliable and Secure Delivery

Client • Offline Capability

Services • Asynchronous Request Processing

• Dynamic Load Balancing

• On demand Scalability

• Asynchronous Notifications

Application and Database • Horizontal Scalability

Page 5: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Considerations for Developing Responsive Global Applications on Cloud• Enablers

• Cloud platforms provide capabilities for asynchronous request processing and asynchronous events

• Cloud platforms support dynamic provisioning of resources and horizontal scalability

• Cloud platforms provide some amount of resilience to faults but applications need to be architected to recover from failure scenarios

• Inhibitors• Cloud applications in general have higher latency depending on the

location of the data center

• Messages are delivered over Internet which presents challenges for reliable and secure delivery

Page 6: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Developing Responsive Global Applications on AzureSolution Capability Azure Capability

Low Latency Secure Communication Azure Express Route

Reliable Delivery of Messages Azure Service Bus

Real-time Event Processing Azure Events Hub

Push Notifications to Devices Azure Notifications Hub

Dynamic Provisioning of Resources Azure Auto scaling

Horizontal Scalability Azure SQL Database Sharding

Resilient Infrastructure and Application Availability Sets and DR using Azure Data

Centers

Page 7: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Key Topics for this Session

•Techniques for minimizing Azure latency for

improved performance

• Leveraging Azure Service Bus for asynchronous

messaging

•Sending Large Scale Push Notifications to Devices

•Real-life example along with key design patterns

Page 8: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Why Latency Matters in Cloud Scenarios

Page 9: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Minimizing Latency in Azure• Network Latency:

• User and Application

• Application and SQL Azure DB

• Perceived performance: • Response Time = 2x(Latency A + Latency B) + (Application Execution Time on Cloud)

• Minimizing Latency A• Judicious choice of the Data Center to minimize the packet routing overheads

• Use of Communication Gateway Server at remote locations along with ExpressRoute

• Use of WAN Accelerators along with Azure

• Minimizing Latency B• Driven by Regional VNETs (Default)

SQLVM

Web

Role

Page 10: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Virtual Network and ExpressRoute

Publicinternet

Publicinternet

Publicinternet

Microsoft

Azure

Microsoft

Azure

Microsoft

Azure

Page 11: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Service Bus for Responsive Applications• Real-world Scenarios for Cloud Messaging

• Trades from Stock Trading Terminals to be routed to Trade Execution Service

• Sales data from POS Terminals to be routed to Inventory Management System

• Shipment Pickup message from Devices needs to be routed to Logistics Planning Service

• Why use Service Bus• Temporal Decoupling

• With the asynchronous messaging pattern, producers and consumers do not have to be online at the same time

• Load Leveling and Balancing

• Consuming application (the worker) only has to be provisioned to service an average load rather than a peak load

• As the load increases, more worker processes can be added to read from the worker queue

• Loose Coupling

• Using message queuing to intermediate between message producers and consumers provides an intrinsic loose coupling between the components

Page 12: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Azure Service Bus Patterns

Relayed Messaging Brokered Messaging

• Coupled / Connectivity based

• Request-Response, Pub-Sub

• Distributed Systems, On-Premise

Integration, Real-Time

Messaging Patterns

• Loosely coupled

• Asynchronous, Batch, Offline, Pub-

Sub, Request-Response

• Chat, Multi-Player Gaming,

Durable Data (Orders)

Queues

Topics and

Subscriptions

Load Leveling

Publish-Subscribe

Design Patterns

On-Premise Service

WrapperQueue Chaining

Design Patterns

• One Consumer

• No Filter

• Transactions and

De-duplication

• Multiple

subscription based

consumers

• Subscription Filters

• Transactions and

De-duplication

Priority Queue

Page 13: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Real Time Event Processing with Azure Events Hub• Events Hub Capabilities

• Collecting event streams at high throughput from devices/services for use in real-time and batch processing.

• Client-side cursor, partitioned consumer support, and significant time-based retention

• Process event streams per device "in order" using several backend services (publish/subscribe.)

• Application Scenarios for Events Hub (Internet of Things)• Industrial Automation - Remote Asset Monitoring Solution for Air Chiller, Pump

Monitoring, Pipelines

• Building Automation - Access control system, Video Surveillance, Lighting and shade monitoring/control for buildings

• Utilities - Smart Metering Solutions, Home Energy Management

Page 14: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Push Notifications to Devices• Key Application Scenarios

• Reservation confirmation in a Movie Ticket Booking application

• Send location-based coupons to user segments.

• Send event notifications to users or groups for sports/finance/games applications.

• Notify users of enterprise events like new messages/emails, and sales leads.

• Mechanisms for Push Notifications• Azure Service Bus Notifications Hub

• Provides Multiplatform, scaled-out push notification infrastructure

• Azure Mobile Services Push Notifications

• Provides data access and storage, authentication, and push notifications

• Leverages Notifications Hub in the background

Page 15: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Notifications Hub Capabilities

• Multiple Platforms -Support for all major mobile platforms (Windows/Windows Phone, iOS, Android).

• Works with any backend – Cloud or On-premise, .NET, Java, Node

• Scale - Scales to millions of devices

• Personalization – Supports per device localization and personalization

• Security - Shared Access Secret (SAS) or federated authentication.

• Delivery Patterns – Broadcast, Unicast/Multicast, Segmentation

Page 16: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Real-life Scenario – Bike Rental Service• Overview

• Service Provider intends to launch a Bike Rental Service across Multiple Cities and Continents

• Key capabilities that Solution must provide• Allow administrators to define bike service and its configuration parameters

• Allow subscribers to register for service along with payment method

• Allow subscribers to make payments for the service subscription

• Allow subscribers to book Bikes and optionally make payments

• Track issue and return of bikes

• Send notifications to subscribers for not returning a bike, subscription renewal, payment receipt etc.

• Perform metering, billing for service usage and penalties for service misuse

• Enable centralized monitoring and analytics of the health of stations and bike usage

Page 17: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Proposed Solution Architecture

Regional DC

Communication

Gateway

On-Premise Data Center

Subscriber

Application

Access

Call Center

Application

Access

HTTP / HTTPS

(REST / JSON)SQL

Database

Web and Worker

RolesService Bus

Active

Direct

ory Exchange / SMTPServer

ExpressRoute

Connection

ERP

Dialog Title

Station

Station 1

Dialog Title

Station

Station N

ExpressRoute

Connection

GPRS/3G

GPRS/3G

HTTP / HTTPS

(REST / JSON)

Notifications Hub

NO SQL

Database

Station App

Station App Bike Service Definition App, Subscription Management App,

Bike Reservation and Payment App, Station Services, Notifications Service

Page 18: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Key Design Patterns for Bike Rental Service

Bounded Context Design Patterns

Bike Service Definition & Subscription

Management

MVC and CRUD

Bike Reservation and Payment MVC, Command Query Responsibility

Segregation and Event Sourcing

Occasionally Disconnected Bike Stations Service Bus and Publish/Subscribe

Page 19: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

CQRS and Event Sourcing Pattern

Server Application [Windows Server 2012, IIS 8, .NET 4.5.1, App Fabric]

.NET Web API / Web Services Notification Service

Batch Jobs Interface Components

Data Storage (Windows Server 2012, SQL Server 2014, SSRS)

Application Database Reporting Database

Web Browser

HTML 5 CSS3 ,jQueryUI, jQueryMobile, Toastr

JavaScript [AngularJS,, jQuery, MomentJS]

Event

StoreRead

Cache

• CQRS provides separation of

read and write sides

• Read Cache can be

implemented via a NO SQL

Database

• CQRS enables enhanced

scalability, reduced

complexity and increased

flexibility

• CQRS should be leveraged

only when you a bounded

context that is collaborative

with multiple actors operating

on same set of data

• Need to deal with the issue of

stale data in CQRS

• Event Sourcing pattern

typically complements CQRS

• Event source stores the

history that determines the

current state of the

application.

Service

Bus

Page 20: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Data Collection

Topic

Service Bus

Sub

Sub

Audit

Sub

Station

Monitoring

Processing Station Events using Service Bus

Bike

Station

Bike

Station

Bike

Station

Usage

Tracking

Page 21: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Session Recap• Minimizing latency is key to implementing Real-time

applications on Azure• Judiciously choose the Azure data center

• Evaluate ExpressRoute as an option

• Leverage Azure Service Bus for Hybrid Scenarios• Asynchronous, reliable and scalable messaging

• Deliver Push Notifications using Azure Notifications Hub• Scalable, secure, cross platform notifications to millions of devices

• Leverage CQRS and Event Sourcing Patterns based on the bounded domain context

Page 22: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

ReferencesRelated references for you to expand your knowledge on the subject

• Azure ExpressRoute

• http://channel9.msdn.com/events/TechEd/NorthAmerica/2014/DCIM-B388#fbid

• http://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/DCIM-B422#fbid=

• Azure Service Bus

• http://channel9.msdn.com/Events/Build/2012/3-033

• Azure Events Hub

• http://msdevshow.com/2014/07/azure-event-hubs-with-dan-rosanova/

• Azure Notifications Hub

• http://channel9.msdn.com/Blogs/Windows-Azure/Windows-Azure-Notification-Hubs

technet.microsoft.com/en-in

aka.ms/mva

msdn.microsoft.com/

Page 23: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Your Feedback is Important

OPTION 3: Feedback stations outside the hall

Fill out evaluation of this session and help shape future events.

OPTION 1 OPTION 2

Page 24: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application

Follow us online

Facebookfacebook.com/MicrosoftDeveloper.India

twitter.com/msdevindia

Twitter

Twitter: @girishphadke

Email:[email protected],[email protected]

Page 25: Learn. Connect. Explore. - Windows · PDF fileonline at the same time ... Access control system, Video Surveillance, ... •Reservation confirmation in a Movie Ticket Booking application