SlideShare a Scribd company logo
1 of 46
Download to read offline
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Vlad Vlasceanu, Ganesh Subramaniam & Brandon Cuff
November 29, 2016
DAT309
How Fulfillment by Amazon (FBA) and Scopely
Improved Results and Reduced Costs
with a Serverless Architecture
What to Expect from the Session
• Overview of serverless architectures
• Serverless patterns in high performance data use cases
• Fulfillment by Amazon: Serverless stream processing
• Scopely: Serverless logging & hot key detection
What is a Serverless Architecture?
Build applications and services
What is a Serverless Architecture?
Build applications and services
… without managing infrastructure
What is a Serverless Architecture?
Build applications and services
… without managing infrastructure
• Function as a unit of scale
• Decrease complexity, abstracted
language runtime
• Run code when it’s needed
• Enable increased agility
Components of Serverless Architectures
AWS Lambda
Trigger-based Lambda functions
Components of Serverless Architectures
AWS Lambda
Trigger-based Lambda functions
Streaming Data
Amazon Kinesis
Amazon DynamoDB Streams
APIs
Amazon API Gateway
Event Sources
Amazon CloudWatch
Amazon S3
AWS Config
Amazon SNS
Data Persistence
Amazon DynamoDB
AWS Elasticsearch Service
Amazon S3
Integration Points
Amazon VPC resources
AWS service APIs
3rd party services
Data Enablement
• Data is always part of the architecture
Data Enablement
• Data is always part of the architecture
• Data as a trigger for serverless processing
• Data as the object of serverless processing
• Data as the result of serverless processing
Data Processing Abstraction
• Lambda functions as event handlers:
one function per event type
• Lambda functions as serverless back ends:
one function per API / path
• Lambda functions for stream/data processing
one function per record or data type
Helps maintainability - hard to end up with monolithic/spaghetti code
Active Role
• Processing data at scale
• Event-based invocation
• ETL orchestration
• On-demand processing
Advantages:
• Reduce operational complexities
• Operational cost optimization
Serverless High Performance Data Patterns
Support Role
• Optimization of pre-existing
workloads and database utilization
• Management, monitoring
• Improved anomaly detection and
reaction
Advantages:
• Improved resilience
• Operational cost optimization
Serverless High Performance Data Patterns
FBA Seller Inventory Authority
Platform
Serverless Logging &
Hot Key Detection
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
FBA Seller
Inventory Authority Platform
An Inventory Data Platform Using Serverless Architecture
Ganesh Subramaniam, Sr. Software Engineer, Amazon
How Does FBA Work?
1 Send
Inventory
2 Receive & Store
4 Pick, Pack & Ship
5 Customer Service
6 Customer Returns
Customer
Orders Product
3
Data Platform Goals
• Single source of truth for seller’s inventory
• Reconciled view of inventory
• Surface and track discrepancies
Design Requirements
• Should handle high volume of input messages (> 10000 tps)
• Should handle hot keys in input messages
• E.g., Received inventory message for a very large shipment
• Should handle duplicate and out of order input messages
• Must maintain an audit trail for every inventory quantity
change
Seller Inventory Authority Platform
Inventory Transaction Service
Kinesis
AWS Lambda
Pre-receive
processor
Adjustment
processor
Transaction
processor
Shipments Adjustment Inventory
transactions
InventoryQueryService
Warehouse
Management
Systems
Warehouse
Management
Systems
DDB Streams A/C balance
Processor
DDB Streams
Archivers Kinesis Firehose
S3
Account
Balances
Redshift
Analytics
Inbound
Records
Publisher Amazon
Elasticsearch
Archivers
Kinesis Firehose
SNS Topics
Clients
ClientsInventory Events/
Notifications
Launch Results
• 22 dev weeks savings in operational costs across 11
fleets
• Design to launch < 4 months
• Improved the accuracy of inbound quantities between
5% to 10%
• Reduced cost of business operations (for example,
seller contacts)
• Developers in the team enjoyed using AWS managed
services
Best Practices that helped
• Container reuse
• Instrument, measure and monitor
• Abstract Launch scaffolding from entity processing
• Canary and Dashboards
Best Practices that helped
• Container reuse
• Instrument, measure and monitor
• Abstract Launch scaffolding from entity processing
• Canary and Dashboards
Metrics and Instrumentation
if (adjustmentManager.doesAdjustmentAlreadyExist(metrics, adjustment)) {
// this adjustment already exists in our store. Nothing further needs to be done.
metrics.addCount(METRIC_IDEMPOTENT_CHECK_FAILED, 1, Unit.ONE);
log.debug("Adjustment already exists in DB. " + adjustment);
return null;
}
metrics.addCount(adjustment.getType().name(), 1, Unit.ONE);
metrics.addCount(String.join("#", adjustment.getSource().name(),
adjustment.getType().name()), 1, Unit.ONE);
To mitigate the lack of debug/tracing capabilities with Lambda, we
placed significant emphasis in instrumenting our code to help
understand how the code was performing during runtime.
Best Practices that helped
• Container reuse
• Instrument, measure and monitor
• Abstract Launch scaffolding from entity processing
• Canary and Dashboards
LambdaLaunchHelper
 Invokes the appropriate event handler with the metrics instance and the
input
 Event Handler is responsible for the deserialization of the items in the
request payload and invokes the Entity processor with the metrics instance
and the deserialized entity.
 Common error/fault handling – writing to S3 and skipping the individual
entity at fault or fail the entire batch.
 Common metrics
• Batch Size
• Total Time to process the batch
• Time to process an individual entity
• Entity Count in the batch
• Fault Count
Best Practices that helped
• Container reuse
• Instrument, measure and monitor
• Abstract Launch scaffolding from entity processing
• Canary and Dashboards
Canary and Availability of Pipeline
• Regular submission of synthetic transactions and events
to the pipeline to monitor the health of the pipeline.
• Use different keys to ensure that we monitor the various
shards at random
• Also helps us monitor to ensure we are within SLA for end to
end processing time
• Use Kinesis shard-level metrics to identify any potential
backlog or issues in the stream processing pipeline.
Dashboard and Monitoring
Average Transaction Processing Time Oldest Transaction Age Canary Processing Time
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Brandon Cuff, Sr. Software Engineer, Scopely
Serverless Logging &
Hot Key Detection
Scopely’s Mobile Games
6+ million daily active users
1 million requests per minute
100+ API servers (c3.2xlarge)
Scopely’s Game Server Architecture
Amazon DynamoDB Partitioning
Our Hot Key Problem
What are hot keys?
• Heavily requested keys/objects
localized on a single
partition/shard/node
• Subject to capacity of that single
partition/shard/node
Amazon DynamoDB table
symptoms:
• Total consumed capacity is less
than provisioned capacity
• And experiencing throttle events
Our Hot Key Detection Process
Application uses Count Min Sketch to track top 10 keys then logs them
periodically (once per minute)
Count Min Sketch
• Probabilistic algorithm
• Fixed size of memory to track unlimited operations
• Small chance of a error
memcached-get-count topkey[1]: key=3.user.41401542 count=354 totalCount=68912 frequency=.00514
Architecture Overview
Hot Key Event
Lambda will take our log message and convert it into an Elasticsearch
document
memcached-get-count topkey[1]: key=3.user.41401542 count=354 totalCount=68912 frequency=.00514
{
...
"topkey_category": "memcached-get-count",
"topkey_key": "3.user.41401542",
"topkey_count": 354,
"topkey_totalCount": 68912,
"topkey_frequency": .00514
}
Kibana Dashboard
Results & Lessons Learned
We Had More Bugs Than We Thought We Did!
Special case user ids
Key: “user.-1”
Configuration objects with a single
key retrieved on every request
Key: “dice-game-settings”
Didn’t notice because it wasn’t
causing problems (yet...).
ElastiCache Memcached Nodes
One node is sending out much more
data than the rest
Large Keys Are Also a Problem
We can look for unusually large keys if we increment by the size of objects
rather than 1
You can get the total bandwidth consumed by a specific key by summing the
events over a time period.
memcached-get-count topkey[1]: key=3.Dice.inv.21645428 size=20354 totalCount=1008912 frequency=.0203
We Caught Some Bots and Spammers
Initially shut bad users down
by deleting accounts.
Later implemented per-user
request rate limiting via
Memcached counters
Discovered Poor Client Behavior
• Hot keys were discovered on
several users
• Filtering by client platform revealed
that they were all from Android
• Android client made a request for
every game in the game list which
was huge for some small number
of users (making their user ids hot
keys)
brandon@scopely.com
github.com/bcuff
Thank you!
Remember to complete
your evaluations!
Related Sessions
ARC402 - Serverless Architectural Patterns and Best Practices
- Drew Dennis & Maitreya Ranganath, AWS Solutions Architects; Ajoy Kumar, Architect,
BMC Software
DAT304 - Deep Dive on Amazon DynamoDB
- Rick Houlihan, AWS Principal TPM, DBS NoSQL
DAT306 – ElastiCache Deep Dive: Best Practices and Usage Patterns
- Michael Labib, AWS In-Memory NoSQL Solutions Architect; Brian Kaiser, CTO, Hudl

More Related Content

What's hot

Finding the First Slice
Finding the First SliceFinding the First Slice
Finding the First SliceAgileDenver
 
DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...
DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...
DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...Hakka Labs
 
Practical Elasticsearch - real world use cases
Practical Elasticsearch - real world use casesPractical Elasticsearch - real world use cases
Practical Elasticsearch - real world use casesItamar
 
Do I Use Planner, Project Online, or Azure DevOps?
Do I Use Planner, Project Online, or Azure DevOps?Do I Use Planner, Project Online, or Azure DevOps?
Do I Use Planner, Project Online, or Azure DevOps?Christian Buckley
 
Microposts2015 - Social Spam Detection on Twitter
Microposts2015 - Social Spam Detection on TwitterMicroposts2015 - Social Spam Detection on Twitter
Microposts2015 - Social Spam Detection on Twitterazubiaga
 
The 5 Levels Planning in Agile
The 5 Levels Planning in AgileThe 5 Levels Planning in Agile
The 5 Levels Planning in AgileDimitri Ponomareff
 
From Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover WeeklyFrom Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover WeeklyChris Johnson
 
Agile Capacity Management
Agile Capacity ManagementAgile Capacity Management
Agile Capacity ManagementPrecisely
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaAmazee Labs
 
Transformers in Vision: From Zero to Hero
Transformers in Vision: From Zero to HeroTransformers in Vision: From Zero to Hero
Transformers in Vision: From Zero to HeroBill Liu
 
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...Khirulnizam Abd Rahman
 
Big Data: Social Network Analysis
Big Data: Social Network AnalysisBig Data: Social Network Analysis
Big Data: Social Network AnalysisMichel Bruley
 
NLP using transformers
NLP using transformers NLP using transformers
NLP using transformers Arvind Devaraj
 
Active Learning in Collaborative Filtering Recommender Systems : a Survey
Active Learning in Collaborative Filtering Recommender Systems : a SurveyActive Learning in Collaborative Filtering Recommender Systems : a Survey
Active Learning in Collaborative Filtering Recommender Systems : a SurveyUniversity of Bergen
 
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...Marcin Bielak
 

What's hot (18)

Finding the First Slice
Finding the First SliceFinding the First Slice
Finding the First Slice
 
DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...
DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...
DataEngConf: Building a Music Recommender System from Scratch with Spotify Da...
 
Practical Elasticsearch - real world use cases
Practical Elasticsearch - real world use casesPractical Elasticsearch - real world use cases
Practical Elasticsearch - real world use cases
 
Do I Use Planner, Project Online, or Azure DevOps?
Do I Use Planner, Project Online, or Azure DevOps?Do I Use Planner, Project Online, or Azure DevOps?
Do I Use Planner, Project Online, or Azure DevOps?
 
Microposts2015 - Social Spam Detection on Twitter
Microposts2015 - Social Spam Detection on TwitterMicroposts2015 - Social Spam Detection on Twitter
Microposts2015 - Social Spam Detection on Twitter
 
The 5 Levels Planning in Agile
The 5 Levels Planning in AgileThe 5 Levels Planning in Agile
The 5 Levels Planning in Agile
 
From Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover WeeklyFrom Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover Weekly
 
Agile Capacity Management
Agile Capacity ManagementAgile Capacity Management
Agile Capacity Management
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & Kibana
 
Transformers in Vision: From Zero to Hero
Transformers in Vision: From Zero to HeroTransformers in Vision: From Zero to Hero
Transformers in Vision: From Zero to Hero
 
Sprint
SprintSprint
Sprint
 
Story point
Story pointStory point
Story point
 
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
 
Big Data: Social Network Analysis
Big Data: Social Network AnalysisBig Data: Social Network Analysis
Big Data: Social Network Analysis
 
NLP using transformers
NLP using transformers NLP using transformers
NLP using transformers
 
Active Learning in Collaborative Filtering Recommender Systems : a Survey
Active Learning in Collaborative Filtering Recommender Systems : a SurveyActive Learning in Collaborative Filtering Recommender Systems : a Survey
Active Learning in Collaborative Filtering Recommender Systems : a Survey
 
Sprint review presentation
Sprint review presentationSprint review presentation
Sprint review presentation
 
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
 

Similar to AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Results and Reduced Costs with a Serverless Architecture (DAT309)

FSI201 FINRA’s Managed Data Lake – Next Gen Analytics in the Cloud
FSI201 FINRA’s Managed Data Lake – Next Gen Analytics in the CloudFSI201 FINRA’s Managed Data Lake – Next Gen Analytics in the Cloud
FSI201 FINRA’s Managed Data Lake – Next Gen Analytics in the CloudAmazon Web Services
 
(ARC310) Solving Amazon's Catalog Contention With Amazon Kinesis
(ARC310) Solving Amazon's Catalog Contention With Amazon Kinesis(ARC310) Solving Amazon's Catalog Contention With Amazon Kinesis
(ARC310) Solving Amazon's Catalog Contention With Amazon KinesisAmazon Web Services
 
Real-time Streaming and Querying with Amazon Kinesis and Amazon Elastic MapRe...
Real-time Streaming and Querying with Amazon Kinesis and Amazon Elastic MapRe...Real-time Streaming and Querying with Amazon Kinesis and Amazon Elastic MapRe...
Real-time Streaming and Querying with Amazon Kinesis and Amazon Elastic MapRe...Amazon Web Services
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon RedshiftAmazon Web Services
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon RedshiftAmazon Web Services
 
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Amazon Web Services
 
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)Amazon Web Services
 
AWS Webcast - Introduction to Amazon Kinesis
AWS Webcast - Introduction to Amazon KinesisAWS Webcast - Introduction to Amazon Kinesis
AWS Webcast - Introduction to Amazon KinesisAmazon Web Services
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsMatt Kuklinski
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon RedshiftAmazon Web Services
 
AWS Webcast - Build high-scale applications with Amazon DynamoDB
AWS Webcast - Build high-scale applications with Amazon DynamoDBAWS Webcast - Build high-scale applications with Amazon DynamoDB
AWS Webcast - Build high-scale applications with Amazon DynamoDBAmazon Web Services
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaAmazon Web Services
 
Exploring Contact Lens and Amazon Connect
Exploring Contact Lens and Amazon ConnectExploring Contact Lens and Amazon Connect
Exploring Contact Lens and Amazon ConnectCloudHesive
 
Serverless without Code (Lambda)
Serverless without Code (Lambda)Serverless without Code (Lambda)
Serverless without Code (Lambda)CloudHesive
 
DevOps in the Cloud with Microsoft Azure
DevOps in the Cloud with Microsoft AzureDevOps in the Cloud with Microsoft Azure
DevOps in the Cloud with Microsoft Azuregjuljo
 
SMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS LambdaSMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS LambdaAmazon Web Services
 
Building Serverless Web Applications - DevDay Austin 2017
Building Serverless Web Applications - DevDay Austin 2017Building Serverless Web Applications - DevDay Austin 2017
Building Serverless Web Applications - DevDay Austin 2017Amazon Web Services
 
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...Codemotion
 
Service quality monitoring system architecture
Service quality monitoring system architectureService quality monitoring system architecture
Service quality monitoring system architectureMatsuo Sawahashi
 
AWS April 2016 Webinar Series - Getting Started with Real-Time Data Analytics...
AWS April 2016 Webinar Series - Getting Started with Real-Time Data Analytics...AWS April 2016 Webinar Series - Getting Started with Real-Time Data Analytics...
AWS April 2016 Webinar Series - Getting Started with Real-Time Data Analytics...Amazon Web Services
 

Similar to AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Results and Reduced Costs with a Serverless Architecture (DAT309) (20)

FSI201 FINRA’s Managed Data Lake – Next Gen Analytics in the Cloud
FSI201 FINRA’s Managed Data Lake – Next Gen Analytics in the CloudFSI201 FINRA’s Managed Data Lake – Next Gen Analytics in the Cloud
FSI201 FINRA’s Managed Data Lake – Next Gen Analytics in the Cloud
 
(ARC310) Solving Amazon's Catalog Contention With Amazon Kinesis
(ARC310) Solving Amazon's Catalog Contention With Amazon Kinesis(ARC310) Solving Amazon's Catalog Contention With Amazon Kinesis
(ARC310) Solving Amazon's Catalog Contention With Amazon Kinesis
 
Real-time Streaming and Querying with Amazon Kinesis and Amazon Elastic MapRe...
Real-time Streaming and Querying with Amazon Kinesis and Amazon Elastic MapRe...Real-time Streaming and Querying with Amazon Kinesis and Amazon Elastic MapRe...
Real-time Streaming and Querying with Amazon Kinesis and Amazon Elastic MapRe...
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
 
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
 
AWS Webcast - Introduction to Amazon Kinesis
AWS Webcast - Introduction to Amazon KinesisAWS Webcast - Introduction to Amazon Kinesis
AWS Webcast - Introduction to Amazon Kinesis
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails Apps
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
AWS Webcast - Build high-scale applications with Amazon DynamoDB
AWS Webcast - Build high-scale applications with Amazon DynamoDBAWS Webcast - Build high-scale applications with Amazon DynamoDB
AWS Webcast - Build high-scale applications with Amazon DynamoDB
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS Lambda
 
Exploring Contact Lens and Amazon Connect
Exploring Contact Lens and Amazon ConnectExploring Contact Lens and Amazon Connect
Exploring Contact Lens and Amazon Connect
 
Serverless without Code (Lambda)
Serverless without Code (Lambda)Serverless without Code (Lambda)
Serverless without Code (Lambda)
 
DevOps in the Cloud with Microsoft Azure
DevOps in the Cloud with Microsoft AzureDevOps in the Cloud with Microsoft Azure
DevOps in the Cloud with Microsoft Azure
 
SMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS LambdaSMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS Lambda
 
Building Serverless Web Applications - DevDay Austin 2017
Building Serverless Web Applications - DevDay Austin 2017Building Serverless Web Applications - DevDay Austin 2017
Building Serverless Web Applications - DevDay Austin 2017
 
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
 
Service quality monitoring system architecture
Service quality monitoring system architectureService quality monitoring system architecture
Service quality monitoring system architecture
 
AWS April 2016 Webinar Series - Getting Started with Real-Time Data Analytics...
AWS April 2016 Webinar Series - Getting Started with Real-Time Data Analytics...AWS April 2016 Webinar Series - Getting Started with Real-Time Data Analytics...
AWS April 2016 Webinar Series - Getting Started with Real-Time Data Analytics...
 

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

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
 

Recently uploaded

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Results and Reduced Costs with a Serverless Architecture (DAT309)

  • 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Vlad Vlasceanu, Ganesh Subramaniam & Brandon Cuff November 29, 2016 DAT309 How Fulfillment by Amazon (FBA) and Scopely Improved Results and Reduced Costs with a Serverless Architecture
  • 2. What to Expect from the Session • Overview of serverless architectures • Serverless patterns in high performance data use cases • Fulfillment by Amazon: Serverless stream processing • Scopely: Serverless logging & hot key detection
  • 3. What is a Serverless Architecture? Build applications and services
  • 4. What is a Serverless Architecture? Build applications and services … without managing infrastructure
  • 5. What is a Serverless Architecture? Build applications and services … without managing infrastructure • Function as a unit of scale • Decrease complexity, abstracted language runtime • Run code when it’s needed • Enable increased agility
  • 6. Components of Serverless Architectures AWS Lambda Trigger-based Lambda functions
  • 7. Components of Serverless Architectures AWS Lambda Trigger-based Lambda functions Streaming Data Amazon Kinesis Amazon DynamoDB Streams APIs Amazon API Gateway Event Sources Amazon CloudWatch Amazon S3 AWS Config Amazon SNS Data Persistence Amazon DynamoDB AWS Elasticsearch Service Amazon S3 Integration Points Amazon VPC resources AWS service APIs 3rd party services
  • 8. Data Enablement • Data is always part of the architecture
  • 9. Data Enablement • Data is always part of the architecture • Data as a trigger for serverless processing • Data as the object of serverless processing • Data as the result of serverless processing
  • 10. Data Processing Abstraction • Lambda functions as event handlers: one function per event type • Lambda functions as serverless back ends: one function per API / path • Lambda functions for stream/data processing one function per record or data type Helps maintainability - hard to end up with monolithic/spaghetti code
  • 11. Active Role • Processing data at scale • Event-based invocation • ETL orchestration • On-demand processing Advantages: • Reduce operational complexities • Operational cost optimization Serverless High Performance Data Patterns Support Role • Optimization of pre-existing workloads and database utilization • Management, monitoring • Improved anomaly detection and reaction Advantages: • Improved resilience • Operational cost optimization
  • 12. Serverless High Performance Data Patterns FBA Seller Inventory Authority Platform Serverless Logging & Hot Key Detection
  • 13. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. FBA Seller Inventory Authority Platform An Inventory Data Platform Using Serverless Architecture Ganesh Subramaniam, Sr. Software Engineer, Amazon
  • 14.
  • 15. How Does FBA Work? 1 Send Inventory 2 Receive & Store 4 Pick, Pack & Ship 5 Customer Service 6 Customer Returns Customer Orders Product 3
  • 16.
  • 17. Data Platform Goals • Single source of truth for seller’s inventory • Reconciled view of inventory • Surface and track discrepancies
  • 18. Design Requirements • Should handle high volume of input messages (> 10000 tps) • Should handle hot keys in input messages • E.g., Received inventory message for a very large shipment • Should handle duplicate and out of order input messages • Must maintain an audit trail for every inventory quantity change
  • 19. Seller Inventory Authority Platform Inventory Transaction Service Kinesis AWS Lambda Pre-receive processor Adjustment processor Transaction processor Shipments Adjustment Inventory transactions InventoryQueryService Warehouse Management Systems Warehouse Management Systems DDB Streams A/C balance Processor DDB Streams Archivers Kinesis Firehose S3 Account Balances Redshift Analytics Inbound Records Publisher Amazon Elasticsearch Archivers Kinesis Firehose SNS Topics Clients ClientsInventory Events/ Notifications
  • 20. Launch Results • 22 dev weeks savings in operational costs across 11 fleets • Design to launch < 4 months • Improved the accuracy of inbound quantities between 5% to 10% • Reduced cost of business operations (for example, seller contacts) • Developers in the team enjoyed using AWS managed services
  • 21. Best Practices that helped • Container reuse • Instrument, measure and monitor • Abstract Launch scaffolding from entity processing • Canary and Dashboards
  • 22. Best Practices that helped • Container reuse • Instrument, measure and monitor • Abstract Launch scaffolding from entity processing • Canary and Dashboards
  • 23. Metrics and Instrumentation if (adjustmentManager.doesAdjustmentAlreadyExist(metrics, adjustment)) { // this adjustment already exists in our store. Nothing further needs to be done. metrics.addCount(METRIC_IDEMPOTENT_CHECK_FAILED, 1, Unit.ONE); log.debug("Adjustment already exists in DB. " + adjustment); return null; } metrics.addCount(adjustment.getType().name(), 1, Unit.ONE); metrics.addCount(String.join("#", adjustment.getSource().name(), adjustment.getType().name()), 1, Unit.ONE); To mitigate the lack of debug/tracing capabilities with Lambda, we placed significant emphasis in instrumenting our code to help understand how the code was performing during runtime.
  • 24. Best Practices that helped • Container reuse • Instrument, measure and monitor • Abstract Launch scaffolding from entity processing • Canary and Dashboards
  • 25. LambdaLaunchHelper  Invokes the appropriate event handler with the metrics instance and the input  Event Handler is responsible for the deserialization of the items in the request payload and invokes the Entity processor with the metrics instance and the deserialized entity.  Common error/fault handling – writing to S3 and skipping the individual entity at fault or fail the entire batch.  Common metrics • Batch Size • Total Time to process the batch • Time to process an individual entity • Entity Count in the batch • Fault Count
  • 26. Best Practices that helped • Container reuse • Instrument, measure and monitor • Abstract Launch scaffolding from entity processing • Canary and Dashboards
  • 27. Canary and Availability of Pipeline • Regular submission of synthetic transactions and events to the pipeline to monitor the health of the pipeline. • Use different keys to ensure that we monitor the various shards at random • Also helps us monitor to ensure we are within SLA for end to end processing time • Use Kinesis shard-level metrics to identify any potential backlog or issues in the stream processing pipeline.
  • 28. Dashboard and Monitoring Average Transaction Processing Time Oldest Transaction Age Canary Processing Time
  • 29. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Brandon Cuff, Sr. Software Engineer, Scopely Serverless Logging & Hot Key Detection
  • 30. Scopely’s Mobile Games 6+ million daily active users 1 million requests per minute 100+ API servers (c3.2xlarge)
  • 31. Scopely’s Game Server Architecture
  • 33. Our Hot Key Problem What are hot keys? • Heavily requested keys/objects localized on a single partition/shard/node • Subject to capacity of that single partition/shard/node Amazon DynamoDB table symptoms: • Total consumed capacity is less than provisioned capacity • And experiencing throttle events
  • 34. Our Hot Key Detection Process Application uses Count Min Sketch to track top 10 keys then logs them periodically (once per minute) Count Min Sketch • Probabilistic algorithm • Fixed size of memory to track unlimited operations • Small chance of a error memcached-get-count topkey[1]: key=3.user.41401542 count=354 totalCount=68912 frequency=.00514
  • 36. Hot Key Event Lambda will take our log message and convert it into an Elasticsearch document memcached-get-count topkey[1]: key=3.user.41401542 count=354 totalCount=68912 frequency=.00514 { ... "topkey_category": "memcached-get-count", "topkey_key": "3.user.41401542", "topkey_count": 354, "topkey_totalCount": 68912, "topkey_frequency": .00514 }
  • 38. Results & Lessons Learned
  • 39. We Had More Bugs Than We Thought We Did! Special case user ids Key: “user.-1” Configuration objects with a single key retrieved on every request Key: “dice-game-settings” Didn’t notice because it wasn’t causing problems (yet...). ElastiCache Memcached Nodes One node is sending out much more data than the rest
  • 40. Large Keys Are Also a Problem We can look for unusually large keys if we increment by the size of objects rather than 1 You can get the total bandwidth consumed by a specific key by summing the events over a time period. memcached-get-count topkey[1]: key=3.Dice.inv.21645428 size=20354 totalCount=1008912 frequency=.0203
  • 41. We Caught Some Bots and Spammers Initially shut bad users down by deleting accounts. Later implemented per-user request rate limiting via Memcached counters
  • 42. Discovered Poor Client Behavior • Hot keys were discovered on several users • Filtering by client platform revealed that they were all from Android • Android client made a request for every game in the game list which was huge for some small number of users (making their user ids hot keys)
  • 46. Related Sessions ARC402 - Serverless Architectural Patterns and Best Practices - Drew Dennis & Maitreya Ranganath, AWS Solutions Architects; Ajoy Kumar, Architect, BMC Software DAT304 - Deep Dive on Amazon DynamoDB - Rick Houlihan, AWS Principal TPM, DBS NoSQL DAT306 – ElastiCache Deep Dive: Best Practices and Usage Patterns - Michael Labib, AWS In-Memory NoSQL Solutions Architect; Brian Kaiser, CTO, Hudl