Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Cloud Patterns Beuth Hochschule

656 views

Published on

Sh

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Cloud Patterns Beuth Hochschule

  1. 1. CLOUD ARCHITECTURE Sascha Möllering | zanox AG
  2. 2. Sascha Möllering sascha.moellering@zanox.com Lead Engineer / DevOps Hipster zanox AG http://autoscaling.io @sascha242 ABOUT ME
  3. 3. JAVA MAGAZIN 11.14 ARCHITEKTUR IM KONTEXT DER CLOUD: PATTERNS UND BEST PRACTICES AWS VIRTUAL CLOUD SUMMIT CONTINUOUS DELIVERY IN AWS USING DOCKER ENTWICKLER SPEZIAL: DOCKER ÜBER DEN WOLKEN: EIN ERFAHRUNGSBERICHT ZUM DOCKER- EINSATZ IN DER AMAZON CLOUD ABOUT ME
  4. 4. AGENDA ●AWS Overview ●Creating a cloud service ●Real World example ●Cloud deployment ●Q&A
  5. 5. HOW CAN WE SCALE?
  6. 6. HOW CAN WE SCALE?
  7. 7. AWS OVERVIEW RegionUS-WEST (N. California) EU-WEST (Ireland) ASIA PAC (Tokyo) ASIA PAC (Singapore) US-WEST (Oregon) SOUTH AMERICA (Sao Paulo) US-EAST (Virginia) GOV CLOUD ASIA PAC (Sydney) EU-CENTRAL (Frankfurt)
  8. 8. AWS OVERVIEW Availability Zone
  9. 9. AWS OVERVIEW EC2: Resizable compute capacity AutoScaling: scale up or down Route 53: Domain Name System ELB: Load Balancing Elastic IP: Static IP address
  10. 10. AWS OVERVIEW RDS: Managed database service DynamoDB: NoSQL implementation Redshift: data warehouse solution ElastiCache: Managed cache Kinesis: Service for streaming data
  11. 11. AWS OVERVIEW S3: Highly-scalable object storage CloudFront: CDN implementation CloudWatch: Monitoring service IAM: Identity and Access Management EMR: Managed Hadoop
  12. 12. STARTING POINT ●How can we leverage the Cloud? ●Our application: ● Simple Java based web application ● One application ● One database ● Runs in our own DC
  13. 13. CREATING A CLOUD SERVICE ●Initial setup: ●Route53 for DNS ●One Elastic IP (static IPs for the Cloud) ●One EC2 instance ● Web Application ● Database ●One AZ
  14. 14. CREATING A CLOUD SERVICE Availability Zone
  15. 15. CREATING A CLOUD SERVICE ●Simple approach to scale: ●More RAM ●More CPU power ●More IOPS ●Different EC2 instance type ●Approach will hit a barrier
  16. 16. CREATING A CLOUD SERVICE ●Problems: ●No failover ●No redundancy ●Database and application on one instance ●Does not scale very well
  17. 17. CREATING A CLOUD SERVICE ●Separate Web Application from DB ●One EC2 instance for the Web Application ●One EC2 instance for the DB ●Or: Managed DB service (RDS) ●One AZ
  18. 18. CREATING A CLOUD SERVICE Availability Zone Database
  19. 19. CREATING A CLOUD SERVICE ●Problems: ●No failover ●No redundancy ●Does still not scale very well
  20. 20. CREATING A CLOUD SERVICE ●Add an ELB ●Add EC2 instance for Web Application ●Different AZs ●Standby DB instance ●Multi AZ setup in RDS
  21. 21. CREATING A CLOUD SERVICE
  22. 22. CREATING A CLOUD SERVICE Availability Zone Database Availability Zone Database
  23. 23. CREATING A CLOUD SERVICE ●Problems: ●Still limited scaling capabilities ●If one EC2 instance crashes, 50% less capability
  24. 24. CREATING A CLOUD SERVICE ●Add additional EC2 instances ●Add read replicas in RDS
  25. 25. CREATING A CLOUD SERVICE Availability Zone Database Availability Zone Database
  26. 26. CREATING A CLOUD SERVICE ●Problems: ●Naive implementation ●Does not leverage AWS services ●Limited scaling ●Can be quite expensive
  27. 27. CREATING A CLOUD SERVICE ●Refactoring ●Introduce caches to take load from DB ●Use S3 and CloudFront to ship static content ●Store session data in DynamoDB ●Add Autoscaling
  28. 28. CREATING A CLOUD SERVICE ●Autoscaling ●Automatic resizing of compute clusters based on demand ●Integrated to Amazon CloudWatch ●Maximum and minimum pool sizes ●Autoscaling policies triggered by CloudWatch alarms
  29. 29. CREATING A CLOUD SERVICE Availability Zone Auto Scaling group
  30. 30. CREATING A CLOUD SERVICE ●Started with a simple web application ●Added several Amazon services ●Managed to shift load from application to services ●Added caches and CDN ●Added Autoscaling
  31. 31. CREATING A CLOUD SERVICE ●Next steps: ●SOA ●Loose coupling: decouple interactions ●Amazon services, don‘t reinvent the wheel ●Database federation ●Database sharding
  32. 32. REAL WORLD EXAMPLE ●Elastic architecture that grows and shrinks ●Multiple AZs ●Use case: streaming data ●Decoupling using Kinesis ●IAM Roles for managing credentials ●CloudWatch for monitoring
  33. 33. Internet Auto Scaling group Auto Scaling group Availability Zone Availability Zone ARCHITECTURE
  34. 34. ARCHITECTURE
  35. 35. “Vert.x is a lightweight, high performance application platform for the JVM that's designed for modern mobile, web, and enterprise applications.” Vert.x
  36. 36. ARCHITECTURE ●Main framework Vert.x ●mod-kinesis (Kinesis-Adapter for Vert.x) ●AWS Java SDK ●IAM roles for Amazon EC2 instances ●Coda Hale metrics and CloudWatch reporter ●Jedis (Redis client for Java) ●…
  37. 37. DEPLOYMENT Workstation GitHub Jenkins Python/Fabric Nexus Datacenter Artefakt
  38. 38. DEPLOYMENT EC2 instance with Docker registry (port 5000) S3 bucket to store Docker images
  39. 39. DEPLOYMENT Amazon Cloud Workstation GitHub Jenkins Python/Boto Docker Image Docker Registry S3 bucket with Docker Images
  40. 40. DEPLOYMENT
  41. 41. DEPLOYMENT
  42. 42. EC2 INSTANCES AND ELB python start_docker_instance.py -r <myregistry>:5000 -i tracking-ppv -t 95 -q 2 -s quality -d '-d -p 8080:8080' https://github.com/SaschaMoellering/aws-docker- scripts
  43. 43. EC2 INSTANCES AND ELB python start_elb.py -r <myregistry>:5000 -i tracking-ppv -t 95 -s quality -d '-d -p 8080:8080' https://github.com/SaschaMoellering/aws-docker- scripts
  44. 44. EC2 INSTANCES AND ELB
  45. 45. EC2 INSTANCES AND ELB
  46. 46. DEPLOYMENT ●Amazon EC2 Container Service (ECS): ● Container management service ● Fast ● Highly scalable ● Supports Docker
  47. 47. DEPLOYMENT ●Cluster ●Container Instance ●Task Definition ●Task ●Container
  48. 48. DEPLOYMENT
  49. 49. DEPLOYMENT
  50. 50. DEPLOYMENT
  51. 51. DEPLOYMENT #!/bin/bash echo ECS_CLUSTER = your_cluster_name >> /etc/ecs/ecs.config
  52. 52. DEPLOYMENT
  53. 53. DEPLOYMENT
  54. 54. DEPLOYMENT
  55. 55. DEPLOYMENT
  56. 56. DEPLOYMENT
  57. 57. DEPLOYMENT
  58. 58. DEPLOYMENT
  59. 59. DEPLOYMENT

×