Azure AppFabric and Caching

hedgebornabaloneΛογισμικό & κατασκευή λογ/κού

2 Δεκ 2013 (πριν από 3 χρόνια και 9 μήνες)

179 εμφανίσεις

Azure
AppFabric

and Caching

Nenad Jovi
čić

M.Sc
. Software Engineering

Agenda


Cloud basics


Azure platform


AppFabric

and
Asp.Net

in the Azure


Demo


Summary


Q&A

What is the cloud?

An approach to computing that’s about internet scale
and connecting to a variety of devices and endpoints

TIME

IT CAPACITY

Actual

Load

Allocated

IT
-
capacities

Too
Much
Power

Not Enough
Power

Load
Forecast


Actual

Load

Capacity on
Demand

Lower
Capex

No capital
laying
idle

No screaming
customers

Knob goes
up...

And...

down

TIME

IT CAPACITY

Load
Forecast

Cloud Computing Patterns

Usage

Compute

Time

Average


Inactivity

Period

Compute

Time

Average Usage

Average Usage

Compute

Time

Compute

Time

Average Usage

Cloud Services

Software
-
as
-
a
-
Service

consume

“SaaS”

Platform
-
as
-
a
-
Service

build

“PaaS”

Infrastructure
-
as
-
a
-
Service

host

“IaaS”

Cloud Services

Packaged
Software

Storage

Servers

Networking

O/S

Middleware

Virtualization

Data

Applications

Runtime

You manage

Infrastructure

(as a Service)

Storage

Servers

Networking

O/S

Middleware

Virtualization

Data

Applications

Runtime

Managed by vendor

You manage

Platform

(as a Service)

Managed by vendor

You manage

Storage

Servers

Networking

O/S

Middleware

Virtualization

Applications

Runtime

Data

Software

(as a Service)

Managed by vendor

Storage

Servers

Networking

O/S

Middleware

Virtualization

Applications

Runtime

Data

Windows Azure Platform

Scalable compute and storage

Automated service management

Familiar tools, technologies, languages

Relational storage for the cloud

Consistent development model

Automated database management

Connect existing apps to the cloud

Connect through network boundaries

Easily control authorization to apps

Windows Azure

Cloud Operating System

Virtual
Network

Compute

Storage

Windows Azure Storage


Scalable storage in the cloud


100tb per storage account


Auto
-
scale to meet massive volume and throughput


Accessible via
RESTful

Web Service API


Access from Windows Azure Compute


Access from anywhere via internet


Supporting .NET Client Library


Various storage types


Table
-

group of
entities (name/value pairs)


Queue
-

Simple
non
-
transactional message queue


Blob
-

Large binary
storage


Drives
-

NTFS VHD mounted into Compute
instance



SQL Azure

Extending SQL Server to the Cloud

Data Sync

Database

Reporting

SQL Azure Database


Familiar SQL Server relational database model delivered as a service


Support for existing APIs & tools


Built for the cloud with high availability & fault tolerance


Easily provision and manage databases across multiple
datacenters


SQL Azure provides logical server


Gateway server that understands TDS protocol


Looks like SQL Server to TDS Client


Actual data stored on multiple backend data nodes


Logical optimizations supported


Indexes, Query plans etc..


Physical optimizations not supported


File Groups, Partitions etc…


Transparently manages physical
storage

Reporting & Data Sync


SQL Azure Reporting


SQL Server Reporting provided as a service


Reports authored using existing tools (BIDS) and uploaded to the cloud


Reports can have rich Data Visualizations (Maps, Charts,
Tablix
) and be exported to
variety of rendering formats (Excel, Word, PDF)


Reports can be rendered as part of an app using the Report Viewer control


Directly view the reports in the browser


Web Service interface to render and manage reports


SQL Azure Data Sync


CTP1 available now provides geo
-
replication


CTP2
coming soon adds
sync between SQL Server and

SQL Azure


Builds on Sync Framework

Windows Azure
AppFabric

Building Block Services for developing connected applications

Caching

Service Bus

Access Control

Windows Azure
AppFabric


Comprehensive
building block services for developing,
deploying, and managing applications


Higher level Platform
-
as
-
a
-
Service (
PaaS
) capabilities


Increase developer productivity


Bridge existing applications to the
cloud

Windows Azure
AppFabric


Caching


Service
Bus


Access
Control


Integration


Composite App



(WF, WCF)

AppFabric

Caching


Distributed, in
-
memory application cache for Windows Azure apps


Primary use cases


Session state provider for Windows Azure applications


Cache layer for Windows Azure applications that leverage storage in SQL Azure
Databases or Windows Azure storage


Provided as a service


Provision, configure, and use


No installation or management of machines/instances


Dynamically increase and decrease cache size as needed


Same programming model for both cloud and on
-
premises



What is the Caching service?


A distributed, in
-
memory cache for applications
running in Windows Azure


Simple administration; end
-
user doesn’t bother
with configuration, deployment, or management


Highlight scalable solution with low latency and
high throughput


Based on Windows Server
AppFabric

Caching


Currently available in
AppFabric

LABS Portal as a
CTP

Latency Pyramid



Memory



Network



Disk

Caching Features


ASP.NET providers for session state and page
output caching


Cache
any managed object


No object size limits


No serialization costs for local caching


Easily integrates into existing applications


Secured by
Access Control

Windows Azure Platform Data Centers







6 datacenters across 3 continents

Simply select your data center of choice when deploying an application



Windows Azure Platform Appliance


Windows Azure Platform in your datacenter


Designed for unlimited scale & multi
-
tenancy


Identical to the hardware in Microsoft’s datacenters


Delivered by a choice of hardware partners


Benefits


Platform as a Service


Physical Control


Geographic Proximity


Regulatory Compliance


Data Sovereignty


Currently in development with several partners


Fujitsu, Dell, HP, and eBay


Windows Azure Platform Consumption Prices

Access Control

$1.99/10k transactions

Per Message Operation

$3.99/month per connection

Per Message Operation

Service Bus

Moving Apps to the Cloud

Compatible with
Windows Azure

Designed for

Windows Azure

Delivered as a

Service

Windows Azure Web & Worker Roles

Web Role

Worker Role


Windows Server 2008 x64 (R2 coming soon)


.NET Framework


3.5 SP1 and 4.0


Native Code, PHP, Java, etc.


Bring your own runtime


Supports Full Trust today (admin mode coming soon)


Fabric manages role lifecycle

Full IIS


Web Roles previously using Hosted Web Core


Only supports a single HTTP or HTTPS endpoint


Web Roles now supporting Full IIS 7.0/7.5


Enables new scenarios


Multiple IIS web sites


Multiple virtual directories


Configure IIS extensions


Web Deploy for rapid development

New Windows Azure Platform Portal


Faster and more user friendly portal
for Windows Azure Platform
services


More
visibility and control


Supports multiple
service
administrators (co
-
admins)


Enable and connect to Windows
Azure instances using Remote
Desktop


Built on the Windows Azure Service
Management APIs


New Applications
-

New Challenges


ASP.NET

AppFabric

Composition Model


.NET
-
based declarative model for composing applications for
the Windows Azure platform


Will enable you to define, deploy, and manage a cloud
application as a single logical entity


Rich designer experience in Visual Studio


Runtime services in the cloud provide deployment &
management of the application


Layers on the Windows Azure Service Model


AppFabric

Composition Model


What is Access Control?


Used to authenticate
and authorize users


Integration Single Sign On and centralized
authorization into your web applications


Standards
-
based identity providers


Enterprise directories (e.g. Active Directory Federation
Server v2.0)


Web identities (e.g. Windows Live ID, Google, Yahoo!,
and Facebook
)


V1 available in production; V2 available in
AppFabric

LABS

Service Bus


Provides secure messaging and connectivity across
different network topologies


Enables hybrid applications that span on
-
premises
and the cloud


Enables various communication protocols and
patterns for developers to engage in reliable
messaging

Enabling hybrid applications

Datacenter












LOB web
service

LOB app

Partner













Mobile Device

Enabling hybrid applications

Datacenter












LOB web
service

LOB app

Partner













Mobile Device






SB





ACS

Enabling hybrid applications

Datacenter












LOB web
service

LOB app

Partner













Mobile Device






SB





ACS

Enabling hybrid applications

Partner













Mobile Device

Datacenter












LOB web
service

LOB app






SB





ACS

Enabling hybrid applications

Partner













Mobile Device

Datacenter












LOB web
service

LOB app






SB





ACS

Service
Bus

Client

Service

Service Bus


Exchange messages between loosely coupled applications


Network send/receive from any internet connected device


Traverse NAT/Firewall


Message buffering for loosely connected applications


Facilitate direct peer
-
to
-
peer
connection

Web Forms and MVC


Windows Azure Tools for Visual Studio pre
-
defined
role templates


ASP.NET
WebForms

Role


ASP.NET MVC 2 Role

What’s Different?


Statelessness


Load balancer round
-
robins requests in multi
instance roles


Follow web farm best practices


Do not store state on individual instances


Do not assume subsequent requests will hit the
same instance


Don’t forget things like dynamically generated images
loaded by a page


AJAX and Windows Azure


Client side calls may not return to the same
instance the original page came from


AJAX calls must be stateless


Don’t generate a page and leave state on the
server to call via AJAX later


All instances require the same
MachineKey

for
ViewState

hashing


Fabric uses same machine key for all instances in a
role

Windows Azure Session State

Windows Azure Load Balancer uses round
-
robin allocation. Session
state must persist to client or storage on every
request

Solving Session State


Persist to Storage via Session State Provider


Windows Azure
AppFabric

Caching


SQL Azure


Windows Azure Storage


Custom


Persist to Client


Use cookies


Don’t forget ASP.NET MVC
TempData

relies on
Session State provider by default

Windows Azure
AppFabric

Caching


Using Windows Azure
AppFabric

Caching as the
session store


In
-
memory, distributed cache


Based on Windows Server
AppFabric

Caching


Used
the
Microsoft.Web.DistributedCache

assembly found in the SDK


Enable ASP.NET 4 Session Compression


Currently available in
AppFabric

LABS Portal as
CTP


AppFabric

Caching Session State

SQL Server Session State


Use SQL Azure as backing store


Round trip to database twice per request


Read at request start


Write at request end


Enable ASP.NET 4 Session Compression


Scale out across multiple DBs


Use session state partitioning


http://tinyurl.com/scale
-
session


SQL Azure is competitive on cost basis

SQL Azure Session State

Session state stored using SQL Server Session State Provider and session
state
partitioning

resolve partition

Windows Azure Storage Providers


Sample ASP.NET Providers

(Session, Membership, Role etc…)


Sample Code

http://code.msdn.microsoft.com/windowsazuresamples


Uses Blob + Table Storage


Several storage transactions per request


Enable ASP.NET 4 Session Compression


Sample Provider should be treated as a starting point only.

High Performance DNS Approach


Create service, deploy to staging slot


Resolve IP for yourapp.cloudapp.net


Create A Record for


www.yourapp.com


yourapp.com

Full IIS


You can choose to deploy to Full IIS; no
longer
using
required to use Hosted Web Core (HWC)


Differences:


In Full IIS, the
RoleEntryPoint

runs under WaIISHost.exe
while the web site runs under the normal IIS w3wp.exe
process.


Support for running multiple websites


Load any IIS module


Going to make migrating existing IIS
-
based
applications a lot easier

Multi
-
Tenancy

resolve tenant

by examining host header

1
2
Web Deploy


IIS Web Deployment Tool


Simplifies the migration, management, and
deployment of IIS Web servers, Web applications,
and Web sites


You’ll be able to do web deploy using standard IIS7
publishing from Visual Studio


Will not require you to deploy an entire package


Warning: use for development purposes only

File Upload


ASP.NET File Upload Control uses ASP.NET
temporary directory to buffer files


Temp path cannot be changed to Local Resource or
Windows Azure Drive


Windows Azure Compute roles have 100MB of
root disk space


Problems arise


Uploading large files (~100MB)


Multiple users uploading concurrently

10 users uploading 10MB files

File Upload Solutions


Upload direct to Blob storage using Silverlight


Provide a Shared Access Signature to Silverlight control


Upload blocks direct to storage

http://tinyurl.com/sl
-
blob


Use 3rd Party Control


Implement a custom
IHttpHandler

to receive file
and buffer to disk

Demo




Summary


Windows Azure Platform is a comprehensive
PaaS

offering including:


Windows Azure


SQL Azure


Windows Azure
AppFabric


Fundamental concepts:


Windows Azure Service Definition & Configuration


Windows Azure Roles


Commercially
available today in 41 countries and 6 data centers


In the future Windows Azure & SQL Azure will be available on
-
premises as an appliance


Continuing to expand the set of services and features


Comprehensive building block services for developing, deploying, and managing applications


Includes


Caching


Access
Controal


Service
Bus


ASP.NET In Windows Azure


Broad support for ASP.NET Features


Must understand and architect for scale out


Q&A


?