scalability in cloud applications

50
Scalability in Cloud Applications Radu Vunvulea [email protected] http://vunvulearadu.blogspot.com

Upload: radu-vunvulea

Post on 15-Nov-2014

405 views

Category:

Documents


3 download

DESCRIPTION

In this session we will see what are the scalabilities points of a cloud application. In the first part of the session we will look over the services offered by Windows Azure.

TRANSCRIPT

Page 1: Scalability in cloud applications

Scalability in Cloud Applications

Radu [email protected]

http://vunvulearadu.blogspot.com

Page 2: Scalability in cloud applications

{“name” : “Radu Vunvulea,“company” : “iQuest”,“userType” : “enthusiastic”“technologies” : [ “.NET”, “JS”, “Azure”, “Web”, “Mobile”, “SL” ],“blog” : “vunvulearadu.blogspot.com”,“email” : ”[email protected]”,“socialMedia” :

{“twitter” : “@RaduVunvulea”,

“fb” : “radu.vunvulea”}

}

Who am I?

Page 3: Scalability in cloud applications

Client requests

Page 4: Scalability in cloud applications

Is Cloud so different?

Page 5: Scalability in cloud applications

Cloud Services

Page 6: Scalability in cloud applications

• Cloud in general offers a lot of services that can make our life easier

• Cloud can offer more than machines scalability

• Cloud can help us to create application that are scalable in more than one point

How can we offer value in our solutions?

Page 7: Scalability in cloud applications

• Cloud in general offers a lot of services that can make our life easier

• Cloud can offer more than machines scalability

• Cloud can help us to create application that are scalable in more than one point

• We cannot offer a Cloud solution without knowing the environment

How can we offer value in our solutions?

Page 8: Scalability in cloud applications

Table Storage Service

Page 9: Scalability in cloud applications

• Stores any kind of serializable data• You don’t need any kind of complex data

structure or SQL knowledge.• Is not a relational database• In the same table you can have more than one

entity type• Each entity can have maximum 252 properties +

3 default• The maximum size of total tables cannot accede

100.000 GB (100TB)• The maximum size of an entity can be 1MB

Table Storage Service

Page 10: Scalability in cloud applications

Windows Azure Blob Storage

Page 11: Scalability in cloud applications

• Block blobs• Support multi-upload of blocks in parallel • When updating a block, the old version is not

override until you commit it• Can be used for large files

• Page blobs• Collection of pages of 512b• Can be accessed by an offset• Can be used when the content is changing

very often

• Maximum size 100TB

Windows Azure Blob Storage

Page 12: Scalability in cloud applications

• Relational database based on SQL Server• It is almost like SQL Server from on-premises • BUT:• We don’t have support for distributed

transactions• Each table have to contain at least one cluster

index• We cannot attach a database• We don’t have support for jobs

• Maximum size is 150 GB• Double check the total cost of a having a SQL

Database – there are a lot of times when we can use Table Storage Service

SQL Database

Page 13: Scalability in cloud applications

Queue Storage Service

Page 14: Scalability in cloud applications

• It is very similar with a named queue from Windows

• You can update the message from a queue• Support batches (maximum 32 messages on each

call)• Operations: peek, insert, delete, get • Remark: getting a message don’t remove the

message from queue• With some work you can even iterate in a queue• 500 - is the maximum number of messages that

can be processed per second• Message is persisted until someone will consume

it

Queue Storage Service

Page 15: Scalability in cloud applications

Service Bus

Page 16: Scalability in cloud applications

• Similar to Queue Storage Service• The order of the message is guaranteed• Death Letter support• Automatically counter for “number of retrives”• Duplicate messaging detection• Support for transaction, sessions • Are not as fast as Windows Azure Queues• The size of a Service Bus Queue is limited to 5 GB• Support for ACS (Access Control Service)• Any kind of serializable item can be added to the

queue• We can even add stream to a message queue (array of

bytes )

Service Bus Queue

Page 17: Scalability in cloud applications

• Multi-distribution mechanism for messages• Using Service Bus Queues we have 1 to 1

communication• Using Service Bus Topic we have 1 to n

communication• Each “listener” will receive each message from topic• Sessions, transaction, death letters are supported• Two ways for “listeners”

• Receive and delete• Peek and lock

• The message type is the same with Service Bus Queue – • BrokeredMessage

• Each message can contain 0 to n properties• We cannot update or add again the same message

Service Bus Topic

Page 18: Scalability in cloud applications

• Represent a communication bridge between cloud and on-premises world

• It is used with success when working with hybrid application

• Expose WCF services from on-premises servers using cloud

• Only one entry point• Requests are persisted even if the on-premises

server is down• We can control who access our services• The only thing that need to be changed is on the

configuration file of the server and client• We can only have request of type Fire And Forget

Service Bus Relay

Page 19: Scalability in cloud applications

Windows Azure Caching

Page 20: Scalability in cloud applications

• Nice feature: you pay only the machine computation• All the content is in the machine memory• 2 types of caching:

• Dedicated roles• Co-located roles (shared memory between application

and cache)• Cache cluster support (only in combination with a storage

account)• Maximum size of a cache is 14 GB (limited by the memory

size of VM role)• Each item can have an expiration date• Built in support for storing web session in the cache

Windows Azure Caching

Page 21: Scalability in cloud applications

• Offer build in caching mechanism• Can be accessed by anybody from

anywhere based on the namespace• Maximum size is 4 GB• Is more expensive than Windows Azure

Caching but can be accessed from any location

• This caching mechanism is offered as a service

• It is similar with Caching Server from on-premise servers

Caching Service

Page 22: Scalability in cloud applications

Azure Access Control Service (ACS)

Page 23: Scalability in cloud applications

• Provide us a mechanism to authenticate users from different identify providers: FB, Google, Y!, Live … even custom identify providers and Active Directory (2.0+)

• Is based on a claim based authentication • You never work with user credentials• Depending on the provider, you can access

different information about user • You don’t need anymore to implement a user

management mechanism • BUT, if you need, you will need to define roles

and store user id’s

Azure Access Control Service (ACS)

Page 24: Scalability in cloud applications

Shared Access Signature

Page 25: Scalability in cloud applications

• Provide a method to offer access to different resources from storage account

• You can provide access to resources without requiring a user to authenticate

• It is a simple way to control and manage who have access to your storage

• The base of this mechanism is a custom token• You can add, remove and change a SAS at

runtime• Each policy is defined by a unique id• The validity of a SAS can be limited (time base)

Shared Access Signature

Page 26: Scalability in cloud applications

Media Services

Page 27: Scalability in cloud applications

• The based action that can be done is: content streaming• Ingest – first step when content is uploaded (upload and

encryption)• Encoding – Process the media content (change the

encoding, converting and transform) – we can use only supported formats

• Protect – encryption of live streaming using a built-in mechanism

• Streaming – send content to consumers (even Apple HTTP Live Streaming is supported)

• Support for CDN (Azure and 3th party CDN’s are supported).

• Supported devices: Android, iOS, ,Mac, Windows Phone, Windows 8, X-box, embedded devices, dedicated devices

Media Services

Page 28: Scalability in cloud applications

Computing Services

Page 29: Scalability in cloud applications

• Can be used to develop web-application• Support different technologies (PHP,

node.js, .NET)• MySQL support • Low cost support – shared mode • Reserved mode – dedicated instance• Git support and a very fast rollback mechanism• Web.config – doesn’t need to contain Azure

configuration• Each site runs in an isolated environment

Windows Azure Websites

Page 30: Scalability in cloud applications

• Used to host application composed from multiple tiers

• Each web-role is scalable independently• In comparison with Azure Websites, a lot of

custom configuration can be done• Network isolation• Support for startup tasks• For example we can run a bat that make a

custom configuration to our firewall or install specific applications

• Any kind of framework can be used in this machines

Web Roles

Page 31: Scalability in cloud applications

• Perfect place to run long running task• Can be used with success with web-roles for tasks that run

in background• Cannot be used to host a web application• In the moment when the “WHEN(TRUE)” ends the worker

role process stop• Can be seen as a process that can execute a specific type

for an infinite period of time

Worker role

Page 32: Scalability in cloud applications

• Can be used to install any kind of operating system from Windows to Linux

• Built-in support and images available for different versions of Linux and Windows.

• Custom machines can be created with our own VHD• Built-in support for MongoDB, MySQL, Cassandra• Migration from on-premises to cloud and cloud to on-

premises can be done using VHD

Virtual Machine

Page 33: Scalability in cloud applications

Windows Azure Mobile Services

Page 34: Scalability in cloud applications

Messaging mechanism

Page 35: Scalability in cloud applications

• Windows Azure Queues • Windows Azure Service Bus Queues• Windows Azure Service Bus Topics

Messaging mechanism

Page 36: Scalability in cloud applications

More messages – What should we do?

• Cloud has is own limits• Cloud services are like other services

Page 37: Scalability in cloud applications

More messages – What should we do?

• Split the messages to more than one messaging service• Based on the type• Based on the source• Based on an attribute

Page 38: Scalability in cloud applications

Caching solutions

Page 39: Scalability in cloud applications

• Windows Azure AppFabric Cache• Cache is seen as a service• For consumer, the location of the cache is not

relevant• Windows Azure Cache• The cache is unique per instance • Cannot be synchronized between machines in

real time• Local cache• In-memory cache

Caching solutions

Page 40: Scalability in cloud applications

Storing binary data

Page 41: Scalability in cloud applications

Storing binary data

Page 42: Scalability in cloud applications

Storing binary data

Page 43: Scalability in cloud applications

• Images, ISO and binary content• Can be stored with success on blobs• CDNs • Direct access to data (security SAS)

• Videos • Blobs • Windows Azure Media Services

Storing binary data

Page 44: Scalability in cloud applications

• For cases where we need to write logs or audit data we can use with success:• Windows Azure Table + SAS

• Storing any kind of data in a non relational database• Windows Azure Table + SAS

• Storing relational data• SQL Azure

Storing information

Page 45: Scalability in cloud applications

• Can we expose WCF Services from a private network (on-premises) into a safe way?

• Can we guaranty that no request will be lost?

• Can we expose services in a manner to be 99% up even if our servers are up only 90% of time?

WCF Services

Page 46: Scalability in cloud applications

• Can we expose WCF Services from a private network (on-premises) into a safe way?

• Can we guaranty that no request will be lost?

• Can we expose services in a manner to be 99% up even if our servers are up only 90% of time?

• Windows Azure Service Bus Relay

WCF Services

Page 47: Scalability in cloud applications

• We have a web application that has long running task

• Each task take more than 5 seconds to execute

• How we can scale?

Long running task

Page 48: Scalability in cloud applications

• We have a web application that has long running task

• Each task take more than 5 seconds to execute

• How we can scale?• Long running request can run on a worker role, that can

scale independent• The result can be send to web-role using queues• Client can be notified using Web Sockets or SignalR

Long running task

Page 49: Scalability in cloud applications
Page 50: Scalability in cloud applications

THE END

Radu [email protected]

http://vunvulearadu.blogspot.com