Utilizing Amazon S3 and Ec2 in Rails: Jonathan Weiss, Peritor Wissensmanagement GMBH Railsconf Europe Berlin, 2007
Utilizing Amazon S3 and Ec2 in Rails: Jonathan Weiss, Peritor Wissensmanagement GMBH Railsconf Europe Berlin, 2007
Utilizing Amazon S3 and Ec2 in Rails: Jonathan Weiss, Peritor Wissensmanagement GMBH Railsconf Europe Berlin, 2007
in Rails
One machine:
• Apache
• Ruby / Rails
• MySQL
2
Worst Case Populariy
3
A Difficult Path
4
Problem: Backup
• High availability
• Redundancy
5
Problem: File System
6
Problem: Spontaneous Traffic
7
Problem: Load Fluctuation
8
Don‘t reinvent the wheel!
9
Amazon Web Services
10
S3 - Simple Storage Service
• Organized in „Buckets“
• Downloads via
• Web Service
• HTTP / HTTPS
• BitTorrent
11
S3 - Buckets
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
S3 with AWS::S3
Upload
Download
13
EC2 - Elastic Compute Cloud
14
EC2 Tools
List availabe images
Shutdown instance
15
amazon-ec2 gem
Setup
Usage
16
And now?
17
S3 - Backup
• s3sync.rb • S3Browser
• Jungle Disk •…
• S3 FUSE
• s3DAV
• Duplicity
18
s3sync.rb
Backup
Restore
19
S3 Asset Host
20
S3 Asset Host
Setup DNS
Rails configuration
21
S3 Asset Host
welcome.rhtml template
Output
22
S3 - Authenticated User Data
23
attachment_fu Rails plugin
Setup
24
attachment_fu Rails plugin
Upload
Download
25
On-Demand Computing with EC2
26
On-Demand Computing with EC2
27
On-Demand Computing with EC2
28
EC2 for extra capacity
29
Load Balancer / Proxy
Example mod_proxy_blancer:
• Central Proxy/Load-Balancer
configuration that has knowledge
about nodes
30
Swiftiply
Swiftiply Proxy:
No re-configuration
31
Swiftiply Proxy
Installation Configuration
Start
32
Swiftiplied Mongrel
• Experimental
Start
or
33
EC2 on Demand before Swiftiply
34
EC2 on Demand with Swiftiply
35
EC2 on Demand with Swiftiply
36
Ressources
• Swiftiply
http://swiftiply.swiftcore.org
• Attachment_fu
http://svn.techno-weenie.net/projects/plugins/attachment_fu/
• Elastic Rails
http://www.elasticrails.com
• Capazon
http://capazon.rubyforge.org
• RightScale
http://www.rightscale.com
37
Peritor Wissensmanagement GmbH
Lenbachstraße 2
12157 Berlin
Internet: www.peritor.com Telefon: +49 (0)30 69 40 11 94
Email: info@peritor.com Telefax: +49 (0)30 69 40 11 95