SlideShare a Scribd company logo
1 of 23
POWERING THE NEXT GENERATION OF REAL TIME BIDDING
Confidential please do not distribute info@beeswax.com
Outline of the talk
- What is Beeswax and Real-time bidding(RTB) ?
- Our System Architecture
- Why we choose Amazon Kinesis ?
- Problem 1: Collecting very high volume streams
- Problem 2: Stream data transformation and fan out
- Problem 3: Joining streams and aggregation
Who are we ?
AdTech Startup based out of NYC,
founded by ex-Googlers
We do RTB (Real time bidding)
Publisher
Ad Exchange
Beeswax Bidder
Scale: O(M) QPS
Latency_99 : 20 ms
- Target campaigns
- Target user profiles
- Optimize for ROI
- Customize
< 200 ms
Step 1:
Send ad request & userid
Step 2:
Broadcast bid request
Step 3:
Submit bid & ad markup
Step 4:
Show ad to user
Auction
Building a bidder is very hard
Need scale to deliver campaigns
- To reach the desired audience, bidder needs to process at least 1M QPS
- Deployment has to be in multiple regions to guarantee reach
Performance
- The timeout from ad exchanges is 100ms including the RTT over internet
- 99%ile tail latency for processing a bid request is 20 ms
Complex ecosystem
- Manage integrations with ad exchanges, third party data providers and vendors
- Requires a lot of domain expertise to optimize the bidder for maximizing performance
A difficult trade-off
6
Use a DSP Build your own Bidder
Risky investment of time and $
with no success guarantee
Limited to no customization;
Platform lock in
Our First Product: The Bidder-as-a-Service™
A full-stack solution
deployed for each
customer in a sandbox
Services
you control
Pre-built
ecosystem
and supply
relationships
Cookies,
Mobile ID’s, 3rd
Party
Data
Bidding
and Targeting
Engine
Campaign
Management UI/API
Reporting
UI/API
Custom
bidding
algos
Log-level
streaming
RESTful APIs
Direct
connections to
customer-hosted
services
Fully managed ad tech platform on
Our System Architecture
Event Stream
(Amazon
Kinesis Streams)
Impression & Click
Data Producer
Bid Data Producer
Streaming
Message Hub
Customer
HTTPS
endpoint
Customer Stream
(Amazon Kinesis
Streams)
Amazon
S3 Bucket
Amazon
Redshift
Cluster
Customer API
What is Amazon Kinesis Streams?
Fully managed service from Amazon to collect and process large streams of
data records in real time
Key Concepts for Amazon Kinesis Streams
- Each Stream is made of shards
- Each shard is a unit of parallelism and throughput (write at 1 MB/s and
read at 2 MB/s)
- Data producers call PutRecord(s) to send data along a partition key to an
Amazon Kinesis stream
Why we choose Amazon Kinesis ?
Infrastructure requirements motivated by RTB use cases
- Ingestion at very large scale (> 1M QPS)
- Low latency delivery
- Reliable store of data
- Sequenced retrieval of events
Options available for consideration
1. Apache Kafka on EC2
2. Amazon Kinesis Streams
Reason to choose Kinesis
- Fully managed by AWS; Really important factor for small engineering teams
- Support the scale necessary for RTB
- Pricing model provided opportunities to optimize cost
Filtered bids
(Amazon Kinesis Streams)
Problem 1: Collecting very high volume streams
Filtering
and
Sampling
Bids: O(M) QPS
Challenges
- Collection at very high scale (QPS > 1M)
- Minimize infrastructure cost
- Minimize delivery latency for stream output
Listening Bidders
- Filter very high QPS bid stream using boolean targeting expressions
- Sample filtered stream and deliver
Solution 1: Optimized Data Producers
Cost vs Reliability Tradeoff
- Uploads are priced by PUT payload size of 25K
- Buffer incoming records and pack them into single PUT payload
- Possible data loss if application crashes before buffer is flushed
- Be creative ! We use AWS Elastic Load Balancer (ELB) access logs to replay requests
Throughput vs Latency
- Buffering increases throughput as more data is uploaded per API call
- Increases average latency; Not a concern for very high QPS collectors
- Flush buffers periodically even if not full, to cap latency
Consider overall system cost
- Compression can reduce data payload size but increase data producer CPU usage
- Evaluate compression vs cost tradeoff. For e.g. We choose snappy over gzip
Choose uniformly distributed partition keys
Problem 2: Data transformation and fan out
Challenges
- Config driven system to determine format, schema and destination of each record
- Maximize resource utilization by scaling elastically to incoming stream volume
- Monitoring and operating the service
Transform
and
Fan Out
Event Stream
API driven, transparent and flexible platform
- Provide very detailed log level data to all our customers
- Support multiple delivery destinations and data formats
Amazon Kinesis
stream
Amazon Kinesis
stream
Amazon S3
What is Kinesis Client Library?
- Open source library from AWS
https://github.com/awslabs/amazon-kinesis-client
- Enables to easily consume and process data from Amazon Kinesis
Streams
- Helps with elastic scale-out and fault-tolerant processing
- Abstracts away complex tasks associated with distributed computing like
- load balancing of shards
- shard mapping between EC2 hosts
- checkpointing
- shard-level monitoring using CloudWatch
Solution 2: API driven Streaming Message Hub
- Kinesis Client Library (KCL) application deployed to EC2/Autoscale group
- Adapters perform schema and data format transformations
- Emitters buffer data in-memory and flush periodically to destination
- Stream is checkpointed after records are flushed by emitters
- Cloudwatch alarms on CPU utilization elastically resize fleet
Kinesis Record
BidAdapters
WinAdapters
S3Emitter
...
HTTPEmitterClickAdapters
KinesisEmitter
...
Streaming Message Hub design tradeoffs
Single Reader vs Multiple Readers
- Separate reader for every format & destination instead of a single reader
- Having separate readers improves fault tolerance
- However, CPU cost of parsing records is minimized with single reader
Amazon EC2 vs AWS Lambda
- Use AWS Lambda instead of self managed Autoscale/EC2
- Spot instances deeply cut down the costs of self-managed solution
- Rich set of Kinesis stream metrics simplified monitoring and management of service
Amazon Kinesis Streams vs Amazon Kinesis Firehose
- Firehose does not support record level fan out or arbitrary data transformations
- With above enhancements, it would be preferred over self managed Autoscale/EC2
Scale: ~400 shards, 300 MB/sec
Use Amazon CloudWatch metrics published by Kinesis Streams
Kinesis capacity alert
- Alert upon approaching 80% capacity
- Manually reshard Kinesis using KinesisScalingUtils
Reader falling behind alert
- Alert if the average Kinesis iterator age is greater than 20 sec
- Also alert on shard level using KCL’s Per-Shard metrics(Shard Starvation)
- Ensure reader application is up, examine its custom metrics and triage
Operating Streaming Message Hub
Problem 3: Joining and aggregation
Bids
High level value added services
- Joined data directly feeds into model building pipelines for clicks etc.
- Reporting API, powered by ETL pipeline, provides aggregated metrics.
Impressions
Clicks, Conversions
Joining
and
Aggregation
Challenges
- Supporting exactly once semantics i.e. Eliminate all duplicates
- Minimize end to end latency from capture to joining & aggregation
- Be robust to delays between arrival times of correlated events
Solution 3: Stream joins using Redshift
- Message hub emits separate log files into S3 for each event type
- Data pipeline periodically loads log files into Redshift
- Redshift tables of different event types are joined via primary key
- FastPath: Joined events in 15min but can miss delayed events
- SlowPath: Fully joined events after 24 hours
Streaming
Message Hub
...
S3 Buckets
Redshift
AWS Data
Pipeline
Joins are not truly streaming in current design
- Batch size of 15 min dictated by lowest interval for scheduling data pipeline
- Lambda can be used instead of data pipeline to lower schedule intervals
- Data loaded into Redshift cannot be easily fed into Kinesis Streams
- However, it scales well, fully AWS managed and supports many of our use cases
What are the alternatives ?
1. Spark streaming via Amazon EMR
2. Amazon Kinesis Analytics
Stream join design trade offs
Summary
Building real time bidding (RTB) applications is very challenging
Beeswax provides managed platform to build RTB apps on AWS
Beeswax uses Amazon Kinesis as our platform for streaming data
Beeswax platform solves key streaming data challenges
- Supports event collection at very large scale
- Config driven platform for data transformation and fan out
- Supports joining of streams and aggregation of metrics
Tradeoffs are unique to application; Beeswax is optimized for RTB
We are hiring !
beeswax.com/careers
Confidential please do not distribute info@beeswax.com
Thank You

More Related Content

What's hot

Monitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_TutorialMonitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_Tutorial
Tim Vaillancourt
 
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
Amazon Web Services Korea
 

What's hot (20)

Introduction to Real-time, Streaming Data and Amazon Kinesis: Streaming Data ...
Introduction to Real-time, Streaming Data and Amazon Kinesis: Streaming Data ...Introduction to Real-time, Streaming Data and Amazon Kinesis: Streaming Data ...
Introduction to Real-time, Streaming Data and Amazon Kinesis: Streaming Data ...
 
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
 
Amazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for Kubernetes
 
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
 
Why Splunk Chose Pulsar_Karthik Ramasamy
Why Splunk Chose Pulsar_Karthik RamasamyWhy Splunk Chose Pulsar_Karthik Ramasamy
Why Splunk Chose Pulsar_Karthik Ramasamy
 
Observability
ObservabilityObservability
Observability
 
Monitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_TutorialMonitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_Tutorial
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Observability driven development
Observability driven developmentObservability driven development
Observability driven development
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Introduction to Azure monitor
Introduction to Azure monitorIntroduction to Azure monitor
Introduction to Azure monitor
 
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
 
DevOps Best Practices
DevOps Best PracticesDevOps Best Practices
DevOps Best Practices
 
Why to Cloud Native
Why to Cloud NativeWhy to Cloud Native
Why to Cloud Native
 
Cloud Native In-Depth
Cloud Native In-DepthCloud Native In-Depth
Cloud Native In-Depth
 
Azure devops
Azure devopsAzure devops
Azure devops
 
Introduction to Amazon EKS
Introduction to Amazon EKSIntroduction to Amazon EKS
Introduction to Amazon EKS
 
Observability at Scale
Observability at Scale Observability at Scale
Observability at Scale
 
Kafka 101 and Developer Best Practices
Kafka 101 and Developer Best PracticesKafka 101 and Developer Best Practices
Kafka 101 and Developer Best Practices
 

Similar to Real-Time Streaming Data Solution on AWS with Beeswax

Real Time Data Processing Using AWS Lambda - DevDay Austin 2017
Real Time Data Processing Using AWS Lambda - DevDay Austin 2017Real Time Data Processing Using AWS Lambda - DevDay Austin 2017
Real Time Data Processing Using AWS Lambda - DevDay Austin 2017
Amazon Web Services
 
찾아가는 AWS 세미나(구로,가산,판교) - AWS 기반 빅데이터 활용 방법 (김일호 솔루션즈 아키텍트)
찾아가는 AWS 세미나(구로,가산,판교) - AWS 기반 빅데이터 활용 방법 (김일호 솔루션즈 아키텍트)찾아가는 AWS 세미나(구로,가산,판교) - AWS 기반 빅데이터 활용 방법 (김일호 솔루션즈 아키텍트)
찾아가는 AWS 세미나(구로,가산,판교) - AWS 기반 빅데이터 활용 방법 (김일호 솔루션즈 아키텍트)
Amazon Web Services Korea
 

Similar to Real-Time Streaming Data Solution on AWS with Beeswax (20)

AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...
AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...
AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...
 
Real Time Data Processing Using AWS Lambda - DevDay Austin 2017
Real Time Data Processing Using AWS Lambda - DevDay Austin 2017Real Time Data Processing Using AWS Lambda - DevDay Austin 2017
Real Time Data Processing Using AWS Lambda - DevDay Austin 2017
 
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
 
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
 
Deep Dive and Best Practices for Real Time Streaming Applications
Deep Dive and Best Practices for Real Time Streaming ApplicationsDeep Dive and Best Practices for Real Time Streaming Applications
Deep Dive and Best Practices for Real Time Streaming Applications
 
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...
 
Deep dive and best practices on real time streaming applications nyc-loft_oct...
Deep dive and best practices on real time streaming applications nyc-loft_oct...Deep dive and best practices on real time streaming applications nyc-loft_oct...
Deep dive and best practices on real time streaming applications nyc-loft_oct...
 
Amazon Kinesis Data Streams Vs Msk (1).pptx
Amazon Kinesis Data Streams Vs Msk (1).pptxAmazon Kinesis Data Streams Vs Msk (1).pptx
Amazon Kinesis Data Streams Vs Msk (1).pptx
 
Day 5 - Real-time Data Processing/Internet of Things (IoT) with Amazon Kinesis
Day 5 - Real-time Data Processing/Internet of Things (IoT) with Amazon KinesisDay 5 - Real-time Data Processing/Internet of Things (IoT) with Amazon Kinesis
Day 5 - Real-time Data Processing/Internet of Things (IoT) with Amazon Kinesis
 
Scalable Web Apps Webinar September 2017 - IL Webina
Scalable Web Apps Webinar September 2017 - IL WebinaScalable Web Apps Webinar September 2017 - IL Webina
Scalable Web Apps Webinar September 2017 - IL Webina
 
Choose Right Stream Storage: Amazon Kinesis Data Streams vs MSK
Choose Right Stream Storage: Amazon Kinesis Data Streams vs MSKChoose Right Stream Storage: Amazon Kinesis Data Streams vs MSK
Choose Right Stream Storage: Amazon Kinesis Data Streams vs MSK
 
Bigdata meetup dwarak_realtime_score_app
Bigdata meetup dwarak_realtime_score_appBigdata meetup dwarak_realtime_score_app
Bigdata meetup dwarak_realtime_score_app
 
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...
 
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
 
AWS May Webinar Series - Streaming Data Processing with Amazon Kinesis and AW...
AWS May Webinar Series - Streaming Data Processing with Amazon Kinesis and AW...AWS May Webinar Series - Streaming Data Processing with Amazon Kinesis and AW...
AWS May Webinar Series - Streaming Data Processing with Amazon Kinesis and AW...
 
(SDD405) Amazon Kinesis Deep Dive | AWS re:Invent 2014
(SDD405) Amazon Kinesis Deep Dive | AWS re:Invent 2014(SDD405) Amazon Kinesis Deep Dive | AWS re:Invent 2014
(SDD405) Amazon Kinesis Deep Dive | AWS re:Invent 2014
 
Amazon aws big data demystified | Introduction to streaming and messaging flu...
Amazon aws big data demystified | Introduction to streaming and messaging flu...Amazon aws big data demystified | Introduction to streaming and messaging flu...
Amazon aws big data demystified | Introduction to streaming and messaging flu...
 
Building Big Data Applications with Serverless Architectures - June 2017 AWS...
Building Big Data Applications with Serverless Architectures -  June 2017 AWS...Building Big Data Applications with Serverless Architectures -  June 2017 AWS...
Building Big Data Applications with Serverless Architectures - June 2017 AWS...
 
찾아가는 AWS 세미나(구로,가산,판교) - AWS 기반 빅데이터 활용 방법 (김일호 솔루션즈 아키텍트)
찾아가는 AWS 세미나(구로,가산,판교) - AWS 기반 빅데이터 활용 방법 (김일호 솔루션즈 아키텍트)찾아가는 AWS 세미나(구로,가산,판교) - AWS 기반 빅데이터 활용 방법 (김일호 솔루션즈 아키텍트)
찾아가는 AWS 세미나(구로,가산,판교) - AWS 기반 빅데이터 활용 방법 (김일호 솔루션즈 아키텍트)
 
Em tempo real: Ingestão, processamento e analise de dados
Em tempo real: Ingestão, processamento e analise de dadosEm tempo real: Ingestão, processamento e analise de dados
Em tempo real: Ingestão, processamento e analise de dados
 

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

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

Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Hung Le
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
David Celestin
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
ZurliaSoop
 

Recently uploaded (19)

Introduction to Artificial intelligence.
Introduction to Artificial intelligence.Introduction to Artificial intelligence.
Introduction to Artificial intelligence.
 
ECOLOGY OF FISHES.pptx full presentation
ECOLOGY OF FISHES.pptx full presentationECOLOGY OF FISHES.pptx full presentation
ECOLOGY OF FISHES.pptx full presentation
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
 
"I hear you": Moving beyond empathy in UXR
"I hear you": Moving beyond empathy in UXR"I hear you": Moving beyond empathy in UXR
"I hear you": Moving beyond empathy in UXR
 
The Concession of Asaba International Airport: Balancing Politics and Policy ...
The Concession of Asaba International Airport: Balancing Politics and Policy ...The Concession of Asaba International Airport: Balancing Politics and Policy ...
The Concession of Asaba International Airport: Balancing Politics and Policy ...
 
Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...
Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...
Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...
 
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait Cityin kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
 
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptxBEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
 
2024 mega trends for the digital workplace - FINAL.pdf
2024 mega trends for the digital workplace - FINAL.pdf2024 mega trends for the digital workplace - FINAL.pdf
2024 mega trends for the digital workplace - FINAL.pdf
 
Using AI to boost productivity for developers
Using AI to boost productivity for developersUsing AI to boost productivity for developers
Using AI to boost productivity for developers
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINESBIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
LITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORN
LITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORNLITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORN
LITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORN
 
Ready Set Go Children Sermon about Mark 16:15-20
Ready Set Go Children Sermon about Mark 16:15-20Ready Set Go Children Sermon about Mark 16:15-20
Ready Set Go Children Sermon about Mark 16:15-20
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
 
History of Morena Moshoeshoe birth death
History of Morena Moshoeshoe birth deathHistory of Morena Moshoeshoe birth death
History of Morena Moshoeshoe birth death
 

Real-Time Streaming Data Solution on AWS with Beeswax

  • 1. POWERING THE NEXT GENERATION OF REAL TIME BIDDING Confidential please do not distribute info@beeswax.com
  • 2. Outline of the talk - What is Beeswax and Real-time bidding(RTB) ? - Our System Architecture - Why we choose Amazon Kinesis ? - Problem 1: Collecting very high volume streams - Problem 2: Stream data transformation and fan out - Problem 3: Joining streams and aggregation
  • 3. Who are we ? AdTech Startup based out of NYC, founded by ex-Googlers
  • 4. We do RTB (Real time bidding) Publisher Ad Exchange Beeswax Bidder Scale: O(M) QPS Latency_99 : 20 ms - Target campaigns - Target user profiles - Optimize for ROI - Customize < 200 ms Step 1: Send ad request & userid Step 2: Broadcast bid request Step 3: Submit bid & ad markup Step 4: Show ad to user Auction
  • 5. Building a bidder is very hard Need scale to deliver campaigns - To reach the desired audience, bidder needs to process at least 1M QPS - Deployment has to be in multiple regions to guarantee reach Performance - The timeout from ad exchanges is 100ms including the RTT over internet - 99%ile tail latency for processing a bid request is 20 ms Complex ecosystem - Manage integrations with ad exchanges, third party data providers and vendors - Requires a lot of domain expertise to optimize the bidder for maximizing performance
  • 6. A difficult trade-off 6 Use a DSP Build your own Bidder Risky investment of time and $ with no success guarantee Limited to no customization; Platform lock in
  • 7. Our First Product: The Bidder-as-a-Service™ A full-stack solution deployed for each customer in a sandbox Services you control Pre-built ecosystem and supply relationships Cookies, Mobile ID’s, 3rd Party Data Bidding and Targeting Engine Campaign Management UI/API Reporting UI/API Custom bidding algos Log-level streaming RESTful APIs Direct connections to customer-hosted services Fully managed ad tech platform on
  • 8. Our System Architecture Event Stream (Amazon Kinesis Streams) Impression & Click Data Producer Bid Data Producer Streaming Message Hub Customer HTTPS endpoint Customer Stream (Amazon Kinesis Streams) Amazon S3 Bucket Amazon Redshift Cluster Customer API
  • 9. What is Amazon Kinesis Streams? Fully managed service from Amazon to collect and process large streams of data records in real time Key Concepts for Amazon Kinesis Streams - Each Stream is made of shards - Each shard is a unit of parallelism and throughput (write at 1 MB/s and read at 2 MB/s) - Data producers call PutRecord(s) to send data along a partition key to an Amazon Kinesis stream
  • 10. Why we choose Amazon Kinesis ? Infrastructure requirements motivated by RTB use cases - Ingestion at very large scale (> 1M QPS) - Low latency delivery - Reliable store of data - Sequenced retrieval of events Options available for consideration 1. Apache Kafka on EC2 2. Amazon Kinesis Streams Reason to choose Kinesis - Fully managed by AWS; Really important factor for small engineering teams - Support the scale necessary for RTB - Pricing model provided opportunities to optimize cost
  • 11. Filtered bids (Amazon Kinesis Streams) Problem 1: Collecting very high volume streams Filtering and Sampling Bids: O(M) QPS Challenges - Collection at very high scale (QPS > 1M) - Minimize infrastructure cost - Minimize delivery latency for stream output Listening Bidders - Filter very high QPS bid stream using boolean targeting expressions - Sample filtered stream and deliver
  • 12. Solution 1: Optimized Data Producers Cost vs Reliability Tradeoff - Uploads are priced by PUT payload size of 25K - Buffer incoming records and pack them into single PUT payload - Possible data loss if application crashes before buffer is flushed - Be creative ! We use AWS Elastic Load Balancer (ELB) access logs to replay requests Throughput vs Latency - Buffering increases throughput as more data is uploaded per API call - Increases average latency; Not a concern for very high QPS collectors - Flush buffers periodically even if not full, to cap latency Consider overall system cost - Compression can reduce data payload size but increase data producer CPU usage - Evaluate compression vs cost tradeoff. For e.g. We choose snappy over gzip Choose uniformly distributed partition keys
  • 13. Problem 2: Data transformation and fan out Challenges - Config driven system to determine format, schema and destination of each record - Maximize resource utilization by scaling elastically to incoming stream volume - Monitoring and operating the service Transform and Fan Out Event Stream API driven, transparent and flexible platform - Provide very detailed log level data to all our customers - Support multiple delivery destinations and data formats Amazon Kinesis stream Amazon Kinesis stream Amazon S3
  • 14. What is Kinesis Client Library? - Open source library from AWS https://github.com/awslabs/amazon-kinesis-client - Enables to easily consume and process data from Amazon Kinesis Streams - Helps with elastic scale-out and fault-tolerant processing - Abstracts away complex tasks associated with distributed computing like - load balancing of shards - shard mapping between EC2 hosts - checkpointing - shard-level monitoring using CloudWatch
  • 15. Solution 2: API driven Streaming Message Hub - Kinesis Client Library (KCL) application deployed to EC2/Autoscale group - Adapters perform schema and data format transformations - Emitters buffer data in-memory and flush periodically to destination - Stream is checkpointed after records are flushed by emitters - Cloudwatch alarms on CPU utilization elastically resize fleet Kinesis Record BidAdapters WinAdapters S3Emitter ... HTTPEmitterClickAdapters KinesisEmitter ...
  • 16. Streaming Message Hub design tradeoffs Single Reader vs Multiple Readers - Separate reader for every format & destination instead of a single reader - Having separate readers improves fault tolerance - However, CPU cost of parsing records is minimized with single reader Amazon EC2 vs AWS Lambda - Use AWS Lambda instead of self managed Autoscale/EC2 - Spot instances deeply cut down the costs of self-managed solution - Rich set of Kinesis stream metrics simplified monitoring and management of service Amazon Kinesis Streams vs Amazon Kinesis Firehose - Firehose does not support record level fan out or arbitrary data transformations - With above enhancements, it would be preferred over self managed Autoscale/EC2
  • 17. Scale: ~400 shards, 300 MB/sec Use Amazon CloudWatch metrics published by Kinesis Streams Kinesis capacity alert - Alert upon approaching 80% capacity - Manually reshard Kinesis using KinesisScalingUtils Reader falling behind alert - Alert if the average Kinesis iterator age is greater than 20 sec - Also alert on shard level using KCL’s Per-Shard metrics(Shard Starvation) - Ensure reader application is up, examine its custom metrics and triage Operating Streaming Message Hub
  • 18. Problem 3: Joining and aggregation Bids High level value added services - Joined data directly feeds into model building pipelines for clicks etc. - Reporting API, powered by ETL pipeline, provides aggregated metrics. Impressions Clicks, Conversions Joining and Aggregation Challenges - Supporting exactly once semantics i.e. Eliminate all duplicates - Minimize end to end latency from capture to joining & aggregation - Be robust to delays between arrival times of correlated events
  • 19. Solution 3: Stream joins using Redshift - Message hub emits separate log files into S3 for each event type - Data pipeline periodically loads log files into Redshift - Redshift tables of different event types are joined via primary key - FastPath: Joined events in 15min but can miss delayed events - SlowPath: Fully joined events after 24 hours Streaming Message Hub ... S3 Buckets Redshift AWS Data Pipeline
  • 20. Joins are not truly streaming in current design - Batch size of 15 min dictated by lowest interval for scheduling data pipeline - Lambda can be used instead of data pipeline to lower schedule intervals - Data loaded into Redshift cannot be easily fed into Kinesis Streams - However, it scales well, fully AWS managed and supports many of our use cases What are the alternatives ? 1. Spark streaming via Amazon EMR 2. Amazon Kinesis Analytics Stream join design trade offs
  • 21. Summary Building real time bidding (RTB) applications is very challenging Beeswax provides managed platform to build RTB apps on AWS Beeswax uses Amazon Kinesis as our platform for streaming data Beeswax platform solves key streaming data challenges - Supports event collection at very large scale - Config driven platform for data transformation and fan out - Supports joining of streams and aggregation of metrics Tradeoffs are unique to application; Beeswax is optimized for RTB
  • 22. We are hiring ! beeswax.com/careers
  • 23. Confidential please do not distribute info@beeswax.com Thank You