Title: Developing Cloud Computing Applications with Open Source Technologies
1Developing Cloud Computing Applications with Open
Source Technologies
- Shlomo Swidler
- CTO co-Founder mydrifts.com
- 1 December 2008
2Agenda
- Open Source and Cloud Computing a great match!
- Challenges faced by developers in the cloud...
- ... and open source solutions
3- Marketing platform for indie music promotion
- Help indie musicians find fans among social
network users - Cloud-based, using open source solutions
- Professional Services and Consulting
- Cloud computing, scalable web applications
4Open Source and Cloud Computing
- Same motivation low ongoing costs
- mydrifts.com chose Amazons EC2
- Rich set of complementary tools
- Many open source projects, too
- Freedom to choose OS, language, DB - the entire
stack - Choice of hardware
5Challenges Faced by Developers in the Cloud
HOW?
6Developing Scalable Cloud Applications
- Optimize your database
- Use caching
- Use service pools
7Typical Application Architecture Three Tiers
Load Balancer
Client
Web Tier
Database Tier
BusinessLogic Tier
8Scaling the Database Tier Optimize Queries
- Optimize your database
- Know your queries
- Know your indexes
- De-normalize tables where needed
- Open-source (MySQL)
- Use the slow query log
- EXPLAIN SELECT is your friend
- MySQL has query analysis tools ()
Database Tier
9Scaling the Database Tier Cache
- Cache to reduce database hits
- Not just query results
- Objects, partially rendered pages, etc
- Open-source
- memcached
DB
Database Tier
10memcached
- Distributed in-memory cache
- Extremely low CPU usage
- Used by facebook, Wikipedia, Amazon, Yahoo, etc.
- Use leftover memory on a machine to serve as
cache - Great for cloud instances
memcached server A
memcached server B
DB
memcached server C
11Application with Scalable Database Tier
Load Balancer
Client
DB
cache
Database Tier
Web Tier
BusinessLogic Tier
12Anatomy of the Business Logic Tier
- Components have different resource usage
- Requests flow through different components
- Limited scaling granularity
13Scaling the Business Logic Tier Service Pools
Pool A
Pool B
Pool C
Pool D
- Separate homogeneous pools of instances
- Each pool of services is independently scalable
14Architecture of Service Pools
Status Logger
Msg Queue
Msg Queue
Pool Manager
Pool
status
status
Service
Service
Service
Ingestor
Message Queue
Message Queue
work request
input
input
output
Storage
15Scalable Business Logic Tier
Pool B
Pool A
Service
Service
Service B
Service
Service
Service A
DB
cache
Pool C
Service
Service
Pool D
Service C
Service
Service
Service D
Database Tier
16Open Source Service Pools on Amazon EC2
- Lifeguard (Java) http//code.google.com/p/li
feguard see http//developer.amazonwebservic
es.com/connect/entry.jspa?externalID915 - Kato (Ruby) http//rubyforge.org/projects/ka
to/ - Implemented using boto (Python) see
http//developer.amazonwebservices.com/connect/ent
ry.jspa?externalID691
17Scalable Cloud Application Architecture
Load Balancer
Pool
Client
DB
cache
Pool
Database Tier
Web Tier
BusinessLogic Tier
18Q A
19Developing Cloud Computing Applications with Open
Source Technologies
Shlomo Swidler shlomo.swidler_at_mydrifts.com