DFW Amazon WS Dev Garage

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

2 Νοε 2013 (πριν από 3 χρόνια και 7 μήνες)

65 εμφανίσεις

DFW Amazon WS Dev Garage

Cloud Computing, Web services, etc.


Hosted

Raymond Gao

Saturday, August 1
st
, 2009

Agenda of the Day

9


9:30 A.M. Introduction

9:30


10:15 A.M. Setting up the Environment

10:15


10:30 Break

10:30


11:30 Emergsoft Presentation

11:30


Noon Miscellaneous Discussion

Noon


1:30 P.M. Lunch Break

1:30


4:00 Lab, Networking, Idea Exchange


Infrastructure
Discussion


Personal Impetus ?

I want to develop a Facebook Application

Can’t forecast usage curve

Need a Static IP address

Other Constraints

Save money


Easy to setup and immediate availability

Curiosity

Cloud Computing
Providers

Amazon EC2


Classic Approach

Google App Engine


Developer Approach

Microsoft Azure


Microsoft Stack Approach

Rackspace Cloud


Classic Approach

Heroku


Ruby on Rails only Approach

Zembly.com


Social Programming Approach

RightScale

Virtual Machine Configuration and Deployment

Amazon Cloud
Computing

VM Images based approach

Linux: Fedora, Ubuntu, Solaris, SUSE, Centos, …

Microsoft Windows

Allows customizations of VM Images

Easy to start, and nice Management Console

Proven technology for production sites

Requires system administration knowledge, e.g.

Opening firewall ports

Support mainly through Message Forum, paid telephone support plan is available

Instance Types
-

http://aws.amazon.com/ec2/instance
-
types/


Google App Engine

Basic usage is free,
-

limited to 1 GB storage and data
transfer & 6.5 CPU hr, Over the quota costs money

Only supports Python and Java Programming
Languages, no Ruby or C#

Must learn Google App Engine API and GQL (Google
Query Language)

Was down for six hours straight several weeks ago

Fairly basic administrative features

Microsoft Azure


Pure Microsoft technology stack

Windows Azure OS, SQL Server, Live, .Net, SharePoint

Will available at the of 2009

Supports only Visual Studio 2008, (limited PHP
supported through 3
rd

party libraries)

Does not support Linux, or Mac

Rackspace Cloud

Similar to the Amazon Cloud Offering

Has some cheaper options for tiny VMs, e.g.

1.5 cents/hour for 256 Meg machine (which is pretty
useless)

More expensive for the large instances

Based in San Antonio, with 24x7 paid telephone
support



Heroku

Ruby On Rails only application hosting provider

Has a proprietary way of deploying applications into
Heroku grid with Git (source code control system)

No need of system administration knowledge, e.g.
maintaining patches and applying updates.

Unique pricing (4 dynos = 1 CPU), more expansive
than Amazon EC2 (paying for system admin)

Social Application Development

Turns application modules into widgets

Allows people to share widgets

Has several templates for creating cookie
-
cutter
Facebook applications (great for building simple
applications)

Owned by Sun Microsystem, Inc.

Six month free for Pro account during Beta

Zembly

Infrastructure Technologies

Application Technologies

Payment Technologies

Merchant Technologies


Amazon Offerings

Amazon Technologies

Amazon Infrastructure
Offerings

Elastic Computing Cloud (EC2)


Computation
-
on
-
demand

Simple DB (Alternative to maintaining a database, …)

Simple Storage Service (S3)


External attached storage

Cloud Front


Similar to Akamai, put data center near the
geography

Simple Queue Service (SQS)


Messaging Bus

Elastic MapReduce


Work Flow Management Tool,
schedule job flow between different servers


Amazon Application
Technologies

Using Amazon as a source of content and a catalog

Product Advertising API


Search Against Amazon
listings, wishing list, etc. Uses Web Services

Payment & Billing System

DevPay


Using Amazon as a billing system for
subscriptions.

Flexible Payment System


Amazon’s alternative to
Paypal, for transfering fund between two or more
parties.


Other Amazon
Offerings

Mechanical Turk


Ad Hoc Human labors

Alexa Web Information Service


alternative to
Google Analytics, returns website load, ranking,
traffic analysis, visitor statistics, etc.

Fulfillment Services (Merchant Services)


Use
Amazon Fulfillment Center to ship, store, and track
item and deliveries


Setting up Amazon Web
Services Account

Pre
-
requisites

SSH client


Putty.exe on Windows, built
-
in in Mac and
Linux

To
-
do

Access Key

Secret Key

X.509 Certificate

Private Key

Public Key

Account Page

Getting AWS Access
Identifiers


Access Key


Secret Key


X.509 Certificate files (Self
-
signed)


Public


Private

Amazon WS
Management Console

Allows


Start / Stop / Pause a VM
instance


Manage Firewall ports


Add S3 storage


Take snapshot of volumes &
VMs


Create Security Group and
Key Pair (Amazon use secure
key to manage access to VM
via SSH), This is different
from X509 keys.


Control Job Flow between
VMs


CloudFront Services
(pushing data to the edge of
network)

Developing App that
connects to Amazon

Get Product information:

Images

Product details

Reviews

Editorials

Search by UPC, Title, Keyword, etc.

Make money from referring to Amazon Products

Retrieve Items from Wish list, etc.

Benefits of Connecting
to Amazon

Classic Web Services Approach

WSDL based lookup (Request/Response)

Available for Following Countries

Canada

France

Germany

Japan

UK

USA

Details

Developer’s Documentation:

http://docs.amazonwebservices.com/AWSECommerceService/2009
-
06
-
01/DG/

Find an item
-

http://docs.amazonwebservices.com/AWSECommerceService/2009
-
06
-
01/DG/FindingItems.html

Item detail
-

http://docs.amazonwebservices.com/AWSECommerceService/2009
-
06
-
01/DG/FindingOutMoreAboutanItem.html

Seller Information
-

http://docs.amazonwebservices.com/AWSECommerceService/2009
-
06
-
01/DG/GettingSellerInformation.html

Shopping Cart
-

http://docs.amazonwebservices.com/AWSECommerceService/2009
-
06
-
01/DG/ImplementingaShoppingCart.html

Other Documentations

http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2667&c
ategoryID=19


Visual View of the
PAAPI

Available Categories

Available Operations

See:
http://docs.amazonwebservices.com/AWSECommerceService/2009
-
06
-
01/DG/


My Project


DVD Flex

Running as a Facebook Application

http://apps.facebook.com/dvdflex

Enter a UPC code find your friends DVD, share, exchange, export,
or find a torrent

Technical Details

Ruby on Rails Application

Consumes Web Services and JSON

Running on Mongrel Cluster and Pound (moving to Passenger + Ngnix)

Source code on Git Hub

http://github.com/raygao/dvdflex/tree/master



Screenshot of DVDFlex

Install

MySQL

Ruby & Rails 2.2.2

Ruby Gems

MySQL

Ruby
-
AAWS

Facebooker

Facebooker Authentication

Tunnlr

Excel

Setting Up your
machine

Install Git

Download My Application Source Code

http://github.com/raygao/dvdflex/tree/master


Configure the application

Facebooker.yml

Tunnlr.yml

Database.yml

Get My Application

Install

Pound

Mongrel

Configure Pound & Mongrel

Create the ‘pound.conf’ file

Create the ‘mongrel_cluster.yml’ file

Deploying the
Application

Pre
-
requisites:

Mac

Language packages from Dev CD installed

Wget

MS Windows

Cygwin

Unzip, ruby, Python, Wget

Linux

It’s already included

See
http://wiki.emergsoft.com/index.php/Special:Search?searc
h=Prerequisites&go=Go



Use EmergSoft Pre
-
requisites

My Recipes

Install Rails

Install NetBeans 6.5 on Ubuntu

Create Facebook Application

Use EmergSoft Recipe
to setup your Dev Env.

Prerequisite: Ruby 1.8.7

Installation: gem install ruby
-
aaws

API Documentation


http://www.caliban.org/ruby/ruby
-
aws/


Using Ruby
-
AAWS to
Search Against Amazon

Create App Using
NetBeans

Each request needs:

AssociateTag


gives you credit for the sale through
shopping cart

SubscriptionId / AWSAccessKeyId

key to use Amazon
PAAPI

ContentType: text/xml, or text/html

Operation


ItemLookup, ItemSearch, …

Service


always AWSECommerceService

Version


Version of the API

Amazon Product
Advertising API

http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&Version=2005
-
03
-
23&Operation=ItemLookup&SubscriptionId=1D5H84BYKDE3XKW4QSR2&AssociateTag=dvdflare4us
-
20&SearchIndex=DVD&ItemId=794043100918&IdType=UPC&ResponseGroup=Medium,Small


Use ItemLookup as an example

Create Request with Your Amazon Key and Associate ID

Specify locale

Create ItemLookup Object, including type of search, index,
and search parameter

Escape special characters

Perform the search

Extract the content

Be careful with null value. Ruby
-
AAWs throws
Amazon::AWS::Error::AWSError exception, it is a null value.

How to Use Ruby
-
AAWS

Email:

raygao@verizon.net

Blog:

http://raysblog.are4.us


Contact me