程序代写代做代考 python flex Java Week 11 – Cloud Computing 3

Week 11 – Cloud Computing 3

CLOUD COMPUTING (3)
Dr Bailin Deng

Overview
• PaaS

• Data Storage in the Cloud

Overview
• PaaS

• Data Storage in the Cloud

Recall: Different Service Models

Hosted
applications

Development tools,
DB management, etc.

OS Servers &
Storage

Networking
firewalls/security

Data center
physical facility

PaaS
• With PaaS, a user develops/deploys applications using

languages, libraries, services, and tools supported by the
provider, without the complexity of managing the
underlying virtual machines.

PaaS
• With PaaS, a user develops/deploys applications using

languages, libraries, services, and tools supported by the
provider, without the complexity of managing the
underlying virtual machines.

• Limitation: less flexibility
• Can only use specific languages/tools supported by the provider

PaaS
• With PaaS, a user develops/deploys applications using

languages, libraries, services, and tools supported by the
provider, without the complexity of managing the
underlying virtual machines.

• Limitation: less flexibility
• Can only use specific languages/tools supported by the provider

• Examples: Google App Engine, Microsoft Azure, Heroku,…

Heroku
• PaaS for web application deployment

• Supports Ruby, Java, PHP, Python, Node, Go, Scala and Clojure

Heroku

How Heroku Works
• An application includes

• Source codes in an supported language
• Description of dependencies

How Heroku Works
• An application is defined using

• Source codes in an supported language
• Description of dependencies

• For Python applications:
• Python source codes
• requirements.txt: specifies additional packages required for running

the application
• runtime.txt: specifies Python runtime version (e.g. python-3.6.1)

How Heroku Works
• Knowing what to execute

• For Python, use a Procfile to declare the command to run the
application

How Heroku Works
• Deploying applications

• Send the source codes, dependency files, and Procfile to Heroku,
using either git, GitHub, Dropbox, or via an API

• For example, using git:

git push heroku master

How Heroku Works
• When the Heroku platform receives the application

source, it initiates a build of the source application
• Retrieve the specified dependencies
• Create necessary assets (e.g., by processing style sheets)
• Application source codes, fetched dependencies, the language

runtime, and the output of the build system, are bundled into a slug
• A slug is ready for execution with Procfile

How Heroku Works
• Running applications on dynos

• Dynos are isolated, virtualized Unix containers, that provide the
environment required to run an application

• When an application is deployed, Heroku loads the slug into dynos,
and execute the command in the Procfile

• User can scale the app by adding/removing dynos

How Heroku Works
• Heroku Python tutorial:

https://devcenter.heroku.com/articles/getting-started-with-python

IaaS vs PaaS
• IaaS provides virtual machine images of different OS

• These images can be tailored to run any custom or packaged
application

• User is responsible for both setup and maintenance of the application

IaaS vs PaaS
• IaaS provides virtual machine images of different OS

• These images can be tailored to run any custom or packaged
application

• User is responsible for both setup and maintenance of the application

• PaaS allows applications to be deployed straight to a
managed virtual environment
• No need to manage the underlying virtual machines
• Less flexibility

IaaS vs PaaS
• IaaS provides virtual machine images of different OS

• These images can be tailored to run any custom or packaged
application

• User is responsible for both setup and maintenance of the application

• PaaS allows applications to be deployed straight to a
managed virtual environment
• No need to manage the underlying virtual machines
• Less flexibility

• Prices for IaaS offerings are often lower than PaaS

Overview
• PaaS

• Data Storage in the Cloud

Data Storage in the Cloud
• Cloud data storage be used in many different ways

• Store your machine images, your applications and your data
• Back up local data
• Serve as a virtual disk that can be synchronized and distributed to

other computers
• Provide data directly to clients

• Example: Amazon Simple Storage Service (S3)
• Provides cloud storage through web service interfaces

Amazon S3
• Object: fundamental entity stored in S3

• Each object can range from 1 byte to 5 TB
• Each object has object data and metadata

• Bucket: fundamental container in S3 for data storage
• Objects are uploaded into bucket
• No limit to the number of objects

Usage of Amazon S3
• Create a bucket to store data

• Upload (write) data object into the bucket

• Download (read) data object stored in the bucket

• Delete a data object

• List data objects in a bucket

Usage of Amazon S3

https://www.youtube.com/watch?v=Yyraql9A_Rc

Amazon S3 Outage
• February 28, 2017: S3 service outage from Amazon’s

Northern Virginia data center for about 5 hours, starting
from 12:37 EST.
• Caused disruption for many internet-based services

Amazon S3 Outage
• Many websites affected

Amazon S3 Outage
• Internet-connected devices failed

• E.g., security cameras not recording vide footage

Amazon S3 Outage
• Amazon was unable to update its service health dashboard,

because its admin console also depends on S3

Amazon S3 Outage
• Caused by a typo

• “an authorized S3 team member … executed a command which
was intended to remove a small number of servers ….
Unfortunately, one of the inputs to the command was entered
incorrectly and a larger set of servers was removed than intended”

• https://aws.amazon.com/message/41926/

Lessons Learned
• Not to put all eggs in one basket

• Replicate data across multiple regions (data centers) of Amazon
Web Service

• Or data replication across multiple cloud providers