SlideShare a Scribd company logo
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

백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
NAVER D2
 
Tupperware: Containerized Deployment at FB
Tupperware: Containerized Deployment at FBTupperware: Containerized Deployment at FB
Tupperware: Containerized Deployment at FB
Docker, Inc.
 

What's hot (20)

PostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSPostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFS
 
Hyperspace for Delta Lake
Hyperspace for Delta LakeHyperspace for Delta Lake
Hyperspace for Delta Lake
 
[236] 카카오의데이터파이프라인 윤도영
[236] 카카오의데이터파이프라인 윤도영[236] 카카오의데이터파이프라인 윤도영
[236] 카카오의데이터파이프라인 윤도영
 
AWS Elastic Beanstalk기반 Docker 콘테이너 배포를 통한 마이크로서비스 구축
AWS Elastic Beanstalk기반 Docker 콘테이너 배포를 통한 마이크로서비스 구축AWS Elastic Beanstalk기반 Docker 콘테이너 배포를 통한 마이크로서비스 구축
AWS Elastic Beanstalk기반 Docker 콘테이너 배포를 통한 마이크로서비스 구축
 
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
 
Spark + S3 + R3를 이용한 데이터 분석 시스템 만들기
Spark + S3 + R3를 이용한 데이터 분석 시스템 만들기Spark + S3 + R3를 이용한 데이터 분석 시스템 만들기
Spark + S3 + R3를 이용한 데이터 분석 시스템 만들기
 
[한국IBM] 엔터프라이즈 AI 검색엔진 Watson Discovery 소개자료
[한국IBM] 엔터프라이즈 AI 검색엔진 Watson Discovery 소개자료[한국IBM] 엔터프라이즈 AI 검색엔진 Watson Discovery 소개자료
[한국IBM] 엔터프라이즈 AI 검색엔진 Watson Discovery 소개자료
 
GitLab과 Kubernetes를 통한 CI/CD 구축
GitLab과 Kubernetes를 통한 CI/CD 구축GitLab과 Kubernetes를 통한 CI/CD 구축
GitLab과 Kubernetes를 통한 CI/CD 구축
 
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
 
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
 
OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...
OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...
OSMC 2022 | VictoriaMetrics: scaling to 100 million metrics per second by Ali...
 
quick intro to elastic search
quick intro to elastic search quick intro to elastic search
quick intro to elastic search
 
Log design
Log designLog design
Log design
 
Developing high frequency indicators using real time tick data on apache supe...
Developing high frequency indicators using real time tick data on apache supe...Developing high frequency indicators using real time tick data on apache supe...
Developing high frequency indicators using real time tick data on apache supe...
 
Envoy 를 이용한 코드 배포 자동화
Envoy 를 이용한 코드 배포 자동화Envoy 를 이용한 코드 배포 자동화
Envoy 를 이용한 코드 배포 자동화
 
Tupperware: Containerized Deployment at FB
Tupperware: Containerized Deployment at FBTupperware: Containerized Deployment at FB
Tupperware: Containerized Deployment at FB
 
Monitoring with Prometheus
Monitoring with PrometheusMonitoring with Prometheus
Monitoring with Prometheus
 
Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드
 
AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기
 
서버리스 아키텍처 패턴 및 로그 처리를 위한 파이프라인 구축기 - 황윤상 솔루션즈 아키텍트, AWS / Matthew Han, SendBi...
서버리스 아키텍처 패턴 및 로그 처리를 위한 파이프라인 구축기 - 황윤상 솔루션즈 아키텍트, AWS / Matthew Han, SendBi...서버리스 아키텍처 패턴 및 로그 처리를 위한 파이프라인 구축기 - 황윤상 솔루션즈 아키텍트, AWS / Matthew Han, SendBi...
서버리스 아키텍처 패턴 및 로그 처리를 위한 파이프라인 구축기 - 황윤상 솔루션즈 아키텍트, AWS / Matthew Han, SendBi...
 

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

527598851-ppc-due-to-various-govt-policies.pdf
527598851-ppc-due-to-various-govt-policies.pdf527598851-ppc-due-to-various-govt-policies.pdf
527598851-ppc-due-to-various-govt-policies.pdf
rajpreetkaur75080
 
Introduction of Biology in living organisms
Introduction of Biology in living organismsIntroduction of Biology in living organisms
Introduction of Biology in living organisms
soumyapottola
 

Recently uploaded (14)

Pollinator Ambassador Earth Steward Day Presentation 2024-05-22
Pollinator Ambassador Earth Steward Day Presentation 2024-05-22Pollinator Ambassador Earth Steward Day Presentation 2024-05-22
Pollinator Ambassador Earth Steward Day Presentation 2024-05-22
 
Hi-Tech Industry 2024-25 Prospective.pptx
Hi-Tech Industry 2024-25 Prospective.pptxHi-Tech Industry 2024-25 Prospective.pptx
Hi-Tech Industry 2024-25 Prospective.pptx
 
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
 
527598851-ppc-due-to-various-govt-policies.pdf
527598851-ppc-due-to-various-govt-policies.pdf527598851-ppc-due-to-various-govt-policies.pdf
527598851-ppc-due-to-various-govt-policies.pdf
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
 
Introduction of Biology in living organisms
Introduction of Biology in living organismsIntroduction of Biology in living organisms
Introduction of Biology in living organisms
 
Oracle Database Administration I (1Z0-082) Exam Dumps 2024.pdf
Oracle Database Administration I (1Z0-082) Exam Dumps 2024.pdfOracle Database Administration I (1Z0-082) Exam Dumps 2024.pdf
Oracle Database Administration I (1Z0-082) Exam Dumps 2024.pdf
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
 
Writing Sample 2 -Bridging the Divide: Enhancing Public Engagement in Urban D...
Writing Sample 2 -Bridging the Divide: Enhancing Public Engagement in Urban D...Writing Sample 2 -Bridging the Divide: Enhancing Public Engagement in Urban D...
Writing Sample 2 -Bridging the Divide: Enhancing Public Engagement in Urban D...
 
The Canoga Gardens Development Project. PDF
The Canoga Gardens Development Project. PDFThe Canoga Gardens Development Project. PDF
The Canoga Gardens Development Project. PDF
 
05232024 Joint Meeting - Community Networking
05232024 Joint Meeting - Community Networking05232024 Joint Meeting - Community Networking
05232024 Joint Meeting - Community Networking
 
Breathing in New Life_ Part 3 05 22 2024.pptx
Breathing in New Life_ Part 3 05 22 2024.pptxBreathing in New Life_ Part 3 05 22 2024.pptx
Breathing in New Life_ Part 3 05 22 2024.pptx
 
123445566544333222333444dxcvbcvcvharsh.pptx
123445566544333222333444dxcvbcvcvharsh.pptx123445566544333222333444dxcvbcvcvharsh.pptx
123445566544333222333444dxcvbcvcvharsh.pptx
 

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