The document discusses cloud computing and designing applications for scalability and availability in the cloud. It covers key considerations for moving to the cloud like design for failure, building loosely coupled systems, implementing elasticity, and leveraging different storage options. It also discusses challenges like application scalability and availability and how to address them through patterns like caching, partitioning, and implementing elasticity. The document uses examples like MapReduce to illustrate how to build applications that can scale horizontally across infrastructure in the cloud.
4. Business Benefits of Cloud Computing
Almost zero upfront infrastructure investment.
Just-in-time infrastructure.
More efficient resource utilization.
Usage based costing.
Reduced time to Market.
7. Challenges Faced by Apps in the
Cloud
Application Scalability
Cloud promises rapid (de)provisioning of resources.
How do you tap into that to create scalable systems?
Application Availability
Underlying resource failures happen
… usually more frequently than in
traditional data centers.
How do you overcome that to create highly available systems?
8. The Scalability Challenge
Two different components to scale:
State (inputs, data store, output)
Behavior (business logic)
Any non-trivial application has both.
Scaling one component means scaling the other, too.
9. Scalability Considerations
Performance vs Scalability
Latency vs Throughput
Availability vs Consistency
How do you manage overload ?
10. Scalable Service
A scalable architecture is critical to take advantage of scalable
infrastructure.
Characteristic of Scalable Service:
Increasing resources results in a proportional increase in performance
A scalable service is capable of handling heterogeneity
A scalable service is operationally efficient
A scalable service is resilient
A scalable service becomes more cost effective when it grows.
11. 1. Design for Failure
and nothing will really fail
Avoid single points of failure
Assume everything fails and design backwards.
Applications should continue to function even if the physical hardware fails
or removed or replaced.
12. Design for Failure contd..
Unit of failure is a single host
Where possible, choose services and infrastructure that assume host failures
happen.
By building simple services composed of a single host, rather then multiple
dependent hosts, one can create replicated service instances that can
survive host failures.
Make your services small and stateless.
Relax consistency requirements.
13. 2. Build Loosely Coupled Systems
The looser they’re coupled, the bigger they scale
Loosely Coupled Dependencies
Avoid complex design and interactions.
Best Practices:
Tiered Architecture
Scale out units
Single role
14. 3. Implement Elasticity
Elasticity is fundamental property of cloud
Ability to add and remove capacity as and when it is required.
Use Elastic Load Balancing.
Use Auto-Scaling (free)
15. 4. Build Security in every layer
Design with security in mind
Encrypt data at rest.
Encrypt data at transit (SSL)
Consider encrypted file system for sensitive data.
Rotate your credentials, Pass in arguments encrypted.
Use MultiFactor authentication.
Restrict external access to specific IP ranges.
16. 5. Don’t Fear Constraints
Re-think architectural constraints
More RAM? – Distribute load across machines. Shared distributed cache.
Better IOPS on database – Multiple read-only / Sharding.
Performance – Caching at different levels
17. 6. Think Parallel
Serial and Sequential is now history
Experiment different architectures in parallel
Multi-threading and Concurrent requests to cloud services.
Run parallel Map Reduce Jobs
Use Elastic Load balancing to distribute load across multiple servers.
Decompose job into its simplest form – and with “Shared Nothing”
18. 7. Leverage many storage options
One Size does not fit all
Amazon S3 / Azure Blob – Large Static Objects
Amazon Simple DB / Azure Tables – Data indexing and Querying
Amazon RDS / SQL Azure – RDMBS Service – Automated and Managed
MySQL/Azure
Amazon Cloud Front / Azure CDN – Content Distribution
19. Cloud Architecture Lessons
Design for failure and nothing fails.
Loose coupling sets you free.
Implement Elasticity.
Build Security in every layer.
Don’t fear constraints.
Think Parallel.
Leverage many storage options.
40. The Availability Challenge
Availability: Tolerate failures
Traditional IT focuses on increasing MTTF
Mean Time to Failure
Cloud IT focuses on reducing MTTR
Mean Time to Recovery
41. Data modelling
Classic distributed systems focused on ACID semantics
Atomicity: either the operation (e.g., write) is performed on all
replicas or is not performed on any of them
Consistency: after each operation all replicas reach the same state
Isolation: no operation (e.g., read) can see the data from another
operation (e.g., write) in an intermediate state
Durability: once a write has been successful, that write will persist
indefinitely
Modern Internet Systems – focused on BASE
Basically Available
Soft-state (or scalable)
Eventually consistent
42. CAP Theorem
Any distributed system has three properties – CAP
Strong Consistency: all clients see the same view, even in the presence of
updates
High Availability: all clients can find some replica of the data, even in the
presence of failures
Partition-tolerance: the system properties hold even when the system is
partitioned
As per CAP theorem you can only have two of these three properties. Choice
of which feature to discard determines the nature of your system.
43. Map Reduce
Model for processing large data sets.
Many tasks composed of processing lots of data to produce lots of other
data
Want to use hundreds or thousands of CPUs... but this needs to be easy!
Contains Map and Reduce functions.
44. Programming model
Input & Output: each a set of key/value pairs
Programmer specifies two functions:
map (in_key, in_value) -> list(out_key, intermediate_value)
Processes input key/value pair
Produces set of intermediate pairs
reduce (out_key, list(intermediate_value)) -> list(out_value)
Combines all intermediate values for a particular key
Produces a set of merged output values (usually just one)
52. Conclusion – Map Reduce
MapReduce has proven to be a useful abstraction
Greatly simplifies large-scale computations
Fun to use: focus on problem, let library deal w/ messy details