SlideShare a Scribd company logo
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Prateek Yadav, Software Development Engineer
Vasanth Kumararajan, Technical Program Manager
Woodrow Arrington, Sr. Product Manager Technical
04.11.18
Making Headless Drupal Serverless
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is covered in this session?
• Media Customer Challenges
• Headless Drupal
• Amazon CloudFront
• AWS Lambda@Edge
• Live Demo
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Media Company Challenges
Scalability
Performance
Security
Personalization
Flexibility Financial
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Typical Monolith Architecture
Authentication and
authorization
Content management
and processing
Localization
and personalization
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Authentication and
authorization
Content management
and processing
Localization
and personalization
Application code
Typical Monolith Architecture
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Trending towards Headless Drupal
Traditional Headless / Decoupled
Frontend
Backend
Backend
Frontends
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Multi-Endpoint
Headless Drupal Helps Solve
PerformanceFlexibility
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
… how can I address some of the other
challenges mentioned?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
… first let’s talk about being serverless
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
No Server
Management
Flexible
Scaling
Never Pay for
Idle Time
Built-in Availability
and Fault Tolerance
What does it mean to be serverless?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is AWS Lambda?
Changes in data
state
Requests to
endpoints
Changes in
resource state
1 2 3 4
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
… what if you could run your Lambda
functions even closer to your viewers?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon CloudFrontAWS Lambda
Lambda@Edge
AWS Lambda@Edge
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
114 Points of Presence (103 Edge locations + 11 Regional Edge Caches)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architecture (Simple, But Works)
Compute
viewer
StorageDatastore
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Origin
Basic AWS Regional Deployment
Compute
Database
Storage
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon CloudFront
Origin
AWS Location
AWS Location
AWS Location
AWS Location
AWS Location
AWS Location
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront: More than just byte delivery
Performance ScalabilityGlobal Reach Security Programmable Cost Effective
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Performance
Global Network & AWS backbone infrastructure
Conduct TCP handshakes closer to viewers
Keep-alive connections to reduce round-trip times (RTT)
Request collapsing
Fast content invalidations
Static + Dynamic
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Security
Access Control
• Origin Access Identity (OAI)
• Signed URLs / Cookies
• Geo blocking
Encryption
• Advanced protocols & ciphers
• Half / Full bridge HTTPS connections
• Certificate stapling (OCSP)
Compliance
• PCI
• HIPAA
• ISO
Integrations
• AWS Certificate Manager
• AWS Shield
• AWS WAF
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront Helps Solve
Scalability
PerformanceSecurity
Cost Effective
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
… let’s now talk about Lambda@Edge
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Taking AWS Lambda to the Edge
Changes in data
state
Requests to
endpoints
Changes in
resource state
1 2 3 4
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Write once, run Lambda functions globally
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.
Amazon CloudFront + Lambda@Edge
Origin
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
Globally
Distributed
Bring your own code to the Edge to improve viewer experience
Serverless
Compute
Programmable
CDN
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront events for Lambda@Edge
CloudFront
cache
Viewer Response Origin Response
Origin
Origin Request
Viewer
Viewer Request
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
From Monolithic to Serverless Microservices
Amazon
CloudFront
Authentication and
authorization
Content management
and processing
Localization
and personalization
Lambda@Edge FunctionsUser Agents HTTP Origins
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda@Edge Helps Solve
Personalization
Flexibility
Paywalls &
Authorization
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Media Company Challenges
Scalability
Performance
Security
Personalization
Flexibility Financial
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Media Company Website Dynamic Personalized
Content
Authentication
Dynamic News
Content
Static Content
(images,JS,CSS, …)
Customized Local
Content
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DEMO
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
… Lets dive deep into Lambda@Edge
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFront events for Lambda@Edge
CloudFront
cache
Viewer Response Origin Response
Origin
Origin Request
Viewer
Viewer Request
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VIEWER REQUEST EVENTS
CloudFront
cache
User Agents
Viewer Request
HTTP Origins
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
Executed on every request before CloudFront’s cache is checked
Modify cache key (URL, cookies, headers, query string)
Perform stateless authentication and authorization checks
Network calls at viewer request
Generate responses that will not be cached
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VIEWER REQUEST: AUTHORIZATION
Viewer Request Event
User Agent CloudFront distribution
www.example.com
NO
Paywall message,
403, redirect, etc.
$
Entitlement service
HTTP request
Access decision
HTTP Origins
OK
User database
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VIEWER REQUEST: STATELESS AUTH
JWT
JWT public key
Viewer Request Event
User Agent CloudFront distribution
www.example.com
JWT
HTTP 403, 3XX, etc.
NO
Access decision
Legacy application
S3 Bucket
Origin application
OK
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
{
"iss": "https://idp.example.com",
"client_id": "exampleclient",
"sub": "vkumarar",
"scope": {
"compute": "2018-05-11T00:00:00Z",
"edge": "2018-05-09T00:00:00Z",
"language": "ja"
},
}
VIEWER REQUEST: STATELESS AUTH
Example JWT payload:
Private claims for the user
interests in news artciles
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
Executed on cache miss, before a request is forwarded to the origin
Make one or more external network calls
Dynamically select an origin based on request headers
Implement pretty URLs by rewriting the origin URL
Generate responses that can be cached
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST: Content Aggregation
Example: News app landing page
Client: Each user has a preference for articles
http://yournewsaggregator.com/
Function:
• Validate and parse the JWT
• Fetches the relevant articles from Drupal
• Sends the aggregated response to the client CloudFront
cache
Viewer
Request
Origin
Request
Viewer
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUESTS: Template Rendering
(Body Generation)
User Agent CloudFront distribution
www.example.com
Cache Behavior
/blog
Origin Request
Event
S3 Bucket
blog-templates.s3.amazonaws.com
DynamoDB table
blog-posts
Outbound network
calls
Rendered templateCached response
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How template rendering works?
<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.
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
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.
DEMO
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
… so what are all the things you can do
with Lambda@Edge?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Highly Personalized Websites
• Response Generation at Viewer Request
• URL Rewrites
• Access Control at the Edge
• Remote Network Calls
• A/B Testing
• Content-Based Dynamic Origin Selection
© 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
Legacy Service
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 REQUESTS : 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: ORIGIN SELECTION
• Multiple origin setup
• Latency: Talk to the origin closest to the viewer
• Load balance across origins
• Controlled rollout of changes at origin
• A/B Testing of new features
• Blue/Green origin deploys
• Migrating between origins
• Including on-premise to cloud
• Search Engine Optimization
• Serve human and web crawler traffic from separate origins
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
"s3": {
"domainName": "green-bucket.s3.amazonaws.com”,
"path": "/originPath",
"authMethod": "origin-access-identity",
"region": "us-east-1",
"customHeaders": {
"my-custom-origin-header": [
{
"key": "My-Custom-Origin-Header",
"value": "test-value”
}
]
}
}
Origin Selection
• Origin is present as part of request
• event.Records[0].cf.request.origin
• Modified Origin should also be part of the request
structure returned
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Origin Selection – A/B Testing
Example: You want to test a new feature. It is only deployed to one of your origins.
In the function:
1. Check to see if this is a active session. (Say, using a cookie.)
2. For active sessions, set the origin based on the value in the cookie.
3. For a new session, decide whether to show A or B variant. And set the origin accordingly.
CloudF
ront
cache
Origin
Request
Viewer
Origin B
Origin A
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
desiredOrigin = decide(request);
/* Set custom origin fields*/
request.origin = {
custom: {
domainName: desiredOrigin,
port: 443,
protocol: 'https',
}
};
request.headers['host'] = [{ key: 'host',
value: desiredOrigin }];
callback(null, request);
};
Example – A/B Testing
function decide(request) {
if (request.headers[‘my-session-cookie’]) {
cookie = request.headers[‘my-session-
cookie’].value;
return decodeOrigin(cookie);
} else {
return chooseOrigin(request);
}
};
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
TRANSPARENT GLOBAL EXPANSION
Region A
customers
Region A
deployment
Region B
customers Region B
deployment
https://saas.example.com
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUEST: ORIGIN SELECTION
id user
1 alex
2 bob
3 joe
4 jane
User database
200 OK
Application
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: ORIGIN SELECTION
User Agent CloudFront distribution
www.example.com
North America
origin
User DB
Cache Behavior
/login
North America
app DB
Europe origin Europe app DB
home-region=eu ?
APAC origin 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 and
crawlers
CloudFront distribution
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: GENERATE REDIRECT
User Agent CloudFront distribution
www.example.com
HTTP redirect
www.example.com/de
Origin Request
Event
Cloudfront-Viewer-Country?
Accept-Language?
© 2018, 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
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: 5000,
path: '/',
port: 443,
protocol: 'https',
readTimeout: 5000,
sslProtocols: ['TLSv1', 'TLSv1.1']
}
};
callback(null, request);
};
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ORIGIN REQUESTS: IMAGE
PROCESSING
User Agent CloudFront distribution
www.example.com
Origin Request
Event
S3 Bucket
image-originals.s3.amazonaws.com
GET
/full-resolution image
Resized image based on request
configurations e.g. Device Type
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Media Company Challenges
Scalability
Performance
Security
Personalization
Flexibility Financial
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Getting Started Resources
Amazon CloudFront Getting Started
https://aws.amazon.com/cloudfront/getting-started/
AWS Lambda@Edge
https://aws.amazon.com/lambda/edge/
Content Delivery AWS Blog Channel
https://aws.amazon.com/blogs/networking-and-content-delivery/
Articles with sample code and step by step guides for:
• Accelerating Drupal with Amazon CloudFront
• Resizing Images on the Fly with Lambda@Edge
• Authorization@Edge using JSON Web Tokens using Lambda@Ed
• and more…
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!

More Related Content

What's hot

An Overview of Apache Cassandra
An Overview of Apache CassandraAn Overview of Apache Cassandra
An Overview of Apache Cassandra
DataStax
 
[234]멀티테넌트 하둡 클러스터 운영 경험기
[234]멀티테넌트 하둡 클러스터 운영 경험기[234]멀티테넌트 하둡 클러스터 운영 경험기
[234]멀티테넌트 하둡 클러스터 운영 경험기
NAVER D2
 
Cassandra Database
Cassandra DatabaseCassandra Database
Cassandra Database
YounesCharfaoui
 
Elasticsearch for beginners
Elasticsearch for beginnersElasticsearch for beginners
Elasticsearch for beginners
Neil Baker
 
How Orange Financial combat financial frauds over 50M transactions a day usin...
How Orange Financial combat financial frauds over 50M transactions a day usin...How Orange Financial combat financial frauds over 50M transactions a day usin...
How Orange Financial combat financial frauds over 50M transactions a day usin...
StreamNative
 
Introduction to Presto at Treasure Data
Introduction to Presto at Treasure DataIntroduction to Presto at Treasure Data
Introduction to Presto at Treasure Data
Taro L. Saito
 
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEOClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
Altinity Ltd
 
Elastic 101 - Get started
Elastic 101 - Get startedElastic 101 - Get started
Elastic 101 - Get started
Ismaeel Enjreny
 
ClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei MilovidovClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei Milovidov
Altinity Ltd
 
XML & XPath Injections
XML & XPath InjectionsXML & XPath Injections
XML & XPath Injections
AMol NAik
 
Building a Versatile Analytics Pipeline on Top of Apache Spark with Mikhail C...
Building a Versatile Analytics Pipeline on Top of Apache Spark with Mikhail C...Building a Versatile Analytics Pipeline on Top of Apache Spark with Mikhail C...
Building a Versatile Analytics Pipeline on Top of Apache Spark with Mikhail C...
Databricks
 
Real-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFiReal-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFi
Manish Gupta
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
Gokhan Atil
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
MariaDB plc
 
Speed Up Uber's Presto with Alluxio
Speed Up Uber's Presto with AlluxioSpeed Up Uber's Presto with Alluxio
Speed Up Uber's Presto with Alluxio
Alluxio, Inc.
 
Data saturday Oslo Azure Purview Erwin de Kreuk
Data saturday Oslo Azure Purview Erwin de KreukData saturday Oslo Azure Purview Erwin de Kreuk
Data saturday Oslo Azure Purview Erwin de Kreuk
Erwin de Kreuk
 
Oracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodOracle Client Failover - Under The Hood
Oracle Client Failover - Under The Hood
Ludovico Caldara
 
Cql – cassandra query language
Cql – cassandra query languageCql – cassandra query language
Cql – cassandra query language
Courtney Robinson
 
From Zero to Data Flow in Hours with Apache NiFi
From Zero to Data Flow in Hours with Apache NiFiFrom Zero to Data Flow in Hours with Apache NiFi
From Zero to Data Flow in Hours with Apache NiFi
DataWorks Summit/Hadoop Summit
 
Apache Spark Architecture
Apache Spark ArchitectureApache Spark Architecture
Apache Spark Architecture
Alexey Grishchenko
 

What's hot (20)

An Overview of Apache Cassandra
An Overview of Apache CassandraAn Overview of Apache Cassandra
An Overview of Apache Cassandra
 
[234]멀티테넌트 하둡 클러스터 운영 경험기
[234]멀티테넌트 하둡 클러스터 운영 경험기[234]멀티테넌트 하둡 클러스터 운영 경험기
[234]멀티테넌트 하둡 클러스터 운영 경험기
 
Cassandra Database
Cassandra DatabaseCassandra Database
Cassandra Database
 
Elasticsearch for beginners
Elasticsearch for beginnersElasticsearch for beginners
Elasticsearch for beginners
 
How Orange Financial combat financial frauds over 50M transactions a day usin...
How Orange Financial combat financial frauds over 50M transactions a day usin...How Orange Financial combat financial frauds over 50M transactions a day usin...
How Orange Financial combat financial frauds over 50M transactions a day usin...
 
Introduction to Presto at Treasure Data
Introduction to Presto at Treasure DataIntroduction to Presto at Treasure Data
Introduction to Presto at Treasure Data
 
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEOClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
 
Elastic 101 - Get started
Elastic 101 - Get startedElastic 101 - Get started
Elastic 101 - Get started
 
ClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei MilovidovClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei Milovidov
 
XML & XPath Injections
XML & XPath InjectionsXML & XPath Injections
XML & XPath Injections
 
Building a Versatile Analytics Pipeline on Top of Apache Spark with Mikhail C...
Building a Versatile Analytics Pipeline on Top of Apache Spark with Mikhail C...Building a Versatile Analytics Pipeline on Top of Apache Spark with Mikhail C...
Building a Versatile Analytics Pipeline on Top of Apache Spark with Mikhail C...
 
Real-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFiReal-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFi
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
Speed Up Uber's Presto with Alluxio
Speed Up Uber's Presto with AlluxioSpeed Up Uber's Presto with Alluxio
Speed Up Uber's Presto with Alluxio
 
Data saturday Oslo Azure Purview Erwin de Kreuk
Data saturday Oslo Azure Purview Erwin de KreukData saturday Oslo Azure Purview Erwin de Kreuk
Data saturday Oslo Azure Purview Erwin de Kreuk
 
Oracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodOracle Client Failover - Under The Hood
Oracle Client Failover - Under The Hood
 
Cql – cassandra query language
Cql – cassandra query languageCql – cassandra query language
Cql – cassandra query language
 
From Zero to Data Flow in Hours with Apache NiFi
From Zero to Data Flow in Hours with Apache NiFiFrom Zero to Data Flow in Hours with Apache NiFi
From Zero to Data Flow in Hours with Apache NiFi
 
Apache Spark Architecture
Apache Spark ArchitectureApache Spark Architecture
Apache Spark Architecture
 

Similar to Making Headless Drupal Serverless

Taking Serverless to the Edge
Taking Serverless to the Edge Taking Serverless to the Edge
Taking Serverless to the Edge
Amazon Web Services
 
Taking serverless to the edge
Taking serverless to the edgeTaking serverless to the edge
Taking serverless to the edge
Amazon Web Services
 
Taking Serverless to the Edge - SRV330 - Chicago AWS Summit
Taking Serverless to the Edge - SRV330 - Chicago AWS SummitTaking Serverless to the Edge - SRV330 - Chicago AWS Summit
Taking Serverless to the Edge - SRV330 - Chicago AWS Summit
Amazon Web Services
 
Taking Serverless to the Edge - AWS Online Tech Talks
Taking Serverless to the Edge - AWS Online Tech TalksTaking Serverless to the Edge - AWS Online Tech Talks
Taking Serverless to the Edge - AWS Online Tech Talks
Amazon Web Services
 
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
Amazon Web Services
 
Best of AWS re:Invent 2017
Best of AWS re:Invent 2017Best of AWS re:Invent 2017
Best of AWS re:Invent 2017
Amazon Web Services
 
Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...
Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...
Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...
Amazon Web Services
 
Websites go Serverless - Floor28
Websites go Serverless - Floor28Websites go Serverless - Floor28
Websites go Serverless - Floor28
Boaz Ziniman
 
Websites go Serverless | AWS Floor28
Websites go Serverless | AWS Floor28Websites go Serverless | AWS Floor28
Websites go Serverless | AWS Floor28
Amazon Web Services
 
How to build scalable and resilient applications in the cloud - AWS Summit Ca...
How to build scalable and resilient applications in the cloud - AWS Summit Ca...How to build scalable and resilient applications in the cloud - AWS Summit Ca...
How to build scalable and resilient applications in the cloud - AWS Summit Ca...
Amazon Web Services
 
Wildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel AvivWildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel Aviv
Boaz Ziniman
 
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Amazon Web Services
 
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Amazon Web Services
 
Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 2018
Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 2018Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 2018
Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 2018
Amazon Web Services
 
Resiliency and Availability Design Patterns for the Cloud
Resiliency and Availability Design Patterns for the CloudResiliency and Availability Design Patterns for the Cloud
Resiliency and Availability Design Patterns for the Cloud
Amazon Web Services
 
Scaling up to and beyond 10M users
Scaling up to and beyond 10M usersScaling up to and beyond 10M users
Scaling up to and beyond 10M users
Amazon Web Services
 
Serverless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best PracticesServerless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best Practices
Amazon Web Services
 
Websites go Serverless - ILDevCon
Websites go Serverless - ILDevConWebsites go Serverless - ILDevCon
Websites go Serverless - ILDevCon
Boaz Ziniman
 
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
Amazon Web Services
 
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Amazon Web Services
 

Similar to Making Headless Drupal Serverless (20)

Taking Serverless to the Edge
Taking Serverless to the Edge Taking Serverless to the Edge
Taking Serverless to the Edge
 
Taking serverless to the edge
Taking serverless to the edgeTaking serverless to the edge
Taking serverless to the edge
 
Taking Serverless to the Edge - SRV330 - Chicago AWS Summit
Taking Serverless to the Edge - SRV330 - Chicago AWS SummitTaking Serverless to the Edge - SRV330 - Chicago AWS Summit
Taking Serverless to the Edge - SRV330 - Chicago AWS Summit
 
Taking Serverless to the Edge - AWS Online Tech Talks
Taking Serverless to the Edge - AWS Online Tech TalksTaking Serverless to the Edge - AWS Online Tech Talks
Taking Serverless to the Edge - AWS Online Tech Talks
 
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
 
Best of AWS re:Invent 2017
Best of AWS re:Invent 2017Best of AWS re:Invent 2017
Best of AWS re:Invent 2017
 
Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...
Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...
Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...
 
Websites go Serverless - Floor28
Websites go Serverless - Floor28Websites go Serverless - Floor28
Websites go Serverless - Floor28
 
Websites go Serverless | AWS Floor28
Websites go Serverless | AWS Floor28Websites go Serverless | AWS Floor28
Websites go Serverless | AWS Floor28
 
How to build scalable and resilient applications in the cloud - AWS Summit Ca...
How to build scalable and resilient applications in the cloud - AWS Summit Ca...How to build scalable and resilient applications in the cloud - AWS Summit Ca...
How to build scalable and resilient applications in the cloud - AWS Summit Ca...
 
Wildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel AvivWildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel Aviv
 
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
 
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
 
Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 2018
Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 2018Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 2018
Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 2018
 
Resiliency and Availability Design Patterns for the Cloud
Resiliency and Availability Design Patterns for the CloudResiliency and Availability Design Patterns for the Cloud
Resiliency and Availability Design Patterns for the Cloud
 
Scaling up to and beyond 10M users
Scaling up to and beyond 10M usersScaling up to and beyond 10M users
Scaling up to and beyond 10M users
 
Serverless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best PracticesServerless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best Practices
 
Websites go Serverless - ILDevCon
Websites go Serverless - ILDevConWebsites go Serverless - ILDevCon
Websites go Serverless - ILDevCon
 
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
 
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
 

More from 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 Fargate
Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
Amazon 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
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
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 Workloads
Amazon Web Services
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
Amazon 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 sfatare
Amazon 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 NodeJS
Amazon 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 web
Amazon 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 sfatare
Amazon 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 AWS
Amazon 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 Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
Amazon 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 Service
Amazon Web Services
 

More from 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
 

Making Headless Drupal Serverless

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Prateek Yadav, Software Development Engineer Vasanth Kumararajan, Technical Program Manager Woodrow Arrington, Sr. Product Manager Technical 04.11.18 Making Headless Drupal Serverless
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What is covered in this session? • Media Customer Challenges • Headless Drupal • Amazon CloudFront • AWS Lambda@Edge • Live Demo
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Media Company Challenges Scalability Performance Security Personalization Flexibility Financial
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Typical Monolith Architecture Authentication and authorization Content management and processing Localization and personalization
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Authentication and authorization Content management and processing Localization and personalization Application code Typical Monolith Architecture
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Trending towards Headless Drupal Traditional Headless / Decoupled Frontend Backend Backend Frontends
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Multi-Endpoint Headless Drupal Helps Solve PerformanceFlexibility
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. … how can I address some of the other challenges mentioned?
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. … first let’s talk about being serverless
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. No Server Management Flexible Scaling Never Pay for Idle Time Built-in Availability and Fault Tolerance What does it mean to be serverless?
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What is AWS Lambda? Changes in data state Requests to endpoints Changes in resource state 1 2 3 4
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. … what if you could run your Lambda functions even closer to your viewers?
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon CloudFrontAWS Lambda Lambda@Edge AWS Lambda@Edge
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 114 Points of Presence (103 Edge locations + 11 Regional Edge Caches)
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Architecture (Simple, But Works) Compute viewer StorageDatastore
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Origin Basic AWS Regional Deployment Compute Database Storage
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon CloudFront Origin AWS Location AWS Location AWS Location AWS Location AWS Location AWS Location
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront: More than just byte delivery Performance ScalabilityGlobal Reach Security Programmable Cost Effective
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Performance Global Network & AWS backbone infrastructure Conduct TCP handshakes closer to viewers Keep-alive connections to reduce round-trip times (RTT) Request collapsing Fast content invalidations Static + Dynamic
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Security Access Control • Origin Access Identity (OAI) • Signed URLs / Cookies • Geo blocking Encryption • Advanced protocols & ciphers • Half / Full bridge HTTPS connections • Certificate stapling (OCSP) Compliance • PCI • HIPAA • ISO Integrations • AWS Certificate Manager • AWS Shield • AWS WAF
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront Helps Solve Scalability PerformanceSecurity Cost Effective
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. … let’s now talk about Lambda@Edge
  • 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Taking AWS Lambda to the Edge Changes in data state Requests to endpoints Changes in resource state 1 2 3 4
  • 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Write once, run Lambda functions globally N Virginia AWS Location AWS Location AWS Location AWS Location AWS Location AWS Location
  • 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon CloudFront + Lambda@Edge Origin AWS Location AWS Location AWS Location AWS Location AWS Location AWS Location
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda@Edge Globally Distributed Bring your own code to the Edge to improve viewer experience Serverless Compute Programmable CDN
  • 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront events for Lambda@Edge CloudFront cache Viewer Response Origin Response Origin Origin Request Viewer Viewer Request
  • 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. From Monolithic to Serverless Microservices Amazon CloudFront Authentication and authorization Content management and processing Localization and personalization Lambda@Edge FunctionsUser Agents HTTP Origins
  • 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda@Edge Helps Solve Personalization Flexibility Paywalls & Authorization
  • 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Media Company Challenges Scalability Performance Security Personalization Flexibility Financial
  • 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Media Company Website Dynamic Personalized Content Authentication Dynamic News Content Static Content (images,JS,CSS, …) Customized Local Content
  • 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DEMO
  • 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. … Lets dive deep into Lambda@Edge
  • 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFront events for Lambda@Edge CloudFront cache Viewer Response Origin Response Origin Origin Request Viewer Viewer Request
  • 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER REQUEST EVENTS CloudFront cache User Agents Viewer Request HTTP Origins Viewer Response Origin Response Origin Request Viewer Response Origin Response Origin RequestViewer Request
  • 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER REQUEST EVENTS Executed on every request before CloudFront’s cache is checked Modify cache key (URL, cookies, headers, query string) Perform stateless authentication and authorization checks Network calls at viewer request Generate responses that will not be cached
  • 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER REQUEST: AUTHORIZATION Viewer Request Event User Agent CloudFront distribution www.example.com NO Paywall message, 403, redirect, etc. $ Entitlement service HTTP request Access decision HTTP Origins OK User database
  • 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. VIEWER REQUEST: STATELESS AUTH JWT JWT public key Viewer Request Event User Agent CloudFront distribution www.example.com JWT HTTP 403, 3XX, etc. NO Access decision Legacy application S3 Bucket Origin application OK
  • 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. { "iss": "https://idp.example.com", "client_id": "exampleclient", "sub": "vkumarar", "scope": { "compute": "2018-05-11T00:00:00Z", "edge": "2018-05-09T00:00:00Z", "language": "ja" }, } VIEWER REQUEST: STATELESS AUTH Example JWT payload: Private claims for the user interests in news artciles
  • 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 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
  • 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST EVENTS Executed on cache miss, before a request is forwarded to the origin Make one or more external network calls Dynamically select an origin based on request headers Implement pretty URLs by rewriting the origin URL Generate responses that can be cached
  • 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: Content Aggregation Example: News app landing page Client: Each user has a preference for articles http://yournewsaggregator.com/ Function: • Validate and parse the JWT • Fetches the relevant articles from Drupal • Sends the aggregated response to the client CloudFront cache Viewer Request Origin Request Viewer
  • 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUESTS: Template Rendering (Body Generation) User Agent CloudFront distribution www.example.com Cache Behavior /blog Origin Request Event S3 Bucket blog-templates.s3.amazonaws.com DynamoDB table blog-posts Outbound network calls Rendered templateCached response
  • 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How template rendering works? <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..." }, { ... } ]
  • 45. © 2018, 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 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); }); }); };
  • 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DEMO
  • 47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. … so what are all the things you can do with Lambda@Edge?
  • 48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Highly Personalized Websites • Response Generation at Viewer Request • URL Rewrites • Access Control at the Edge • Remote Network Calls • A/B Testing • Content-Based Dynamic Origin Selection
  • 49. © 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 Legacy Service old-tile- service.example.net Elastic Load Balancer tile-service-123456.us-east- 1 .amazonaws.com
  • 50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUESTS : 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
  • 51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: ORIGIN SELECTION • Multiple origin setup • Latency: Talk to the origin closest to the viewer • Load balance across origins • Controlled rollout of changes at origin • A/B Testing of new features • Blue/Green origin deploys • Migrating between origins • Including on-premise to cloud • Search Engine Optimization • Serve human and web crawler traffic from separate origins
  • 52. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. "s3": { "domainName": "green-bucket.s3.amazonaws.com”, "path": "/originPath", "authMethod": "origin-access-identity", "region": "us-east-1", "customHeaders": { "my-custom-origin-header": [ { "key": "My-Custom-Origin-Header", "value": "test-value” } ] } } Origin Selection • Origin is present as part of request • event.Records[0].cf.request.origin • Modified Origin should also be part of the request structure returned
  • 53. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Origin Selection – A/B Testing Example: You want to test a new feature. It is only deployed to one of your origins. In the function: 1. Check to see if this is a active session. (Say, using a cookie.) 2. For active sessions, set the origin based on the value in the cookie. 3. For a new session, decide whether to show A or B variant. And set the origin accordingly. CloudF ront cache Origin Request Viewer Origin B Origin A
  • 54. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. exports.handler = (event, context, callback) => { const request = event.Records[0].cf.request; desiredOrigin = decide(request); /* Set custom origin fields*/ request.origin = { custom: { domainName: desiredOrigin, port: 443, protocol: 'https', } }; request.headers['host'] = [{ key: 'host', value: desiredOrigin }]; callback(null, request); }; Example – A/B Testing function decide(request) { if (request.headers[‘my-session-cookie’]) { cookie = request.headers[‘my-session- cookie’].value; return decodeOrigin(cookie); } else { return chooseOrigin(request); } };
  • 55. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. TRANSPARENT GLOBAL EXPANSION Region A customers Region A deployment Region B customers Region B deployment https://saas.example.com
  • 56. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: ORIGIN SELECTION id user 1 alex 2 bob 3 joe 4 jane User database 200 OK Application User Agent POST /login user=jane&pass=*** home-region na eu ap eu Set-Cookie: home-region=eu
  • 57. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: ORIGIN SELECTION User Agent CloudFront distribution www.example.com North America origin User DB Cache Behavior /login North America app DB Europe origin Europe app DB home-region=eu ? APAC origin APAC app DB Cache Behavior /app Origin Request Event
  • 58. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: ROUTE ON USER AGENT User Agents Desktop Mobile Bots and crawlers CloudFront distribution 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?
  • 59. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUEST: GENERATE REDIRECT User Agent CloudFront distribution www.example.com HTTP redirect www.example.com/de Origin Request Event Cloudfront-Viewer-Country? Accept-Language?
  • 60. © 2018, 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 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: 5000, path: '/', port: 443, protocol: 'https', readTimeout: 5000, sslProtocols: ['TLSv1', 'TLSv1.1'] } }; callback(null, request); };
  • 61. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ORIGIN REQUESTS: IMAGE PROCESSING User Agent CloudFront distribution www.example.com Origin Request Event S3 Bucket image-originals.s3.amazonaws.com GET /full-resolution image Resized image based on request configurations e.g. Device Type
  • 62. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Media Company Challenges Scalability Performance Security Personalization Flexibility Financial
  • 63. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Getting Started Resources Amazon CloudFront Getting Started https://aws.amazon.com/cloudfront/getting-started/ AWS Lambda@Edge https://aws.amazon.com/lambda/edge/ Content Delivery AWS Blog Channel https://aws.amazon.com/blogs/networking-and-content-delivery/ Articles with sample code and step by step guides for: • Accelerating Drupal with Amazon CloudFront • Resizing Images on the Fly with Lambda@Edge • Authorization@Edge using JSON Web Tokens using Lambda@Ed • and more…
  • 64. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!