SlideShare une entreprise Scribd logo
1  sur  54
Télécharger pour lire hors ligne
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Mark McBride, Senior Software Engineer, Capital Games, Electronic Arts
Bill Weiner, SVP Operations, 47Lining
11/28/16
How EA Leveraged Amazon Redshift and AWS
Partner 47Lining to Gather Meaningful Player
Insights - GAM301
Speakers
Mark McBride
Senior Software
Engineer
Capital Games,
Electronic Arts
Bill Weiner
SVP Operations,
47Lining
& Redshift Whisperer
What to Expect from the Session
• Analytics Architecture
• Challenges
• Effective patterns for ingest, de-dup, aggregate, vacuum
into Redshift
• How to balance rapid ingest and query speeds
• Strategies for data partitioning / orchestration
• Best practices for schema optimization, performant data
summaries incremental updates
• And how we built a Redshift solution to ingest 1 billion
rows of data per day
Life Before Redshift
• External solutions
• “One size fits all” for processing all games
• Serves the needs of central teams, but no focus on the
game team, no dedicated resource to us
• Lack of depth in data
• Client driven
Vision
• Discover how players play our game
• Drive better feature development
• Healthier operations through data
• Rapid iteration and evolution of telemetry gathering
• Decoupled from game server
• Frictionless access to data
• Easily query-able data
• Wall displays
Architecture
Architecture – Persisting to S3
Game Servers Amazon
Kinesis
S3
Worker
S3
Bucket
Put Events
Game Clients
Architecture – Game Client
• iOS/Android clients
• Produces client specific events like screen transitions
• Events are batched up and sent to the game server
every minute
• In between flushes to server, events are persisted to disk
• If the client crashes events will be sent on the next
session
Architecture - Game Server
• EC2 Instances - Tomcat/Java
• Produces the majority of events
• Events are sent asynchronously to Kinesis
• ActiveMQ broker is responsible for the durability of the
message
• Persisted to disk until sent
• Retries with exponential backoff
• Dead Letter Queue
Architecture - Kinesis
• One Kinesis stream with 10 shards partitioned by event UUID
• 24 hour retention
• Provides fault tolerance to game server. Redshift can be
offline and the Game Server isn't impacted.
• Game Server batches many events into one Kinesis record
on every client request
• Records are compressed
Architecture – S3 Kinesis Worker
• Elastic Beanstalk
• Decompress records
• Transform hierarchical JSON structure into flat structure
• Patch missing data. PlayerId
• Clean/truncate data. 0/1 -> true/false
• Filter out unrepairable data. Bad timestamps
• Report operational metrics
• Write to S3 when thresholds are met
Architecture – S3
• S3 files organized by
hour: Yyyy/MM/dd/HH/SequenceStart-SequenceEnd.gz
• Compressed JSON
• Long-term “truth” storage
• Cheap
Architecture - S3 to Redshift
S3
Ingest Data
Pipeline
Amazon
Redshift
Amazon Elastic
Beanstalk
DeDupe & Analyze
Vacuum
SQL ETL
Data
Pipeline
Architecture – Ingest Data Pipeline
• Every hour data pipeline job bulk inserts all S3 files into
EventsDups table.
• Copy EventsDups from s3://sw-prod-kinesis-
events/#{format(minusHours(@scheduledStartTime,1),'Y
YYY/MM/dd/HH/')}
• Monitor for failures!
• Consider manifest driven ingest next time!
Table Progression
AggregateIngest Deduped
S3
Worker
Asynchronous
Copy of New
Data
Deduplication of
Incoming Data
Deduplication
with
Events Table
and Insertion
Aggregation of
Data
Events Table
Architecture – Deduper
• Why deduplication?
• Redshift doesn't provide constraints.
• Distributed systems are complicated. Allow for retries when in
doubt.
• Data pipeline jobs can fail. Allow one to rerun ingest.
Architecture – Deduper Implementation
• Critical that a proper definition of duplicates is created
• Not based on all columns being the same
• Using the unique set of event identifying columns events
can be deduplicated both in the ingest table and against
the events table
Architecture – Deduper Implementation
• Beanstalk webapp that polls EventsDups table for work
• Deduplication is performed using the following columns to establish
uniqueness:
Description
Raw Event
Timestamp
Timestamp for event
User Id Player Identifier
Session Id Unique to each session
Step Each event gets a unique number generated from a memcached
increment operation.
Event Type Integer unique to each event.
Schema : Events
Sort Key Description
Ingest Time Unix time UTC when event is captured on Kinesis
Stat Date Raw Event Timestamp in yyyy-mm-dd format
Player Id Random generated UUID – Distribution Key
Raw Event
Timestamp
Unix time UTC when event is triggered on server
Event Type Integer unique to each event. 2924 = BattleSummaryEvent
Standard Fields Country, Device, Network, Platform...
Event Value 1-10 For each event type a set of 10 fields can be set.
Architecture – Vacuum
• Why Vacuum?
• Reclaim and reuse space that is freed when you delete and
update rows … we only insert …
• Ensure new data is properly sorted with existing table
• This is important in providing quality statistics to the query
optimizer.
• We Vacuum once a day which balances the time to Vacuum
and ability to provide performant statistics.
Architecture – Analyze
• Why Analyze?
• Any time one adds (modifies, or deletes) a significant number
of rows, you should run the analyze command to maintain the
query optimizers statistics.
• This occurs when the table is vacuumed.
• We analyze on every 4th successful deduper process.
• Analyze is resource intensive. Balance time to analyze
to optimizers ability to generate good plans.
Architecture – ETL – User Retention Daily
• Data Pipeline scheduled once an hour – along with many other aggregate tables
• Upsert into table looking back a week into events table
• Executed after users aggregate table is updated
Sort Key Description
PlayerId Random generated UUID – Distribution Key
Platform Apple/Google
Country US, GB...
Stat Date Row for every day player has played
Days In Game Number of days in game
Revenue Summary revenue data
Architecture – Scaling Growth
1 Billion Events!!!!
The Force
Awakens!!!
World Wide Launch!!!
Technical
Challenges & Solutions
Amazon Redshift system architecture
Leader node
• SQL endpoint
• Stores metadata
• Coordinates query execution
Compute nodes
• Local, columnar storage
• Executes queries in parallel
• Load, backup, restore via
Amazon S3; load from
Amazon DynamoDB, Amazon EMR, or SSH
Two hardware platforms
• Optimized for data processing
• DS2: HDD; scale from 2 TB to 2 PB
• DC1: SSD; scale from 160 GB to 326 TB
10 GigE
(HPC)
Ingestion
Backup
Restore
JDBC/ODBC
Architecture – Scaling Challenges
650 minutes
to Vacuum
1,550 Minutes
To Deduplicate
Goals of Sorting
• Physically sort data within blocks and throughout a table
• Enable rrscans (block-rejection) to prune blocks by
leveraging zone maps
• Optimal SORTKEY is dependent on:
• Query patterns
• Data profile
• Business requirements
COMPOUND
• Most common
• Well-defined filter criteria
• Time-series data
Choosing a SORTKEY
INTERLEAVED
• Edge cases
• Large tables (>billion rows)
• No common filter criteria
• Non time-series data
• Organizing of time-series data
• Optimally newest data at the "end" of a time-series table,
• Primarily as a query predicate (date, identifier, …)
• Optionally, choose a column frequently used for aggregates
Best Practices for Time-Series Data
http://docs.aws.amazon.com/redshift/latest/d
g/vacuum-load-in-sort-key-order.html
It is important to have
sort keys that ensures
that new data is
“located”, per sort key
order, at the end of the
time-series table
Time
Events Out of Time
Incoming event destination post-vacuum
Events Table
Ingest Table
Altered Timestamp
By creating synthetic timestamp sort key the incoming
rows all vacuum to the end of the main events table
Ingest Table
Time
Events Table
Best Practice for Sort Key Selection
http://docs.aws.amazon.com/redshift/latest/dg/t_Sorting_data.html
Compound Sort Key:
A compound key is made up of all of the columns listed
in the sort key definition, in the order they are listed. A
compound sort key is most useful when a query's filter
applies conditions, such as filters and joins, that use a
prefix of the sort keys. The performance benefits of
compound sorting (may) decrease when queries depend
only on secondary sort columns, without referencing the
primary columns.
Optimizing the Effectiveness of Zone Maps
Time Only Query Performance
>9 <4
Block1Block2Block3Block4
Truncated Synthetic Timestamp
>9 <4
Block1Block2Block3Block4
Balancing Vacuum and Query Speed
Four ingest batches come in with the
same truncated synthetic timestamp
After vacuum the secondary and tertiary
reorder the order of rows improving
sorting power for these later sort key
Vacuum time grows the number of
overlapping batches increases
Improved grouping of the secondary
and tertiary sort key values improves
query speed where these are used
Pre-Vacuum Post-Vacuum
Architecture – Scaling Challenges
Goals of Distribution
• Distribute data evenly for parallel processing
• Minimize data movement
• Co-located joins
• Localized aggregations
Distribution key All
Node 1
Slice
1
Slice
2
Node 2
Slice
3
Slice
4
Node 1
Slice
1
Slice
2
Node 2
Slice
3
Slice
4
Full table data on first
slice of every node
Same key to same location
Node 1
Slice
1
Slice
2
Node 2
Slice
3
Slice
4
Even
Round-robin
distribution
Choosing a Distribution Style
Key
• Large FACT tables
• Rapidly changing tables used
in joins
• Localize columns used within
aggregations
All
• Have slowly changing data
• Reasonable size (i.e., few
millions but not 100s of
millions of rows)
• No common distribution key
for frequent joins
• Typical use case: joined
dimension table without a
common distribution key
Even
• Tables not frequently joined or
aggregated
• Large tables without
acceptable candidate keys
Best Practice for Distribution
http://docs.aws.amazon.com/redshift/latest/dg/t_Distributing_data.html
Data redistribution can account for a substantial portion of the cost of a
query plan, and the network traffic it generates can affect other database
operations and slow overall system performance
1. To distribute the workload uniformly among the nodes in the cluster.
Uneven distribution, or data distribution skew, forces some nodes to
do more work than others, which impairs query performance
2. To minimize data movement during query execution. If the rows that
participate in joins or aggregates are already collocated on the
nodes with their joining rows in other tables, the optimizer does not
need to redistribute as much data during query execution
Unauthenticated (Anonymous) Events
Events Table
Slice 0 Slice 1 Slice 2 … Slice N
A small percentage of unauthenticated
events located on a single slice of a
large cluster leads to significant skew
Node Level Skew Slice Level Skew
Split Events Tables
Events Table - Authenticated
Slice 0 Slice 1 Slice 2 … Slice N
By splitting events into two tables querying speed was improved due to
unauthenticated events no longer unbalancing skew
UNION ALL view can be used to query all event data when needed
Events Table - Unauthenticated
Slice 0 Slice 1 Slice 2 … Slice N
Long Deduplication Time
Incoming events needs to be scrubbed
to prevent duplicate events
Duplicates removed from incoming data
Scanning the full events table for
deduplication slows as the events table
grows
Ingest Table
Time
Events Table
Events Table
Time Restricted Deduplication
Incoming events evaluated for ranges
on specific columns
Scan of main events table
limited to range of incoming
events
Ingest Table
Time
Growing Aggregation Time
Per player statistics
Events Table
Aggregate
Incremental Aggregation
Events Table
Aggregate
Temp
Benefits
Benefits Detail
- Churn Prediction
- Cheater Detection
- Adaptive AI
- Changing the definition of success
Next steps
Next Steps
• Data retention
• Machine Learning
• Firehose
• Kinesis Analytics
Thank you!
Remember to complete
your evaluations!

Contenu connexe

Tendances

Getting to 1.5M Ads/sec: How DataXu manages Big Data
Getting to 1.5M Ads/sec: How DataXu manages Big DataGetting to 1.5M Ads/sec: How DataXu manages Big Data
Getting to 1.5M Ads/sec: How DataXu manages Big Data
Qubole
 

Tendances (20)

AWS Webcast - Managing Big Data in the AWS Cloud_20140924
AWS Webcast - Managing Big Data in the AWS Cloud_20140924AWS Webcast - Managing Big Data in the AWS Cloud_20140924
AWS Webcast - Managing Big Data in the AWS Cloud_20140924
 
Introducing Amazon Kinesis: Real-time Processing of Streaming Big Data (BDT10...
Introducing Amazon Kinesis: Real-time Processing of Streaming Big Data (BDT10...Introducing Amazon Kinesis: Real-time Processing of Streaming Big Data (BDT10...
Introducing Amazon Kinesis: Real-time Processing of Streaming Big Data (BDT10...
 
Building A Modern Data Analytics Architecture on AWS
Building A Modern Data Analytics Architecture on AWSBuilding A Modern Data Analytics Architecture on AWS
Building A Modern Data Analytics Architecture on AWS
 
AWS re:Invent 2016: Taking Data to the Extreme (MBL202)
AWS re:Invent 2016: Taking Data to the Extreme (MBL202)AWS re:Invent 2016: Taking Data to the Extreme (MBL202)
AWS re:Invent 2016: Taking Data to the Extreme (MBL202)
 
Introduction to Amazon Kinesis Analytics
Introduction to Amazon Kinesis AnalyticsIntroduction to Amazon Kinesis Analytics
Introduction to Amazon Kinesis Analytics
 
Getting Started with Real-time Analytics
Getting Started with Real-time AnalyticsGetting Started with Real-time Analytics
Getting Started with Real-time Analytics
 
Using real time big data analytics for competitive advantage
 Using real time big data analytics for competitive advantage Using real time big data analytics for competitive advantage
Using real time big data analytics for competitive advantage
 
Getting Started with Real-Time Analytics
Getting Started with Real-Time AnalyticsGetting Started with Real-Time Analytics
Getting Started with Real-Time Analytics
 
AWS re:Invent 2016: How Toyota Racing Development Makes Racing Decisions in R...
AWS re:Invent 2016: How Toyota Racing Development Makes Racing Decisions in R...AWS re:Invent 2016: How Toyota Racing Development Makes Racing Decisions in R...
AWS re:Invent 2016: How Toyota Racing Development Makes Racing Decisions in R...
 
(BDT306) How Hearst Publishing Manages Clickstream Analytics with AWS
(BDT306) How Hearst Publishing Manages Clickstream Analytics with AWS(BDT306) How Hearst Publishing Manages Clickstream Analytics with AWS
(BDT306) How Hearst Publishing Manages Clickstream Analytics with AWS
 
Taking the Performance of your Data Warehouse to the Next Level with Amazon R...
Taking the Performance of your Data Warehouse to the Next Level with Amazon R...Taking the Performance of your Data Warehouse to the Next Level with Amazon R...
Taking the Performance of your Data Warehouse to the Next Level with Amazon R...
 
AWS re:Invent 2016| HLC301 | Data Science and Healthcare: Running Large Scale...
AWS re:Invent 2016| HLC301 | Data Science and Healthcare: Running Large Scale...AWS re:Invent 2016| HLC301 | Data Science and Healthcare: Running Large Scale...
AWS re:Invent 2016| HLC301 | Data Science and Healthcare: Running Large Scale...
 
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...
 
Big data on aws
Big data on awsBig data on aws
Big data on aws
 
AWS APAC Webinar Week - Big Data on AWS. RedShift, EMR, & IOT
AWS APAC Webinar Week - Big Data on AWS. RedShift, EMR, & IOTAWS APAC Webinar Week - Big Data on AWS. RedShift, EMR, & IOT
AWS APAC Webinar Week - Big Data on AWS. RedShift, EMR, & IOT
 
Getting to 1.5M Ads/sec: How DataXu manages Big Data
Getting to 1.5M Ads/sec: How DataXu manages Big DataGetting to 1.5M Ads/sec: How DataXu manages Big Data
Getting to 1.5M Ads/sec: How DataXu manages Big Data
 
Day 4 - Big Data on AWS - RedShift, EMR & the Internet of Things
Day 4 - Big Data on AWS - RedShift, EMR & the Internet of ThingsDay 4 - Big Data on AWS - RedShift, EMR & the Internet of Things
Day 4 - Big Data on AWS - RedShift, EMR & the Internet of Things
 
AWS re:Invent 2016: Streaming ETL for RDS and DynamoDB (DAT315)
AWS re:Invent 2016: Streaming ETL for RDS and DynamoDB (DAT315)AWS re:Invent 2016: Streaming ETL for RDS and DynamoDB (DAT315)
AWS re:Invent 2016: Streaming ETL for RDS and DynamoDB (DAT315)
 
AWS re:Invent 2016: How Telltale Games migrated its story analytics from Apac...
AWS re:Invent 2016: How Telltale Games migrated its story analytics from Apac...AWS re:Invent 2016: How Telltale Games migrated its story analytics from Apac...
AWS re:Invent 2016: How Telltale Games migrated its story analytics from Apac...
 
SRV420 Analyzing Streaming Data in Real-time with Amazon Kinesis
SRV420 Analyzing Streaming Data in Real-time with Amazon KinesisSRV420 Analyzing Streaming Data in Real-time with Amazon Kinesis
SRV420 Analyzing Streaming Data in Real-time with Amazon Kinesis
 

En vedette

En vedette (7)

AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
 
AWS re:Invent 2016: Best Practices for Data Warehousing with Amazon Redshift ...
AWS re:Invent 2016: Best Practices for Data Warehousing with Amazon Redshift ...AWS re:Invent 2016: Best Practices for Data Warehousing with Amazon Redshift ...
AWS re:Invent 2016: Best Practices for Data Warehousing with Amazon Redshift ...
 
Disaster Recovery of on-premises IT infrastructure with AWS
Disaster Recovery of on-premises IT infrastructure with AWSDisaster Recovery of on-premises IT infrastructure with AWS
Disaster Recovery of on-premises IT infrastructure with AWS
 
2016 Cloud vs. On Premise Brand Leader Survey Report
2016 Cloud vs. On Premise Brand Leader Survey Report2016 Cloud vs. On Premise Brand Leader Survey Report
2016 Cloud vs. On Premise Brand Leader Survey Report
 
AWS Enterprise Summit 2016 - 환영사 (국내 엔터프라이즈 클라우드 도입 현황)- 염동훈 대표
AWS Enterprise Summit 2016 - 환영사 (국내 엔터프라이즈 클라우드 도입 현황)-  염동훈 대표AWS Enterprise Summit 2016 - 환영사 (국내 엔터프라이즈 클라우드 도입 현황)-  염동훈 대표
AWS Enterprise Summit 2016 - 환영사 (국내 엔터프라이즈 클라우드 도입 현황)- 염동훈 대표
 
AWS re:Invent 2016: What’s New with Amazon Redshift (BDA304)
AWS re:Invent 2016: What’s New with Amazon Redshift (BDA304)AWS re:Invent 2016: What’s New with Amazon Redshift (BDA304)
AWS re:Invent 2016: What’s New with Amazon Redshift (BDA304)
 
Disaster Recovery of On-Premises IT Infrastructure with AWS
Disaster Recovery of On-Premises IT Infrastructure with AWSDisaster Recovery of On-Premises IT Infrastructure with AWS
Disaster Recovery of On-Premises IT Infrastructure with AWS
 

Similaire à AWS re:Invent 2016| GAM301 | How EA Leveraged Amazon Redshift and AWS Partner 47Lining to Gather Meaningful Player Insights

Similaire à AWS re:Invent 2016| GAM301 | How EA Leveraged Amazon Redshift and AWS Partner 47Lining to Gather Meaningful Player Insights (20)

WW Historian 10
WW Historian 10WW Historian 10
WW Historian 10
 
Building Your Data Warehouse with Amazon Redshift
Building Your Data Warehouse with Amazon RedshiftBuilding Your Data Warehouse with Amazon Redshift
Building Your Data Warehouse with Amazon Redshift
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
Optimize Your Reporting In Less Than 10 Minutes
Optimize Your Reporting In Less Than 10 MinutesOptimize Your Reporting In Less Than 10 Minutes
Optimize Your Reporting In Less Than 10 Minutes
 
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
 
Aerospike Hybrid Memory Architecture
Aerospike Hybrid Memory ArchitectureAerospike Hybrid Memory Architecture
Aerospike Hybrid Memory Architecture
 
Redshift overview
Redshift overviewRedshift overview
Redshift overview
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout Session
 
Sizing MongoDB Clusters
Sizing MongoDB Clusters Sizing MongoDB Clusters
Sizing MongoDB Clusters
 
GECon2017_High-volume data streaming in azure_ Aliaksandr Laisha
GECon2017_High-volume data streaming in azure_ Aliaksandr LaishaGECon2017_High-volume data streaming in azure_ Aliaksandr Laisha
GECon2017_High-volume data streaming in azure_ Aliaksandr Laisha
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
Solving Office 365 Big Challenges using Cassandra + Spark
Solving Office 365 Big Challenges using Cassandra + Spark Solving Office 365 Big Challenges using Cassandra + Spark
Solving Office 365 Big Challenges using Cassandra + Spark
 
Data & Analytics Forum: Moving Telcos to Real Time
Data & Analytics Forum: Moving Telcos to Real TimeData & Analytics Forum: Moving Telcos to Real Time
Data & Analytics Forum: Moving Telcos to Real Time
 
Gam301 Real-Time Game Analytics with Amazon Redshift, Amazon Kinesis, and Ama...
Gam301 Real-Time Game Analytics with Amazon Redshift, Amazon Kinesis, and Ama...Gam301 Real-Time Game Analytics with Amazon Redshift, Amazon Kinesis, and Ama...
Gam301 Real-Time Game Analytics with Amazon Redshift, Amazon Kinesis, and Ama...
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
Realtime Analytics on AWS
Realtime Analytics on AWSRealtime Analytics on AWS
Realtime Analytics on AWS
 
Leveraging Amazon Redshift for your Data Warehouse
Leveraging Amazon Redshift for your Data WarehouseLeveraging Amazon Redshift for your Data Warehouse
Leveraging Amazon Redshift for your Data Warehouse
 
AWS Webcast - Redshift Overview and New Features
AWS Webcast - Redshift Overview and New Features AWS Webcast - Redshift Overview and New Features
AWS Webcast - Redshift Overview and New Features
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 
Serverless SQL
Serverless SQLServerless SQL
Serverless SQL
 

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

Plus de Amazon Web Services (20)

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

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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 Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

AWS re:Invent 2016| GAM301 | How EA Leveraged Amazon Redshift and AWS Partner 47Lining to Gather Meaningful Player Insights

  • 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Mark McBride, Senior Software Engineer, Capital Games, Electronic Arts Bill Weiner, SVP Operations, 47Lining 11/28/16 How EA Leveraged Amazon Redshift and AWS Partner 47Lining to Gather Meaningful Player Insights - GAM301
  • 2. Speakers Mark McBride Senior Software Engineer Capital Games, Electronic Arts Bill Weiner SVP Operations, 47Lining & Redshift Whisperer
  • 3. What to Expect from the Session • Analytics Architecture • Challenges • Effective patterns for ingest, de-dup, aggregate, vacuum into Redshift • How to balance rapid ingest and query speeds • Strategies for data partitioning / orchestration • Best practices for schema optimization, performant data summaries incremental updates • And how we built a Redshift solution to ingest 1 billion rows of data per day
  • 4.
  • 5.
  • 6. Life Before Redshift • External solutions • “One size fits all” for processing all games • Serves the needs of central teams, but no focus on the game team, no dedicated resource to us • Lack of depth in data • Client driven
  • 7. Vision • Discover how players play our game • Drive better feature development • Healthier operations through data • Rapid iteration and evolution of telemetry gathering • Decoupled from game server • Frictionless access to data • Easily query-able data • Wall displays
  • 9. Architecture – Persisting to S3 Game Servers Amazon Kinesis S3 Worker S3 Bucket Put Events Game Clients
  • 10. Architecture – Game Client • iOS/Android clients • Produces client specific events like screen transitions • Events are batched up and sent to the game server every minute • In between flushes to server, events are persisted to disk • If the client crashes events will be sent on the next session
  • 11. Architecture - Game Server • EC2 Instances - Tomcat/Java • Produces the majority of events • Events are sent asynchronously to Kinesis • ActiveMQ broker is responsible for the durability of the message • Persisted to disk until sent • Retries with exponential backoff • Dead Letter Queue
  • 12. Architecture - Kinesis • One Kinesis stream with 10 shards partitioned by event UUID • 24 hour retention • Provides fault tolerance to game server. Redshift can be offline and the Game Server isn't impacted. • Game Server batches many events into one Kinesis record on every client request • Records are compressed
  • 13. Architecture – S3 Kinesis Worker • Elastic Beanstalk • Decompress records • Transform hierarchical JSON structure into flat structure • Patch missing data. PlayerId • Clean/truncate data. 0/1 -> true/false • Filter out unrepairable data. Bad timestamps • Report operational metrics • Write to S3 when thresholds are met
  • 14. Architecture – S3 • S3 files organized by hour: Yyyy/MM/dd/HH/SequenceStart-SequenceEnd.gz • Compressed JSON • Long-term “truth” storage • Cheap
  • 15. Architecture - S3 to Redshift S3 Ingest Data Pipeline Amazon Redshift Amazon Elastic Beanstalk DeDupe & Analyze Vacuum SQL ETL Data Pipeline
  • 16. Architecture – Ingest Data Pipeline • Every hour data pipeline job bulk inserts all S3 files into EventsDups table. • Copy EventsDups from s3://sw-prod-kinesis- events/#{format(minusHours(@scheduledStartTime,1),'Y YYY/MM/dd/HH/')} • Monitor for failures! • Consider manifest driven ingest next time!
  • 17. Table Progression AggregateIngest Deduped S3 Worker Asynchronous Copy of New Data Deduplication of Incoming Data Deduplication with Events Table and Insertion Aggregation of Data Events Table
  • 18. Architecture – Deduper • Why deduplication? • Redshift doesn't provide constraints. • Distributed systems are complicated. Allow for retries when in doubt. • Data pipeline jobs can fail. Allow one to rerun ingest.
  • 19. Architecture – Deduper Implementation • Critical that a proper definition of duplicates is created • Not based on all columns being the same • Using the unique set of event identifying columns events can be deduplicated both in the ingest table and against the events table
  • 20. Architecture – Deduper Implementation • Beanstalk webapp that polls EventsDups table for work • Deduplication is performed using the following columns to establish uniqueness: Description Raw Event Timestamp Timestamp for event User Id Player Identifier Session Id Unique to each session Step Each event gets a unique number generated from a memcached increment operation. Event Type Integer unique to each event.
  • 21. Schema : Events Sort Key Description Ingest Time Unix time UTC when event is captured on Kinesis Stat Date Raw Event Timestamp in yyyy-mm-dd format Player Id Random generated UUID – Distribution Key Raw Event Timestamp Unix time UTC when event is triggered on server Event Type Integer unique to each event. 2924 = BattleSummaryEvent Standard Fields Country, Device, Network, Platform... Event Value 1-10 For each event type a set of 10 fields can be set.
  • 22. Architecture – Vacuum • Why Vacuum? • Reclaim and reuse space that is freed when you delete and update rows … we only insert … • Ensure new data is properly sorted with existing table • This is important in providing quality statistics to the query optimizer. • We Vacuum once a day which balances the time to Vacuum and ability to provide performant statistics.
  • 23. Architecture – Analyze • Why Analyze? • Any time one adds (modifies, or deletes) a significant number of rows, you should run the analyze command to maintain the query optimizers statistics. • This occurs when the table is vacuumed. • We analyze on every 4th successful deduper process. • Analyze is resource intensive. Balance time to analyze to optimizers ability to generate good plans.
  • 24. Architecture – ETL – User Retention Daily • Data Pipeline scheduled once an hour – along with many other aggregate tables • Upsert into table looking back a week into events table • Executed after users aggregate table is updated Sort Key Description PlayerId Random generated UUID – Distribution Key Platform Apple/Google Country US, GB... Stat Date Row for every day player has played Days In Game Number of days in game Revenue Summary revenue data
  • 25. Architecture – Scaling Growth 1 Billion Events!!!! The Force Awakens!!! World Wide Launch!!!
  • 27. Amazon Redshift system architecture Leader node • SQL endpoint • Stores metadata • Coordinates query execution Compute nodes • Local, columnar storage • Executes queries in parallel • Load, backup, restore via Amazon S3; load from Amazon DynamoDB, Amazon EMR, or SSH Two hardware platforms • Optimized for data processing • DS2: HDD; scale from 2 TB to 2 PB • DC1: SSD; scale from 160 GB to 326 TB 10 GigE (HPC) Ingestion Backup Restore JDBC/ODBC
  • 28. Architecture – Scaling Challenges 650 minutes to Vacuum 1,550 Minutes To Deduplicate
  • 29. Goals of Sorting • Physically sort data within blocks and throughout a table • Enable rrscans (block-rejection) to prune blocks by leveraging zone maps • Optimal SORTKEY is dependent on: • Query patterns • Data profile • Business requirements
  • 30. COMPOUND • Most common • Well-defined filter criteria • Time-series data Choosing a SORTKEY INTERLEAVED • Edge cases • Large tables (>billion rows) • No common filter criteria • Non time-series data • Organizing of time-series data • Optimally newest data at the "end" of a time-series table, • Primarily as a query predicate (date, identifier, …) • Optionally, choose a column frequently used for aggregates
  • 31. Best Practices for Time-Series Data http://docs.aws.amazon.com/redshift/latest/d g/vacuum-load-in-sort-key-order.html It is important to have sort keys that ensures that new data is “located”, per sort key order, at the end of the time-series table
  • 32. Time Events Out of Time Incoming event destination post-vacuum Events Table Ingest Table
  • 33. Altered Timestamp By creating synthetic timestamp sort key the incoming rows all vacuum to the end of the main events table Ingest Table Time Events Table
  • 34. Best Practice for Sort Key Selection http://docs.aws.amazon.com/redshift/latest/dg/t_Sorting_data.html Compound Sort Key: A compound key is made up of all of the columns listed in the sort key definition, in the order they are listed. A compound sort key is most useful when a query's filter applies conditions, such as filters and joins, that use a prefix of the sort keys. The performance benefits of compound sorting (may) decrease when queries depend only on secondary sort columns, without referencing the primary columns.
  • 36. Time Only Query Performance >9 <4 Block1Block2Block3Block4
  • 37. Truncated Synthetic Timestamp >9 <4 Block1Block2Block3Block4
  • 38. Balancing Vacuum and Query Speed Four ingest batches come in with the same truncated synthetic timestamp After vacuum the secondary and tertiary reorder the order of rows improving sorting power for these later sort key Vacuum time grows the number of overlapping batches increases Improved grouping of the secondary and tertiary sort key values improves query speed where these are used Pre-Vacuum Post-Vacuum
  • 40. Goals of Distribution • Distribute data evenly for parallel processing • Minimize data movement • Co-located joins • Localized aggregations Distribution key All Node 1 Slice 1 Slice 2 Node 2 Slice 3 Slice 4 Node 1 Slice 1 Slice 2 Node 2 Slice 3 Slice 4 Full table data on first slice of every node Same key to same location Node 1 Slice 1 Slice 2 Node 2 Slice 3 Slice 4 Even Round-robin distribution
  • 41. Choosing a Distribution Style Key • Large FACT tables • Rapidly changing tables used in joins • Localize columns used within aggregations All • Have slowly changing data • Reasonable size (i.e., few millions but not 100s of millions of rows) • No common distribution key for frequent joins • Typical use case: joined dimension table without a common distribution key Even • Tables not frequently joined or aggregated • Large tables without acceptable candidate keys
  • 42. Best Practice for Distribution http://docs.aws.amazon.com/redshift/latest/dg/t_Distributing_data.html Data redistribution can account for a substantial portion of the cost of a query plan, and the network traffic it generates can affect other database operations and slow overall system performance 1. To distribute the workload uniformly among the nodes in the cluster. Uneven distribution, or data distribution skew, forces some nodes to do more work than others, which impairs query performance 2. To minimize data movement during query execution. If the rows that participate in joins or aggregates are already collocated on the nodes with their joining rows in other tables, the optimizer does not need to redistribute as much data during query execution
  • 43. Unauthenticated (Anonymous) Events Events Table Slice 0 Slice 1 Slice 2 … Slice N A small percentage of unauthenticated events located on a single slice of a large cluster leads to significant skew Node Level Skew Slice Level Skew
  • 44. Split Events Tables Events Table - Authenticated Slice 0 Slice 1 Slice 2 … Slice N By splitting events into two tables querying speed was improved due to unauthenticated events no longer unbalancing skew UNION ALL view can be used to query all event data when needed Events Table - Unauthenticated Slice 0 Slice 1 Slice 2 … Slice N
  • 45. Long Deduplication Time Incoming events needs to be scrubbed to prevent duplicate events Duplicates removed from incoming data Scanning the full events table for deduplication slows as the events table grows Ingest Table Time Events Table
  • 46. Events Table Time Restricted Deduplication Incoming events evaluated for ranges on specific columns Scan of main events table limited to range of incoming events Ingest Table Time
  • 47. Growing Aggregation Time Per player statistics Events Table Aggregate
  • 50. Benefits Detail - Churn Prediction - Cheater Detection - Adaptive AI - Changing the definition of success
  • 52. Next Steps • Data retention • Machine Learning • Firehose • Kinesis Analytics