This document discusses using Amazon S3 and EC2 services with Ruby on Rails applications. It describes S3 as a redundant storage service that can be used for file storage and backups. EC2 is described as an on-demand computing service that provides virtual servers running Linux. The document provides examples of using S3 for asset hosting, backups, and user data storage with Rails applications. It also demonstrates how EC2 can be used to add computing capacity when needed and discusses load balancing across EC2 instances.
10. Amazon Web Services
Simple Storage Service - S3 Elastic Compute Cloud - EC2 E-Commerce S..
Redundant Data Store Virtual server per hour …….
$0,15 per GB data per month $0,10 per CPU hour
$0,10 - $0,20 per GB traffic $0,10 - $0,20 per GB traffic
10
11. S3 - Simple Storage Service
• Redundant storage - as much as you like
• max. 5 GB per object
• Organized in „Buckets“
• Web Service API for uploads
• Downloads via
• Web Service
• HTTP / HTTPS
• BitTorrent
11
12. S3 - Buckets
S3
• Unique over all S3
• Contains many
MyBucket_name www.peritor.com
key-value-metadata tupel
foto_5.jpg site/screen.css
• Cannot contain other buckets!
backups/januar.zip site/script.js
• Key can contain „/“ fotos/2007/001.png FreeBSD-6.2.iso
12
14. EC2 - Elastic Compute Cloud
• Based on XEN virtualization
• On demand virtual servers - controlled with Web Service API
• 1,7 GHz
• 1,75 GB RAM
• 160 GB local file system (not persistent!)
• Use your favorite Linux distro (Linux 2.6.16),
Amazon Machine Images (AMI) are stored on S3
• ACLs for hosts/ports access control
14
15. EC2 Tools
List availabe images
Start a new instance
Login with SSH
Shutdown instance
15
30. Load Balancer / Proxy
Example mod_proxy_blancer:
• Talks to multiple backend servers
(Mongrel)
• Central Proxy/Load-Balancer
configuration that has knowledge
about nodes
• Typically proxy restart on config
change
30
31. Swiftiply
Swiftiply Proxy:
• Multiple backend clients have a
persistent connection to the backend
port
• Proxy listens on cluster port for
requests and forwards them
No re-configuration
31