construindo aplicacoes web e mobile escalaveis na aws
DESCRIPTION
Construindo Aplicacoes Web e Mobile Escalaveis na AWSTRANSCRIPT
![Page 1: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/1.jpg)
Michel Pereira
Building Web-Scale and Mobile Applications with AWS
Enterprise Solutions Architect
![Page 2: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/2.jpg)
Vários Tutoriais , treinamentos e mentoria em
português
Inscreva-se agora !!
http://awshub.com.br
![Page 3: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/3.jpg)
While You Scale
• Architect for Failure
– Failures do happen
• Architect with Security
– Security must happen
![Page 4: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/4.jpg)
Why Is Scale Important?
Self Hosting
Waste
Customer
Dissatisfaction
Actual demand
Predicted Demand
Rigid Elastic
Actual demand
AWS
![Page 5: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/5.jpg)
Regions and Storage
Where and What
![Page 6: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/6.jpg)
US-WEST (Oregon) EU-WEST (Ireland)
ASIA PAC (Tokyo)
ASIA PAC
(Singapore)
US-WEST (N. California)
SOUTH AMERICA (Sao Paulo)
US-EAST (Virginia)
AWS GovCloud (US)
ASIA PAC (Sydney)
Regions
![Page 7: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/7.jpg)
US-WEST (Oregon)) EU-WEST (Ireland)
ASIA PAC (Tokyo)
ASIA PAC
(Singapore)
US-WEST (N. California)
SOUTH AMERICA (Sao Paulo)
US-EAST (Virginia)
AWS GovCloud (US)
ASIA PAC (Sydney)
Availability Zones
![Page 8: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/8.jpg)
Storage Types
Ephemeral Storage
• (Almost) every instance has them
• Fast
• Cheap
• Volatile
Elastic Block Storage
• 1GB to 1TB
• Snapshot-able
• You choose the IOPS
• Good for random IO
![Page 9: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/9.jpg)
Storage Types
S3
• (Almost) infinitely durable
• Infinitely scalable
• CloudFront integration
Glacier
• (Almost) infinitely durable
• Infinitely scalable
• Cheapest
![Page 10: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/10.jpg)
Storage Types
Database
• Readily queryable
• Consistency/performance options
SQS
• Logic built-in
• Infinitely scalable
• Good for small blobs and write/read
once
![Page 11: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/11.jpg)
Application Scaling
Wide and Proud
![Page 12: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/12.jpg)
An Example App!
• Photo upload
• Thumbnail generated
• Image recognition scan
• Meta data processing
• End-user web interface and mobile app
![Page 13: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/13.jpg)
Throw it all on one box?
![Page 14: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/14.jpg)
Single-tier Architecture
AWS Cloud
Availability Zone
Web/App/DB/St
orage
![Page 15: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/15.jpg)
Multi-tier Architecture
AWS Cloud
Availability Zone
Web App DB S3
![Page 16: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/16.jpg)
Loose coupling sets you free!
• The looser they're coupled, the bigger they scale
– Independent components
– Design everything as a black box
– Decouple interactions
– Load-balance clusters
Gen. Thumb Image Reg. Meta Data
Gen. Thumb Image Reg. Meta Data
Q Q Q
Tight Coupling
Use Amazon SQS as Buffers
Loose Coupling
![Page 17: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/17.jpg)
Allows for Parallel Processing and Failure
• Fan out
• Use varied instance types
• Use varied billing models
![Page 18: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/18.jpg)
Allows for Parallel Processing and Failure
![Page 19: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/19.jpg)
Loosely-Coupled Multi-tier Architecture
Web App DB S3
SQS SNS
Availability Zone A
App
Availability Zone B
![Page 20: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/20.jpg)
Let’s Auto Scale
Auto Scaling Automatic resizing of compute clusters based on demand
Trigger auto-
scaling policy
Feature Details
Control Define minimum and maximum instance pool sizes and when scaling and cool down occurs.
Integrated to Amazon CloudWatch
Use metrics gathered by CloudWatch to drive scaling.
Instance types Run Auto Scaling for On-Demand and Spot Instances. Compatible with VPC.
as-create-auto-scaling-group MyGroup
--launch-configuration MyConfig
--availability-zones eu-west-1a
--min-size 4
--max-size 200
![Page 21: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/21.jpg)
Loosely-Coupled Multi-tier Architecture
Web App DB S3
SQS SNS
Availability Zone A
App
Availability Zone B
Auto scaling Group
![Page 22: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/22.jpg)
…and Spread the Load
Elastic Load Balancing • Create highly scalable applications
• Distribute load across EC2 instances
in multiple availability zones Feature Details
Available Load balance across instances in multiple Availability Zones
Health checks Automatically checks health of instances and takes them in or out of service
Session stickiness Route requests to the same instance
Secure sockets layer Supports SSL offload from web and application servers with flexible cipher support
Monitoring Publishes metrics to CloudWatch
![Page 23: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/23.jpg)
Where should session state reside?
Trigger auto-
scaling policy
Session State Service
Not Here
Here State must reside OUTSIDE
the scope of the elements you wish to scale
![Page 24: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/24.jpg)
But usually some state has to reside somewhere
Cookies in browser
Memory-resident session manager
Session database
Framework-provided session handler
![Page 25: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/25.jpg)
So this store of state needs to be…
Performant
Scalable
Reliable
![Page 26: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/26.jpg)
And what do I build it on?
The state service itself must be well architected
![Page 27: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/27.jpg)
Scaled and Loaded Multi-tier Architecture
App DB S3
SQS SNS App Web
Web
Auto scaling Group Auto scaling Group
DynamoDB
ELB
![Page 28: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/28.jpg)
• GeneXus é a fornecedora líder de
ferramentas para desenvolvimento ágil de
software empresarial, com base na
captação e gestão de conhecimento do
usuário sobre seu negócio.
• Com mais de 7.000 empresas e governos
como clientes, tem escritórios no Brasil,
EUA, Japão, México e Uruguai, presença
em 45 países.
"A estabilidade e escalabilidade na principal ferramenta
de discovery que tem GeneXus: A nossa própria trial".
A cada experiência do usuário com nossa
Trial, apostamos nossa marca. A AWS deu a
tranquilidade que precisávamos em uma
área critica. Gerardo Wisosky -
Brasil Country Manager
![Page 29: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/29.jpg)
O Desafio
• Alcançar aplicativos de Prototipagem na nuvem
• Garantir a qualidade da interação de novos usuários com GeneXus
• Apoiar a geração de milhares de aplicações web e móveis por mês
• Permitir crescer em função do aumento de demanda
![Page 30: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/30.jpg)
Sobre a o Papel da AWS e Benefícios
alcançados
PARAGRAFO RESUMO CASO _ KEY WORDS
de BENEFICIO, DESAFIO VENCIDO –
RESUMO DO CASO EM UM PARAGRAFO
• Facilidade de implementação do projeto
• Estabilidade das Apps para os usuários
• Escalabilidade para Teste
• Imagem de marca sólida, graças à
confiabilidade da AWS
• Previsibilidade na alocação de recursos
para o projeto
![Page 31: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/31.jpg)
IAM Temporary Security Credentials
• Use Cases
Identity Federation to AWS APIs
Mobile and browser-based applications
Consumer applications with unlimited users
• Scales to millions of users
– No need to create an IAM identity for every user
![Page 32: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/32.jpg)
AWS Account Credentials
IAM User
Temporary Security
Credentials
The IAM Hierarchy of Permissions
Permissions Example
Unrestricted access to all enabled services and resources
Action: * Effect: Allow Resource: * (implicit)
Access restricted by Group and User policies
Action: [‘s3:*’, ‘sts:Get*’] Effect: Allow Resource: *
Access restricted by generating identity and further by policies used to generate token
Action: [ ‘s3:Get*’ ] Effect: Allow Resource: ‘arn:aws:s3:::userbucket/*’
![Page 33: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/33.jpg)
AWS Application Management Solutions
Elastic Beanstalk OpsWorks CloudFormation EC2
Convenience Control
Higher-level Services Do it yourself
![Page 34: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/34.jpg)
Data Tier Scaling
The bane of the Architect’s existence
![Page 35: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/35.jpg)
Create your own on EC2 ( Some popular choices in no particular order )
Many options on the AWS Marketplace https://aws.amazon.com/marketplace
![Page 36: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/36.jpg)
RDS
• Managed MySQL, Oracle and MS SQL
• Helps ease scaling in some scenarios
• Automates backups, snapshots and failover
![Page 37: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/37.jpg)
Vertical Scaling
“We’re gonna need a bigger box”
• Simplest approach
• Can now leverage PIOPs
• High I/O instances
• Easy to change instance sizes
• Will hit an endpoint eventually
hi1.4xlarge
m2.4xlarge
m1.small
![Page 38: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/38.jpg)
Master/Slave Horizontal Scaling
• Reasonably simple to adapt to
• Can now leverage PIOPs
• Easy to change instances sizes
• Will hit an endpoint eventually
![Page 39: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/39.jpg)
Sharded Horizontal Scaling
Hash Ring
A
B C
D
• More complex at the application layer
• ORM support can help
• No practical limit on scalability
• Operation complexity/sophistication
• Shard by function or key space
• RDBMS or NoSQL
![Page 40: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/40.jpg)
Horizontal Scaling – Fully Managed
DynamoDB • Provisioned throughput NoSQL database
• Fast, predictable performance
• Fully distributed, fault tolerant architecture
• Considerations for non-uniform data
Feature Details
Provisioned throughput
Dial up or down provisioned read/write capacity.
Predictable performance
Average single digit millisecond latencies from SSD-backed infrastructure.
Strong consistency Be sure you are reading the most up to date values.
Fault tolerant Data replicated across Availability Zones.
Monitoring Integrated to CloudWatch.
Secure Integrates with AWS Identity and Access Management (IAM).
Elastic MapReduce
Integrates with Elastic MapReduce for complex analytics on large datasets.
![Page 41: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/41.jpg)
Petabyte-Scale Data Warehousing Feature Details
Optimized for Data
Warehousing
Redshift uses a variety of innovations to obtain very high query performance on datasets ranging in size from hundreds of gigabytes to a petabyte or more.
Scalable Easily scale the number of nodes in your data warehouse up or down as your performance or capacity needs change
Fault tolerant Data replicated across Availability Zones.
Monitoring Integrated to CloudWatch.
Secure Encrypt data in transit and at rest. Can also be run in VPC to isolate your data warehouse cluster.
S3 intergration Loads data in parallel to each node from S3.
Elastic MapReduce
Integrates with ERM via Data Pipeline.
![Page 42: Construindo Aplicacoes Web e Mobile Escalaveis na AWS](https://reader033.vdocuments.net/reader033/viewer/2022052620/55786490d8b42a4c748b4fc4/html5/thumbnails/42.jpg)
Summary
• Use these techniques (and many, many others) situationally
• Awareness of the options is the first step to good design
• Scaling is the ability to move the bottlenecks around to the
least expensive part of the architecture
• AWS makes this easier – so your application is not a victim of
its own success