introduction to amazon web services for developers
TRANSCRIPT
![Page 1: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/1.jpg)
Introduction to Amazon Web Services for developers
Roman Gomolko
July 2015
Ciklum Speakers Corner
![Page 2: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/2.jpg)
Let’s get acquired
![Page 3: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/3.jpg)
UserReport
● Developing products that allow to learn the audience
● Started using AWS more than 5 years ago
● Fully migrated to AWS more than 1.5 years ago
● Processing 3 billions requests monthly
● Generating reports based on 8 billions of requests with batched reports
● Online reports on 300 millions of records
● Used ~50% of services provided by AWS
● Totally happy regarding using AWS
![Page 4: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/4.jpg)
Cloud Computing
Cloud computing is a model for enabling access to a shared pool of configurable computing resources
![Page 5: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/5.jpg)
Typical Cloud benefits
● Pay for what you are using
● High scalability - retrieve as many resources as you need
● High availability
● Gartner's Hype cycle – cloud computing has reached a maturity
![Page 6: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/6.jpg)
Cloud models
● IaaSInfrastructure like physical (rarely) or virtual servers, storage, networking, load balancers, IP addresses allocation etc
● PaaSHosted databases, pre-configured web-servers that can run your application, platforms that can run your code
● aPaaSTools and services that automates and facilitates utilizing Cloud Services. Providing tools for development, deployment, monitoring etc
● SaaSGmail, MailChimp, Highrise, Google photo, Jira Cloud etc
![Page 7: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/7.jpg)
Amazon Web Services
IaaSPaaS
aPaaSSaaS
![Page 8: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/8.jpg)
![Page 9: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/9.jpg)
Naming convention
● Everything is Elastic
● Everything is Simple
● DRY
Elastic Compute Cloud = ECC = EC2
Simple Storage Service = SSS = S3
Elastic Load Balancer = ELB
AutoScale Group = ASG
...
![Page 10: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/10.jpg)
AWS is regional
![Page 11: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/11.jpg)
AWS is regional
● Almost all services are region specific
● Pricing of services depends on region
● Not all services are available in all regions
● New services are launching in N. Virginia (US East 1) first
http://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/
![Page 12: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/12.jpg)
Regions are not solid
● Splitted into Availability Zones (AZ)
● AZs have independent power supply
● Cross-AZ network speed is blazing fast
● Some services belong to AZ, some - not
![Page 13: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/13.jpg)
Iaas basics
● EC2Virtual computers managed by XEN running on Intel CPUs
● EBSSSD or magnetic drives dynamically attached to EC2 instances with configurable size (up to 16Tb) with configurable IOPs
● ELBLoad balancing before your EC2 instances
● VPCCreating network and group your instances/services into “Private Cloud”
![Page 14: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/14.jpg)
PaaS basics
● CloudFrontCDN for downloading and streaming
● S3Infinite storage for objects (files) with security and HTTP access
● RDSHosted databases like MySQL, MS SQL, PostgreSQL, Oracle, Aurora with licenses included
● DynamoDBNoSQL database designed for high performance and availability
![Page 15: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/15.jpg)
PaaS basics
● Route53Fully managed and DNS and domain registration
● ElastiCacheFully managed hosted memcache and Redis
● SQSQueue designed for high availability and millions of messages
![Page 16: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/16.jpg)
Some more PaaS
● CloudSearchSearch engine for free-text search among millions of documents
● EMRFully managed Elastic MapReduce and Spark clusters
● Elastic Transcoder Encoding media-files in different formats with different quality
● … and more
![Page 17: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/17.jpg)
aPaaS
● CloudWatchMonitoring of your infrastructure and applications
● Elastic BeanstalkAutomated web-applications and workers hosting
● CloudFormationManage your cloud services in one place with help of text file
● CodeDeployAutomates deployment of your application
● OpsWorksChef cooked by AWS to automate provisioning and deployment
![Page 18: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/18.jpg)
SaaS basics
● SESSending e-mails from Cloud
● SNSPush notifications
● WorkMailHosted exchange server for organizations
● WorkSpacesVirtual office became reality
![Page 19: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/19.jpg)
Migration of existing web-application to AWS
DBWebServer
![Page 20: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/20.jpg)
Migration to Cloud
● One bite at a time - migration to Cloud itself is a big deal
● Cloud may have similar services to what you are using in your app. Similar is not the same.
● Usually you have application which works somehow try to keep your structure unchanged
● Less efforts, faster migration
![Page 21: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/21.jpg)
Hosting your web-application
1. Create EC2
2. Connect to it
3. Configure it
4. Deploy code to it
5. Access website
![Page 22: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/22.jpg)
Creating EC2. Choose operating system image
![Page 23: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/23.jpg)
Creating EC2. Choose instance type
![Page 24: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/24.jpg)
Creating EC2. Instance details
![Page 25: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/25.jpg)
Creating EC2. Storage
![Page 26: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/26.jpg)
Creating EC2. Tags
![Page 27: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/27.jpg)
Creating EC2. Security group
![Page 28: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/28.jpg)
Creating EC2. Review. Almost done
![Page 29: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/29.jpg)
Creating EC2. Selecting key-pair
![Page 30: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/30.jpg)
Connecting to your instance. Wait until launched
![Page 31: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/31.jpg)
Connecting to your Linux instance
Linux / Mac OS X
ssh -i "<keypair>.pem" ec2-user@<instance IP>
Windows
● convert .pem to .ppk using Putty KeyGen
● connect to instance using Putty
● refer help for more details
![Page 32: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/32.jpg)
Connecting to your Windows instance
● Wait 4-20 minutes after starting instance
● Retrieve password using you keypair
● Use Remote Desktop to connect to your instance. Use Administrator as name
● Password will expire, better create permanent user
![Page 33: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/33.jpg)
Configuring your instance as you like
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
import-module servermanager
add-windowsfeature Web-Server,
Web-WebServer, Web-Security
![Page 34: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/34.jpg)
Deploy your application
![Page 35: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/35.jpg)
Accessing your web-application
● Your public IP is not static. It will be changed after reboot
● You can request IP address and attach it to instance dynamically
● In future you can assign this IP to another instance
● Put this IP to your DNS or write to host file
![Page 36: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/36.jpg)
Database. Let’s try RDS
![Page 37: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/37.jpg)
Multi-AZ deployments for reliability
multiply hosting cost by number of AZ zones
![Page 38: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/38.jpg)
Configure your instance and DB master credentials
![Page 39: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/39.jpg)
Secure your database
![Page 40: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/40.jpg)
Take advantage of managed solutions
![Page 41: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/41.jpg)
Wait. Cloud? I need more redundancy
1. Create EC2
2. Connect to it
3. Configure it
4. Stop it
5. Create AMI
6. Launch required number of instances using this AMI
7. Deploy code to them
8. Access website
![Page 42: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/42.jpg)
Launching from you AMI
![Page 43: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/43.jpg)
Horizontal scaling of application checklist
● Data-less
● Stateless
● Shared session
● Same encryption keys
![Page 44: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/44.jpg)
Distribute traffic between instances
● DNS round-robin
● Load balancer
![Page 45: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/45.jpg)
Elastic Load Balancer
● Accept incoming traffic and distribute among instances
● Monitors instance availability
● Can accept HTTPS traffic and map to HTTP endpoint of web-server
● Allows to not expose web-servers to worldwide
● Allows Connection Draining
● Provides useful metrics like latency, requests per minute, count of 2XX, 4XX and 5XX response codes
![Page 46: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/46.jpg)
I’ve become popular. Need to scale
Instance roles:
● Web/front-end
● Worker/back-end
● DB
Scaling strategies:
● Vertical scaling
● Horizontal scaling
![Page 47: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/47.jpg)
Vertical scaling
● Good if your bottleneck is CPU, RAM or disk
● Can be done with downtime or without it
![Page 48: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/48.jpg)
Vertical scaling of EC2.
● Simple - downtime
○ Stop
○ Change instance type
○ Start
● Complex - no downtime
○ Launch new instance with required instance type
○ Switch traffic from old instance to new one
![Page 49: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/49.jpg)
Vertical scaling of RDS
● Can be done without downtime in case of Multi-AZ deployment
● Not that fast in any way
![Page 50: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/50.jpg)
Where is fun stuff?
![Page 51: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/51.jpg)
I want to be Elastic
![Page 52: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/52.jpg)
AutoScale groups
Launch configuration - how your instance will look like
AutoScale group - control how many instances will be in your group
![Page 53: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/53.jpg)
Launch Configuration - customize instance bootstrap
![Page 54: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/54.jpg)
AutoScale group
![Page 55: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/55.jpg)
AutoScale Group - scaling policies
![Page 56: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/56.jpg)
Finally
● AWS can scale our application automatically looking on CPU load
● AWS can scale-down instances when load decreased
![Page 57: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/57.jpg)
![Page 58: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/58.jpg)
Small catch-up
● We know what is EC2 and how to deploy application first time
● We know how to horizontally scale up and down your application
● It looks pretty cumbersome
● We don’t know where we should store users’ files
● We don’t know how to improve website performance
● We don’t know how to update your application
![Page 60: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/60.jpg)
Bad reasons to migrate
● Migrating everything by just virtualizing existing stuff and expecting savings
● Expecting magical performance boost and “Cloud will solve all problems”
![Page 61: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/61.jpg)
Good reasons to migrate
● Extremely flexible
● Pay for what you use
o cheap to fail
o cutting cost of testing and applying new technologies
● Fast changes - get what you need when you need
● Allows to focus on your product - not on CDN, Mail sending, file storages,
![Page 62: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/62.jpg)
File storage
● DIY - Distributed File System
● Let’s Amazon handle it - Elastic File System (Preview)
● Ready to change code - S3
![Page 63: Introduction to amazon web services for developers](https://reader030.vdocuments.site/reader030/viewer/2022020102/55c8e573bb61ebb3328b4637/html5/thumbnails/63.jpg)
S3, CloudFront, Beanstalk demo time