$30 off During Our Annual Pro Sale. View Details »

AWS small talk

AWS small talk

simple talking of how we use amazon aws services for our rails application

Jimmy Huang

December 01, 2016
Tweet

More Decks by Jimmy Huang

Other Decks in Programming

Transcript

  1. AWS Small Talk

  2. None
  3. Amazon Services EC2 S3 SES Cloudfront

  4. EC2 Amazon Elastic Compute Cloud (Amazon EC2) is a web

    service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Virtual Servers, scalable computing capacity
  5. None
  6. None
  7. EBS Amazon Elastic Block Store (Amazon EBS) provides persistent block

    storage volumes for use with Amazon EC2 instances in the AWS Cloud. Each Amazon EBS volume is automatically replicated within its Availability Zone to protect you from component failure, offering high availability and durability. EBS is mountable storage; it can be mounted as a device to an EC2 instance. Multiple EBS “drives” can be mounted to one EC2 instance, and they can be then striped and/or mirrored into a larger volume using software RAID Hard driver
  8. Install the command tools, database, web server etc to launch

    your Rails app
  9. EC2 for Arcane 3 instances Host in eu-west (Ireland) Benchmark

    by sysbench (CPU, IO) Web performance bench by apache & ab
  10. Price

  11. What the f**k ?

  12. S3 Amazon S3 (Simple Storage Service) is an web service

    offered by Amazon Web Services. Amazon S3 provides storage through web services interfaces (REST, SOAP, and BitTorrent). Public folder on cloud
  13. None
  14. https://s3-eu-west-1.amazonaws.com/arcane-production/uploads/user/logo/10/%E9%98%BF%E8%BF%AA%E5%B0%8F%E5%B8%BD1.jpg

  15. None
  16. None
  17. S3 & Rails gem ‘carrierwave’ gem ‘carrierwave-aws’ gem ‘fog’ (gem

    ‘fog-aws’)
  18. None
  19. None
  20. None
  21. CloudFront Amazon CloudFront is a content delivery network (CDN) offered

    by Amazon Web Services. Content delivery networks provide a globally-distributed network of proxy servers which cache content, such as web videos or other bulky media, more locally to consumers, thus improving access speed for downloading this content.
  22. None
  23. /uploads/campaign/ cloud_music/814/EXTSY%27s%20Addicted%20Radio%20%23091.mp3 https://arcane-production.s3-eu-west-1.amazonaws.com https://d15k0o6rdrjcy5.cloudfront.net

  24. CloudFront & Rails

  25. SES Amazon Simple Email Service (Amazon SES) is a cost-

    effective email service built on the reliable and scalable infrastructure that Amazon.com developed to serve its own customer base. Email service, send and receive email
  26. None
  27. None
  28. SES & Rails

  29. Tips (ଗᨵ҂

  30. Host assets: CloudFront > S3 > EC2

  31. Don’t use S3 to save “temporary files”

  32. Backend Job for transferring file from EC2 -> S3 sidekiq,

    resque
  33. Don’t use carrierwave default way to upload big file to

    cloud
  34. Decide the S3 bucket name as early as possible if

    you or client has compulsion
  35. Use s3cmd command tool to operate s3 bucket and files

  36. Use presigned url for S3 resource downloading

  37. Back up your database to S3 (use Backup gem) https://github.com/damm/backup

    backup perform -t arcane_local_backup -r /home/jimmy/Backup
  38. Configure your SES bounce & complaint notification

  39. – Jimmy @ekohe “Thanks, AWS”