SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Brunno Orpinelli
Enterprise Solutions Architect
ARC301
Levando Serverless para o Edge
Ian Hartz
Technical Account Manager
Posicionamento
Nenhum servidor para
provisionar ou gerenciar
Escalar de acordo com o
uso
Nunca pagar por ociosidade Alta disponibilidade e
tolerância a falha nativo
Serverless significa…
Como funciona
FONTE DO EVENTO SERVIÇOS (QUALQUER)
Mudança no
estado do dado
Requisições
para o endpoint
Mudança no
estado do recurso
FUNÇÃO
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
… mas e se você pudesse executar suas
funções Lambda em múltiplas localidades
e mais perto do usuário final?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon CloudFront Global Content Delivery Network
113 PoPs (102 Edge Locations + 11 Regional Edge Caches)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront: Global Content Delivery Network
 Acelera a entrega de conteúdo estático e dinâmico.
 Infraestrutura global
 Altamente seguro
 Escalável massivamente
 Self Service
 Precificado de maneira a reduzir custos
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon CloudFrontAWS Lambda
Lambda@Edge
Lambda@Edge
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda@Edge
Distribuído
globalmente
Sem servidores para
provisionar e manter
Escala de acordo
com o uso
Nunca pague por
ociosidade
Alta disponibilidade e
tolerância a falha
nativa
Traga seu código para a borda para aumentar a experiência do
usuário
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Codifique uma vez, rode sua função Lambda
globalmente
N Virginia
AWS Location
AWS Location
AWS Location
AWS Location
AWS Location
AWS Location
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda@Edge
Origin
AWS Location
AWS Location
AWS Location
AWS Location
AWS Location
AWS Location
Compute
Storage
Database
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront Triggers
CloudFront
cache
Usuário final
Viewer Request
Viewer Response Origin Response
Origem
Origin Request
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda@Edge
Roteamento baseado
em conteúdo para
qualquer região
NEW
Geração de resposta
• Gera uma resposta customizada
na borda
• Acesso de leitura e escrita nos
headers, query string e cookies
Chamadas de rede
• Origin events
• Viewer events
Deep dive/Componentes
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront
cache
VIEWER REQUEST EVENTS
CloudFront
cache
User Agents
Viewer Request
Origem HTTP
Viewer Response Origin Response
Origin Request
Viewer Response Origin Response
Origin RequestViewer Request
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VIEWER REQUEST EVENTS
Executado em toda requisição antes da verificação de cache do CloudFront
Modificar a chave de cache (URL, cookies, headers, query string)
Realizar verificação de autenticação e autorização
Fazer chamadas externas
Gerar respostas que não vão ser armazenadas no cache
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VIEWER REQUEST: STATELESS AUTH
User Agent
User credentials
Identity provider
(IdP)
JSON Web Token
(JWT)
Legacy application
CloudFront distribution
www.example.com
JWT
JWT public key
Access decision
Origin applicationJWT
S3 Bucket
?
?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
{
"iss": "https://idp.example.com",
"client_id": "exampleclient",
"sub": "081e018d-0594-411a-bbe8-cccd7c6058a2",
"custom:allowed_paths": [
"/customer/249/*",
"/user/1360/*",
"/videos/29492/*”
]
}
VIEWER REQUEST: STATELESS AUTH
Exemplo de payload do JWT:
Direito de acesso
particulares
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VIEWER REQUEST: STATELESS AUTH
JWT
JWT public key
Viewer Request Event
User Agent Distribuição CloudFront
www.example.com
JWT
HTTP 403, 3XX, etc.
NO
Decisão de acesso
Aplicação legada
S3 Bucket
Aplicação na
origem
OK
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VIEWER REQUEST: STATEFUL AUTH
Viewer Request Event
User Agent Distribuição CloudFront
www.example.com
NO
Paywall message,
403, redirect, etc.
$
Serviço de
autorização
HTTP request
Decisão de Acesso
Origem HTTP
OK
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront
cache
ORIGIN REQUEST EVENTS
CloudFront
cache
User Agents
Viewer Request
HTTP Origins
Viewer Response Origin Response
Origin Request
Viewer Response Origin Response
Viewer Request Origin Request
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST EVENTS
Executando quando há um cache miss, antes da requisição ser direcionada
para a origem
Realizar uma ou mais chamadas de redes externas
Selecionar uma origem dinâmicamente baseado no request header
Implementar o conceito de pretty URLs reescrevendo a URL de origem
Gerar respostas que possam ser armazenadas em cache
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST: BODY GENERATION
<h1>{ page.title }</h1>
{{ for section in page.sections }}
<h2>{ section.title }</h2>
<p>{ section.body }</p>
{{ endfor }}
"page": {
"title": "Hello",
"sections": [ {
"title": "Introduction",
"body": "The quick..."
}, { ... } ]
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST: BODY GENERATION
User Agent Distribuição CloudFront
www.example.com
Cache Behavior
/blog
Origin Request
Event
S3 Bucket
blog-templates.s3.amazonaws.com
DynamoDB table
blog-posts
External network
calls
Template
renderizado
Cached response
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
const templateBucket = 'blog-templates-123456789012';
const postTable = 'blog-posts';
var AWS = require('aws-sdk');
var Mustache = require('mustache');
var s3 = new AWS.S3({region: 'us-east-1'});
var documentClient = new AWS.DynamoDB.DocumentClient({
region: 'us-east-1'});
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
const response = {
status: '200',
statusDescription: 'OK',
headers: {
'cache-control': [{
key: 'Cache-Control',
value: 'max-age=2628000, public’
}],
'content-type': [{
key: 'Content-Type',
value: 'text/html; charset=utf-8’
}]}};
ORIGIN REQUEST: BODY GENERATION CODE
const ddbParams = {
TableName: postTable,
Key: { slug: request['uri'].slice(1) }};
documentClient.get(ddbParams, function(err, resp) {
if (err) {
callback(err, null);
return;
}
const template = resp['Item']['template'];
const data = resp['Item']['data'];
const s3Params = {
Bucket: templateBucket,
Key: template };
s3.getObject(s3Params, function(err, s3resp) {
if (err) {
callback(err, null);
return;
}
const body = s3resp.Body.toString('utf-8');
response.body = Mustache.render(body, data);
callback(null, response);
});
});
};
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
PRETTY URLS FOR USER/API EXPERIENCE
https://tiles.example.com/zoom/x/y.jpg
S3 Bucket
tiles-v1.s3.amazonaws.com
Seviço legado
old-tile-service.example.net
Elastic Load Balancer
tile-service-123456.us-east-1
.amazonaws.com
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST : PRETTY URLS
https://tiles.example.com/zoom/x/y.jpg
https://tiles-origin.s3.amazonaws.com/f5fdc6f658a49284b.jpg
Origin Request Event
originPath = sha256(requestPath)
CloudFront cache
Cache key: tiles.example.com/zoom/x/y.jpg
Cached response
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST: PROCESSAMENTO DE
IMAGENS
User Agent Distribuição CloudFront
www.example.com
Origin Request
Event
PUT
API Gateway
Image Thumbnail
Function
S3 Bucket
image-thumbnails.s3.amazonaws.com
GET
S3 Bucket
image-originals.s3.amazonaws.com
GET
404
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EXPANSÃO GLOBAL TRANSPARENTE
Cliente da região A
Deploy da região B
https://saas.example.com
Cliente da região B
Deploy da região B
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EXPANSÃO GLOBAL TRANSPARENTE
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST: SELEÇÃO DE ORIGEM
id user
1 alex
2 bob
3 joe
4 jane
Base da dados do
usuário
200 OK
Aplicação
User Agent
POST /login
user=jane&pass=***
home-region
na
eu
ap
eu
Set-Cookie: home-region=eu
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST: SELEÇÃO DE ORIGEM
User Agent Distribuição
CloudFrontion
www.example.com
Origem North
America
User DB
Cache Behavior
/login
North America
app DB
Origem Europe Europe app DB
home-region=eu ?
Origem APAC APAC app DB
Cache Behavior
/app
Origin Request
Event
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST: ROUTE ON USER AGENT
User Agents
Desktop
Mobile
Bots e
crawlers
Distribuição CloudFront
www.example.com
Origin Request
Event
Mobile optimized
app
Client-rendered
app
Server-rendered
app
Cloudfront-Is-Mobile-Viewer?
Cloudfront-Is-Desktop-Viewer?
Cloudfront-Is-Tablet-Viewer?
User-Agent?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST: GERAR
REDIRECIONAMENTO
User Agent Distribuição CloudFront
www.example.com
HTTP redirect
www.example.com/de
Origin Request
Event
Cloudfront-Viewer-Country?
Accept-Language?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
'use strict';
const originDomainNames = {
'origin_1': 'origin.us-east-1.example.com',
'origin_2': 'origin.eu-west-1.example.com'
};
const defaultOrigin = 'origin_1';
function chooseOrigin(headers) {
/* Parse cookies, inspect headers, etc. */
if (condition1) {
return 'origin_1';
} else if (condition2) {
return 'origin_2';
} else {
return default_origin;
}
}
ORIGIN REQUEST: CUSTOM ROUTING CODE
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
const headers = request.headers;
const selectedOrigin = chooseOrigin(headers);
/* Modify the request's `origin` object. */
request.origin = {
custom: {
domainName: originDomainNames[selectedOrigin],
keepAliveTimeout: 60,
path: '/',
port: 443,
protocol: 'https',
readTimeout: 5,
sslProtocols: ['TLSv1', 'TLSv1.1']
}
};
callback(null, request);
};
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront
cache
ORIGIN RESPONSE EVENTS
CloudFront
cache
User Agents
Viewer Request
HTTP Origins
Viewer Response Origin Response
Origin Request
Viewer Response
Origin RequestViewer Request
Origin Response
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN RESPONSE EVENTS
Executado em eventos de cache miss, depois que uma resposta é recebida
da origem
Fazer chamadas de redes externas
Modificar o response headers antes de realizar o cache
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
'use strict';
exports.handler = (event, context, callback) => {
const response = event.Records[0].cf.response;
const headers = response.headers;
const headerName =
'Strict-Transport-Security';
const headerValue =
'max-age=31536000; includeSubDomains';
headers[headerName.toLowerCase()] = [{
key: headerName,
value: headerValue
}];
callback(null, response);
};
ORIGIN RESPONSE: INJECT HEADERS
Content-Type
Cache-Control
HTTP Strict Transport
Security (HSTS)
Content-Security-Policy
and more!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront
cache
VIEWER RESPONSE EVENTS
CloudFront
cache
User Agents
Viewer Request
Origems HTTP
Viewer Response Origin Response
Origin Request
Origin Response
Origin RequestViewer Request
Viewer Response
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VIEWER RESPONSE EVENTS
Executado em todas as requisições, depois que a resposta é recebida da
origem ou do cache
Modificar o response headers sem armazenar o resultado em cache
Realizar chamadas de redes externas
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VIEWER RESPONSE: SET USER COOKIES
User Agent
Distribuição CloudFront
www.example.com
CloudFront cache Origin fetch
Cache miss
Viewer response event
const sid = uuidv4();
headers['set-cookie'].push({
Key: 'Set-Cookie',
Value: 'sessionid=' + sid });
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Clientes de várias industrias
Redes Sociais,
Publicidade Digital,
EdTech, Financeiro
Enterprise
E-commerce
Mídia e
Entretenimento
Jogos
“Aproximamos brasileiros para
transformar itens em felicidade”
“Usando a AWS temos
menos
acoplamento, mais
independência e
agilidade"
A maior plataforma de classificados
do Brasil, com mais de 7 milhões
de visitantes únicos diários e 80
mil itens negociados diariamente
Mais 100 desenvolvedores divididos
em 22 equipes independentes
O Desafio - Maior previsibilidade nas entregas
Medir o impacto das mudanças no produto
Testes A/B
Atendendo os diversos times
Altamente disponível, adicionando pouca
latência ao produto e de fácil uso
Atendendo toda a stack (frontend,
backend, apps, etc…)
Solução
Solução
Pontos fortes:
Independência
Facilidade de
desenvolvimento
Multi plataforma
Desafios:
Latência
Custos em escala
Obrigado!

Contenu connexe

Tendances

Ransomware: como recuperar os seus dados na nuvem AWS
Ransomware: como recuperar os seus dados na nuvem AWSRansomware: como recuperar os seus dados na nuvem AWS
Ransomware: como recuperar os seus dados na nuvem AWSAmazon Web Services LATAM
 
Criando o seu Data Center Virtual: Fundamentos de VPC e Opções de Conectivida...
Criando o seu Data Center Virtual: Fundamentos de VPC e Opções de Conectivida...Criando o seu Data Center Virtual: Fundamentos de VPC e Opções de Conectivida...
Criando o seu Data Center Virtual: Fundamentos de VPC e Opções de Conectivida...Amazon Web Services
 
Detecção e Mitigação de Ameaças - SID301 - Sao Paulo Summit
Detecção e Mitigação de Ameaças -  SID301 - Sao Paulo SummitDetecção e Mitigação de Ameaças -  SID301 - Sao Paulo Summit
Detecção e Mitigação de Ameaças - SID301 - Sao Paulo SummitAmazon Web Services
 
Arquiteturas e Estratégias para Criar Aplicações Modernas na AWS - ARC201 - ...
Arquiteturas e Estratégias para Criar Aplicações Modernas na AWS -  ARC201 - ...Arquiteturas e Estratégias para Criar Aplicações Modernas na AWS -  ARC201 - ...
Arquiteturas e Estratégias para Criar Aplicações Modernas na AWS - ARC201 - ...Amazon Web Services
 
Sem medo de sair do monolito para o sem servidor com Dynatrace - DEM10 - Sao...
Sem medo de sair do monolito para o sem servidor com Dynatrace -  DEM10 - Sao...Sem medo de sair do monolito para o sem servidor com Dynatrace -  DEM10 - Sao...
Sem medo de sair do monolito para o sem servidor com Dynatrace - DEM10 - Sao...Amazon Web Services
 
Aprenda como migrar e transferir dados ao utilizar a nuvem da AWS
Aprenda como migrar e transferir dados ao utilizar a nuvem da AWSAprenda como migrar e transferir dados ao utilizar a nuvem da AWS
Aprenda como migrar e transferir dados ao utilizar a nuvem da AWSAmazon Web Services LATAM
 
Sessão Avançada: Otimizando Bancos de Dados Relacionais na AWS com Amazon RDS...
Sessão Avançada: Otimizando Bancos de Dados Relacionais na AWS com Amazon RDS...Sessão Avançada: Otimizando Bancos de Dados Relacionais na AWS com Amazon RDS...
Sessão Avançada: Otimizando Bancos de Dados Relacionais na AWS com Amazon RDS...Amazon Web Services
 
Segurança - 10 regras que você deve saber antes de migrar sua infraestrutura ...
Segurança - 10 regras que você deve saber antes de migrar sua infraestrutura ...Segurança - 10 regras que você deve saber antes de migrar sua infraestrutura ...
Segurança - 10 regras que você deve saber antes de migrar sua infraestrutura ...Amazon Web Services LATAM
 
Criando Aplicações Serverless - ARC302 - Sao Paulo Summit
Criando Aplicações Serverless -  ARC302 - Sao Paulo SummitCriando Aplicações Serverless -  ARC302 - Sao Paulo Summit
Criando Aplicações Serverless - ARC302 - Sao Paulo SummitAmazon Web Services
 
SAP HANA na AWS: Por que migrar para a nuvem? - ENT301 - Sao Paulo Summit
SAP HANA na AWS: Por que migrar para a nuvem? -  ENT301 - Sao Paulo SummitSAP HANA na AWS: Por que migrar para a nuvem? -  ENT301 - Sao Paulo Summit
SAP HANA na AWS: Por que migrar para a nuvem? - ENT301 - Sao Paulo SummitAmazon Web Services
 
Melhores práticas de CI/CD na construção de aplicações modernas
Melhores práticas de CI/CD na construção de aplicações modernasMelhores práticas de CI/CD na construção de aplicações modernas
Melhores práticas de CI/CD na construção de aplicações modernasAmazon Web Services LATAM
 
Do monolítico a sem servidor com a Dynatrace - DEM06 - Sao Paulo Summit
Do monolítico a sem servidor com a Dynatrace -  DEM06 - Sao Paulo SummitDo monolítico a sem servidor com a Dynatrace -  DEM06 - Sao Paulo Summit
Do monolítico a sem servidor com a Dynatrace - DEM06 - Sao Paulo SummitAmazon Web Services
 
Construindo Data Lakes e Analytics na AWS - BDA301 - Sao Paulo Summit
Construindo Data Lakes e Analytics na AWS -  BDA301 - Sao Paulo SummitConstruindo Data Lakes e Analytics na AWS -  BDA301 - Sao Paulo Summit
Construindo Data Lakes e Analytics na AWS - BDA301 - Sao Paulo SummitAmazon Web Services
 
Sessão Avançada: Armazenamento Híbrido na Nuvem com AWS Storage Gateway - CM...
Sessão Avançada: Armazenamento Híbrido na Nuvem com AWS Storage Gateway -  CM...Sessão Avançada: Armazenamento Híbrido na Nuvem com AWS Storage Gateway -  CM...
Sessão Avançada: Armazenamento Híbrido na Nuvem com AWS Storage Gateway - CM...Amazon Web Services
 

Tendances (20)

Ransomware: como recuperar os seus dados na nuvem AWS
Ransomware: como recuperar os seus dados na nuvem AWSRansomware: como recuperar os seus dados na nuvem AWS
Ransomware: como recuperar os seus dados na nuvem AWS
 
Criando o seu Data Center Virtual: Fundamentos de VPC e Opções de Conectivida...
Criando o seu Data Center Virtual: Fundamentos de VPC e Opções de Conectivida...Criando o seu Data Center Virtual: Fundamentos de VPC e Opções de Conectivida...
Criando o seu Data Center Virtual: Fundamentos de VPC e Opções de Conectivida...
 
Detecção e Mitigação de Ameaças - SID301 - Sao Paulo Summit
Detecção e Mitigação de Ameaças -  SID301 - Sao Paulo SummitDetecção e Mitigação de Ameaças -  SID301 - Sao Paulo Summit
Detecção e Mitigação de Ameaças - SID301 - Sao Paulo Summit
 
Arquiteturas e Estratégias para Criar Aplicações Modernas na AWS - ARC201 - ...
Arquiteturas e Estratégias para Criar Aplicações Modernas na AWS -  ARC201 - ...Arquiteturas e Estratégias para Criar Aplicações Modernas na AWS -  ARC201 - ...
Arquiteturas e Estratégias para Criar Aplicações Modernas na AWS - ARC201 - ...
 
Sem medo de sair do monolito para o sem servidor com Dynatrace - DEM10 - Sao...
Sem medo de sair do monolito para o sem servidor com Dynatrace -  DEM10 - Sao...Sem medo de sair do monolito para o sem servidor com Dynatrace -  DEM10 - Sao...
Sem medo de sair do monolito para o sem servidor com Dynatrace - DEM10 - Sao...
 
Introdução ao Amazon EKS
Introdução ao Amazon EKSIntrodução ao Amazon EKS
Introdução ao Amazon EKS
 
Aprenda como migrar e transferir dados ao utilizar a nuvem da AWS
Aprenda como migrar e transferir dados ao utilizar a nuvem da AWSAprenda como migrar e transferir dados ao utilizar a nuvem da AWS
Aprenda como migrar e transferir dados ao utilizar a nuvem da AWS
 
Sessão Avançada: Otimizando Bancos de Dados Relacionais na AWS com Amazon RDS...
Sessão Avançada: Otimizando Bancos de Dados Relacionais na AWS com Amazon RDS...Sessão Avançada: Otimizando Bancos de Dados Relacionais na AWS com Amazon RDS...
Sessão Avançada: Otimizando Bancos de Dados Relacionais na AWS com Amazon RDS...
 
Segurança - 10 regras que você deve saber antes de migrar sua infraestrutura ...
Segurança - 10 regras que você deve saber antes de migrar sua infraestrutura ...Segurança - 10 regras que você deve saber antes de migrar sua infraestrutura ...
Segurança - 10 regras que você deve saber antes de migrar sua infraestrutura ...
 
Criando Aplicações Serverless - ARC302 - Sao Paulo Summit
Criando Aplicações Serverless -  ARC302 - Sao Paulo SummitCriando Aplicações Serverless -  ARC302 - Sao Paulo Summit
Criando Aplicações Serverless - ARC302 - Sao Paulo Summit
 
Microsoft Workloads em Amazon Web Services
Microsoft Workloads em Amazon Web ServicesMicrosoft Workloads em Amazon Web Services
Microsoft Workloads em Amazon Web Services
 
Inicie uma jornada segura para a nuvem
Inicie uma jornada segura para a nuvemInicie uma jornada segura para a nuvem
Inicie uma jornada segura para a nuvem
 
SAP HANA na AWS: Por que migrar para a nuvem? - ENT301 - Sao Paulo Summit
SAP HANA na AWS: Por que migrar para a nuvem? -  ENT301 - Sao Paulo SummitSAP HANA na AWS: Por que migrar para a nuvem? -  ENT301 - Sao Paulo Summit
SAP HANA na AWS: Por que migrar para a nuvem? - ENT301 - Sao Paulo Summit
 
Melhores Práticas de Segurança na AWS
Melhores Práticas de Segurança na AWS Melhores Práticas de Segurança na AWS
Melhores Práticas de Segurança na AWS
 
Webinar: Gestão de Segurança Cibernética
Webinar: Gestão de Segurança CibernéticaWebinar: Gestão de Segurança Cibernética
Webinar: Gestão de Segurança Cibernética
 
Melhores práticas de CI/CD na construção de aplicações modernas
Melhores práticas de CI/CD na construção de aplicações modernasMelhores práticas de CI/CD na construção de aplicações modernas
Melhores práticas de CI/CD na construção de aplicações modernas
 
Do monolítico a sem servidor com a Dynatrace - DEM06 - Sao Paulo Summit
Do monolítico a sem servidor com a Dynatrace -  DEM06 - Sao Paulo SummitDo monolítico a sem servidor com a Dynatrace -  DEM06 - Sao Paulo Summit
Do monolítico a sem servidor com a Dynatrace - DEM06 - Sao Paulo Summit
 
Construindo Data Lakes e Analytics na AWS - BDA301 - Sao Paulo Summit
Construindo Data Lakes e Analytics na AWS -  BDA301 - Sao Paulo SummitConstruindo Data Lakes e Analytics na AWS -  BDA301 - Sao Paulo Summit
Construindo Data Lakes e Analytics na AWS - BDA301 - Sao Paulo Summit
 
Sessão Avançada: Armazenamento Híbrido na Nuvem com AWS Storage Gateway - CM...
Sessão Avançada: Armazenamento Híbrido na Nuvem com AWS Storage Gateway -  CM...Sessão Avançada: Armazenamento Híbrido na Nuvem com AWS Storage Gateway -  CM...
Sessão Avançada: Armazenamento Híbrido na Nuvem com AWS Storage Gateway - CM...
 
Webinar: Containers
Webinar: ContainersWebinar: Containers
Webinar: Containers
 

Similaire à Levando Serverless para o Edge - ARC301 - Sao Paulo Summit

Processamento Dados em Escala com Serverless: Um Estudo de Caso da Amazon.com...
Processamento Dados em Escala com Serverless: Um Estudo de Caso da Amazon.com...Processamento Dados em Escala com Serverless: Um Estudo de Caso da Amazon.com...
Processamento Dados em Escala com Serverless: Um Estudo de Caso da Amazon.com...Amazon Web Services
 
Webinar - Inicie sua jornada de migração para nuvem com a AWS (Português)
Webinar - Inicie sua jornada de migração para nuvem com a AWS (Português)Webinar - Inicie sua jornada de migração para nuvem com a AWS (Português)
Webinar - Inicie sua jornada de migração para nuvem com a AWS (Português)Amazon Web Services LATAM
 
Twelve-Factor serverless applications - MAD302 - São Paulo AWS Summit
Twelve-Factor serverless applications - MAD302 - São Paulo AWS SummitTwelve-Factor serverless applications - MAD302 - São Paulo AWS Summit
Twelve-Factor serverless applications - MAD302 - São Paulo AWS SummitAmazon Web Services
 
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
AWS para terceiro setor - Sessão 1 - Introdução à nuvemAWS para terceiro setor - Sessão 1 - Introdução à nuvem
AWS para terceiro setor - Sessão 1 - Introdução à nuvemAmazon Web Services LATAM
 
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
AWS para terceiro setor - Sessão 1 - Introdução à nuvemAWS para terceiro setor - Sessão 1 - Introdução à nuvem
AWS para terceiro setor - Sessão 1 - Introdução à nuvemAmazon Web Services LATAM
 
Construindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaConstruindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaAmazon Web Services LATAM
 
Building blocks #4 - Rede de entrega de conteúdo (CDN) na AWS
Building blocks #4 - Rede de entrega de conteúdo (CDN) na AWSBuilding blocks #4 - Rede de entrega de conteúdo (CDN) na AWS
Building blocks #4 - Rede de entrega de conteúdo (CDN) na AWSAmazon Web Services LATAM
 
Usando Amazon CloudFront para aumentar performance, disponibilidade e cache n...
Usando Amazon CloudFront para aumentar performance, disponibilidade e cache n...Usando Amazon CloudFront para aumentar performance, disponibilidade e cache n...
Usando Amazon CloudFront para aumentar performance, disponibilidade e cache n...Amazon Web Services LATAM
 
Arquiteturas de E Commerce da próxima geração
Arquiteturas de E Commerce da próxima geraçãoArquiteturas de E Commerce da próxima geração
Arquiteturas de E Commerce da próxima geraçãoAmazon Web Services LATAM
 
Construindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaConstruindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaAmazon Web Services LATAM
 
Construindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaConstruindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaAmazon Web Services LATAM
 
Sessão Avançada: Construindo um Data Warehouse Moderno com Amazon Redshift - ...
Sessão Avançada: Construindo um Data Warehouse Moderno com Amazon Redshift - ...Sessão Avançada: Construindo um Data Warehouse Moderno com Amazon Redshift - ...
Sessão Avançada: Construindo um Data Warehouse Moderno com Amazon Redshift - ...Amazon Web Services
 
Visão geral dos novos produtos da Cloudflare
Visão geral dos novos produtos da CloudflareVisão geral dos novos produtos da Cloudflare
Visão geral dos novos produtos da CloudflareCloudflare
 
Construindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaConstruindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaAmazon Web Services LATAM
 
Secure your data lake- A Financial industry perspective - SVC203 - São Paulo ...
Secure your data lake- A Financial industry perspective - SVC203 - São Paulo ...Secure your data lake- A Financial industry perspective - SVC203 - São Paulo ...
Secure your data lake- A Financial industry perspective - SVC203 - São Paulo ...Amazon Web Services
 
Deep dive em aceleração de entrega de conteúdo, APIs e Aplicações utilizando ...
Deep dive em aceleração de entrega de conteúdo, APIs e Aplicações utilizando ...Deep dive em aceleração de entrega de conteúdo, APIs e Aplicações utilizando ...
Deep dive em aceleração de entrega de conteúdo, APIs e Aplicações utilizando ...Amazon Web Services LATAM
 
Creating your secure cloud journey - SVC303 - São Paulo AWS Summit.pdf
Creating your secure cloud journey - SVC303 - São Paulo AWS Summit.pdfCreating your secure cloud journey - SVC303 - São Paulo AWS Summit.pdf
Creating your secure cloud journey - SVC303 - São Paulo AWS Summit.pdfAmazon Web Services
 

Similaire à Levando Serverless para o Edge - ARC301 - Sao Paulo Summit (20)

Processamento Dados em Escala com Serverless: Um Estudo de Caso da Amazon.com...
Processamento Dados em Escala com Serverless: Um Estudo de Caso da Amazon.com...Processamento Dados em Escala com Serverless: Um Estudo de Caso da Amazon.com...
Processamento Dados em Escala com Serverless: Um Estudo de Caso da Amazon.com...
 
Criando Aplicações Serverless
Criando Aplicações ServerlessCriando Aplicações Serverless
Criando Aplicações Serverless
 
Webinar - Inicie sua jornada de migração para nuvem com a AWS (Português)
Webinar - Inicie sua jornada de migração para nuvem com a AWS (Português)Webinar - Inicie sua jornada de migração para nuvem com a AWS (Português)
Webinar - Inicie sua jornada de migração para nuvem com a AWS (Português)
 
Twelve-Factor serverless applications - MAD302 - São Paulo AWS Summit
Twelve-Factor serverless applications - MAD302 - São Paulo AWS SummitTwelve-Factor serverless applications - MAD302 - São Paulo AWS Summit
Twelve-Factor serverless applications - MAD302 - São Paulo AWS Summit
 
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
AWS para terceiro setor - Sessão 1 - Introdução à nuvemAWS para terceiro setor - Sessão 1 - Introdução à nuvem
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
 
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
AWS para terceiro setor - Sessão 1 - Introdução à nuvemAWS para terceiro setor - Sessão 1 - Introdução à nuvem
AWS para terceiro setor - Sessão 1 - Introdução à nuvem
 
Construindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaConstruindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS Lambda
 
Aceleracao+conteudo+dinamico
Aceleracao+conteudo+dinamicoAceleracao+conteudo+dinamico
Aceleracao+conteudo+dinamico
 
Building blocks #4 - Rede de entrega de conteúdo (CDN) na AWS
Building blocks #4 - Rede de entrega de conteúdo (CDN) na AWSBuilding blocks #4 - Rede de entrega de conteúdo (CDN) na AWS
Building blocks #4 - Rede de entrega de conteúdo (CDN) na AWS
 
Usando Amazon CloudFront para aumentar performance, disponibilidade e cache n...
Usando Amazon CloudFront para aumentar performance, disponibilidade e cache n...Usando Amazon CloudFront para aumentar performance, disponibilidade e cache n...
Usando Amazon CloudFront para aumentar performance, disponibilidade e cache n...
 
Arquiteturas de E Commerce da próxima geração
Arquiteturas de E Commerce da próxima geraçãoArquiteturas de E Commerce da próxima geração
Arquiteturas de E Commerce da próxima geração
 
Construindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaConstruindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS Lambda
 
Construindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaConstruindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS Lambda
 
Sessão Avançada: Construindo um Data Warehouse Moderno com Amazon Redshift - ...
Sessão Avançada: Construindo um Data Warehouse Moderno com Amazon Redshift - ...Sessão Avançada: Construindo um Data Warehouse Moderno com Amazon Redshift - ...
Sessão Avançada: Construindo um Data Warehouse Moderno com Amazon Redshift - ...
 
Visão geral dos novos produtos da Cloudflare
Visão geral dos novos produtos da CloudflareVisão geral dos novos produtos da Cloudflare
Visão geral dos novos produtos da Cloudflare
 
Construindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS LambdaConstruindo APIs com Amazon API Gateway e AWS Lambda
Construindo APIs com Amazon API Gateway e AWS Lambda
 
AWS Financial Management
AWS Financial ManagementAWS Financial Management
AWS Financial Management
 
Secure your data lake- A Financial industry perspective - SVC203 - São Paulo ...
Secure your data lake- A Financial industry perspective - SVC203 - São Paulo ...Secure your data lake- A Financial industry perspective - SVC203 - São Paulo ...
Secure your data lake- A Financial industry perspective - SVC203 - São Paulo ...
 
Deep dive em aceleração de entrega de conteúdo, APIs e Aplicações utilizando ...
Deep dive em aceleração de entrega de conteúdo, APIs e Aplicações utilizando ...Deep dive em aceleração de entrega de conteúdo, APIs e Aplicações utilizando ...
Deep dive em aceleração de entrega de conteúdo, APIs e Aplicações utilizando ...
 
Creating your secure cloud journey - SVC303 - São Paulo AWS Summit.pdf
Creating your secure cloud journey - SVC303 - São Paulo AWS Summit.pdfCreating your secure cloud journey - SVC303 - São Paulo AWS Summit.pdf
Creating your secure cloud journey - SVC303 - São Paulo AWS Summit.pdf
 

Plus de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Plus de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Levando Serverless para o Edge - ARC301 - Sao Paulo Summit

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Brunno Orpinelli Enterprise Solutions Architect ARC301 Levando Serverless para o Edge Ian Hartz Technical Account Manager
  • 3. Nenhum servidor para provisionar ou gerenciar Escalar de acordo com o uso Nunca pagar por ociosidade Alta disponibilidade e tolerância a falha nativo Serverless significa…
  • 4. Como funciona FONTE DO EVENTO SERVIÇOS (QUALQUER) Mudança no estado do dado Requisições para o endpoint Mudança no estado do recurso FUNÇÃO
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. … mas e se você pudesse executar suas funções Lambda em múltiplas localidades e mais perto do usuário final?
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon CloudFront Global Content Delivery Network 113 PoPs (102 Edge Locations + 11 Regional Edge Caches)
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront: Global Content Delivery Network  Acelera a entrega de conteúdo estático e dinâmico.  Infraestrutura global  Altamente seguro  Escalável massivamente  Self Service  Precificado de maneira a reduzir custos
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon CloudFrontAWS Lambda Lambda@Edge Lambda@Edge
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda@Edge Distribuído globalmente Sem servidores para provisionar e manter Escala de acordo com o uso Nunca pague por ociosidade Alta disponibilidade e tolerância a falha nativa Traga seu código para a borda para aumentar a experiência do usuário
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Codifique uma vez, rode sua função Lambda globalmente N Virginia AWS Location AWS Location AWS Location AWS Location AWS Location AWS Location
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda@Edge Origin AWS Location AWS Location AWS Location AWS Location AWS Location AWS Location Compute Storage Database
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront Triggers CloudFront cache Usuário final Viewer Request Viewer Response Origin Response Origem Origin Request
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda@Edge Roteamento baseado em conteúdo para qualquer região NEW Geração de resposta • Gera uma resposta customizada na borda • Acesso de leitura e escrita nos headers, query string e cookies Chamadas de rede • Origin events • Viewer events
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront cache VIEWER REQUEST EVENTS CloudFront cache User Agents Viewer Request Origem HTTP Viewer Response Origin Response Origin Request Viewer Response Origin Response Origin RequestViewer Request
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER REQUEST EVENTS Executado em toda requisição antes da verificação de cache do CloudFront Modificar a chave de cache (URL, cookies, headers, query string) Realizar verificação de autenticação e autorização Fazer chamadas externas Gerar respostas que não vão ser armazenadas no cache
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER REQUEST: STATELESS AUTH User Agent User credentials Identity provider (IdP) JSON Web Token (JWT) Legacy application CloudFront distribution www.example.com JWT JWT public key Access decision Origin applicationJWT S3 Bucket ? ?
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. { "iss": "https://idp.example.com", "client_id": "exampleclient", "sub": "081e018d-0594-411a-bbe8-cccd7c6058a2", "custom:allowed_paths": [ "/customer/249/*", "/user/1360/*", "/videos/29492/*” ] } VIEWER REQUEST: STATELESS AUTH Exemplo de payload do JWT: Direito de acesso particulares
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER REQUEST: STATELESS AUTH JWT JWT public key Viewer Request Event User Agent Distribuição CloudFront www.example.com JWT HTTP 403, 3XX, etc. NO Decisão de acesso Aplicação legada S3 Bucket Aplicação na origem OK
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER REQUEST: STATEFUL AUTH Viewer Request Event User Agent Distribuição CloudFront www.example.com NO Paywall message, 403, redirect, etc. $ Serviço de autorização HTTP request Decisão de Acesso Origem HTTP OK
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront cache ORIGIN REQUEST EVENTS CloudFront cache User Agents Viewer Request HTTP Origins Viewer Response Origin Response Origin Request Viewer Response Origin Response Viewer Request Origin Request
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST EVENTS Executando quando há um cache miss, antes da requisição ser direcionada para a origem Realizar uma ou mais chamadas de redes externas Selecionar uma origem dinâmicamente baseado no request header Implementar o conceito de pretty URLs reescrevendo a URL de origem Gerar respostas que possam ser armazenadas em cache
  • 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: BODY GENERATION <h1>{ page.title }</h1> {{ for section in page.sections }} <h2>{ section.title }</h2> <p>{ section.body }</p> {{ endfor }} "page": { "title": "Hello", "sections": [ { "title": "Introduction", "body": "The quick..." }, { ... } ]
  • 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: BODY GENERATION User Agent Distribuição CloudFront www.example.com Cache Behavior /blog Origin Request Event S3 Bucket blog-templates.s3.amazonaws.com DynamoDB table blog-posts External network calls Template renderizado Cached response
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. const templateBucket = 'blog-templates-123456789012'; const postTable = 'blog-posts'; var AWS = require('aws-sdk'); var Mustache = require('mustache'); var s3 = new AWS.S3({region: 'us-east-1'}); var documentClient = new AWS.DynamoDB.DocumentClient({ region: 'us-east-1'}); exports.handler = (event, context, callback) => { const request = event.Records[0].cf.request; const response = { status: '200', statusDescription: 'OK', headers: { 'cache-control': [{ key: 'Cache-Control', value: 'max-age=2628000, public’ }], 'content-type': [{ key: 'Content-Type', value: 'text/html; charset=utf-8’ }]}}; ORIGIN REQUEST: BODY GENERATION CODE const ddbParams = { TableName: postTable, Key: { slug: request['uri'].slice(1) }}; documentClient.get(ddbParams, function(err, resp) { if (err) { callback(err, null); return; } const template = resp['Item']['template']; const data = resp['Item']['data']; const s3Params = { Bucket: templateBucket, Key: template }; s3.getObject(s3Params, function(err, s3resp) { if (err) { callback(err, null); return; } const body = s3resp.Body.toString('utf-8'); response.body = Mustache.render(body, data); callback(null, response); }); }); };
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. PRETTY URLS FOR USER/API EXPERIENCE https://tiles.example.com/zoom/x/y.jpg S3 Bucket tiles-v1.s3.amazonaws.com Seviço legado old-tile-service.example.net Elastic Load Balancer tile-service-123456.us-east-1 .amazonaws.com
  • 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST : PRETTY URLS https://tiles.example.com/zoom/x/y.jpg https://tiles-origin.s3.amazonaws.com/f5fdc6f658a49284b.jpg Origin Request Event originPath = sha256(requestPath) CloudFront cache Cache key: tiles.example.com/zoom/x/y.jpg Cached response
  • 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: PROCESSAMENTO DE IMAGENS User Agent Distribuição CloudFront www.example.com Origin Request Event PUT API Gateway Image Thumbnail Function S3 Bucket image-thumbnails.s3.amazonaws.com GET S3 Bucket image-originals.s3.amazonaws.com GET 404
  • 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EXPANSÃO GLOBAL TRANSPARENTE Cliente da região A Deploy da região B https://saas.example.com Cliente da região B Deploy da região B
  • 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EXPANSÃO GLOBAL TRANSPARENTE
  • 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: SELEÇÃO DE ORIGEM id user 1 alex 2 bob 3 joe 4 jane Base da dados do usuário 200 OK Aplicação User Agent POST /login user=jane&pass=*** home-region na eu ap eu Set-Cookie: home-region=eu
  • 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: SELEÇÃO DE ORIGEM User Agent Distribuição CloudFrontion www.example.com Origem North America User DB Cache Behavior /login North America app DB Origem Europe Europe app DB home-region=eu ? Origem APAC APAC app DB Cache Behavior /app Origin Request Event
  • 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: ROUTE ON USER AGENT User Agents Desktop Mobile Bots e crawlers Distribuição CloudFront www.example.com Origin Request Event Mobile optimized app Client-rendered app Server-rendered app Cloudfront-Is-Mobile-Viewer? Cloudfront-Is-Desktop-Viewer? Cloudfront-Is-Tablet-Viewer? User-Agent?
  • 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: GERAR REDIRECIONAMENTO User Agent Distribuição CloudFront www.example.com HTTP redirect www.example.com/de Origin Request Event Cloudfront-Viewer-Country? Accept-Language?
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 'use strict'; const originDomainNames = { 'origin_1': 'origin.us-east-1.example.com', 'origin_2': 'origin.eu-west-1.example.com' }; const defaultOrigin = 'origin_1'; function chooseOrigin(headers) { /* Parse cookies, inspect headers, etc. */ if (condition1) { return 'origin_1'; } else if (condition2) { return 'origin_2'; } else { return default_origin; } } ORIGIN REQUEST: CUSTOM ROUTING CODE exports.handler = (event, context, callback) => { const request = event.Records[0].cf.request; const headers = request.headers; const selectedOrigin = chooseOrigin(headers); /* Modify the request's `origin` object. */ request.origin = { custom: { domainName: originDomainNames[selectedOrigin], keepAliveTimeout: 60, path: '/', port: 443, protocol: 'https', readTimeout: 5, sslProtocols: ['TLSv1', 'TLSv1.1'] } }; callback(null, request); };
  • 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront cache ORIGIN RESPONSE EVENTS CloudFront cache User Agents Viewer Request HTTP Origins Viewer Response Origin Response Origin Request Viewer Response Origin RequestViewer Request Origin Response
  • 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN RESPONSE EVENTS Executado em eventos de cache miss, depois que uma resposta é recebida da origem Fazer chamadas de redes externas Modificar o response headers antes de realizar o cache
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 'use strict'; exports.handler = (event, context, callback) => { const response = event.Records[0].cf.response; const headers = response.headers; const headerName = 'Strict-Transport-Security'; const headerValue = 'max-age=31536000; includeSubDomains'; headers[headerName.toLowerCase()] = [{ key: headerName, value: headerValue }]; callback(null, response); }; ORIGIN RESPONSE: INJECT HEADERS Content-Type Cache-Control HTTP Strict Transport Security (HSTS) Content-Security-Policy and more!
  • 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront cache VIEWER RESPONSE EVENTS CloudFront cache User Agents Viewer Request Origems HTTP Viewer Response Origin Response Origin Request Origin Response Origin RequestViewer Request Viewer Response
  • 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER RESPONSE EVENTS Executado em todas as requisições, depois que a resposta é recebida da origem ou do cache Modificar o response headers sem armazenar o resultado em cache Realizar chamadas de redes externas
  • 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER RESPONSE: SET USER COOKIES User Agent Distribuição CloudFront www.example.com CloudFront cache Origin fetch Cache miss Viewer response event const sid = uuidv4(); headers['set-cookie'].push({ Key: 'Set-Cookie', Value: 'sessionid=' + sid });
  • 42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Clientes de várias industrias Redes Sociais, Publicidade Digital, EdTech, Financeiro Enterprise E-commerce Mídia e Entretenimento Jogos
  • 43. “Aproximamos brasileiros para transformar itens em felicidade” “Usando a AWS temos menos acoplamento, mais independência e agilidade" A maior plataforma de classificados do Brasil, com mais de 7 milhões de visitantes únicos diários e 80 mil itens negociados diariamente Mais 100 desenvolvedores divididos em 22 equipes independentes
  • 44. O Desafio - Maior previsibilidade nas entregas Medir o impacto das mudanças no produto Testes A/B Atendendo os diversos times Altamente disponível, adicionando pouca latência ao produto e de fácil uso Atendendo toda a stack (frontend, backend, apps, etc…)
  • 46. Solução Pontos fortes: Independência Facilidade de desenvolvimento Multi plataforma Desafios: Latência Custos em escala