SlideShare a Scribd company logo
1 of 50
Download to read offline
Big Data
Should Be Simple
Dori Waldman - Big Data Lead
AT A
GLANCE
1.2M
TRANSACTIONS/S
8T
RAW DATA /d
NEW YORK
LONDON
SAN
FRANCISCO
TEL AVIV
BEIJING
500-1000
SERVERS
2007
FOUNDED
100EMPLOYEES
800M
UNIQUE USERS
InnerActive in numbers
OUR
MISSION
Ad-Request
RTB
Non RtB
Im
pressions
/ Clicks
1
3
2
High level architecture: fully scale & elastic
Big data challenges are complicated and includes
features like:
● Massive cross dimensions aggregation, drill down
in real time, for presenting ad ROI…
● Analytics (Databricks / Zeppelin) on Raw data
● Cube (Dynamic reports)
● Anomaly detection
● Audience targeting like google adwords:
○ Offline process to analyze users
○ Real time targeting request
● ML: filter bad traffic , targeting recommendation
InnerActive Main DB Challenges
Main
DB Stack
Aggregations
Configuration
Analytic - Cube
Analytic
KV - Cache SSOT Q
Aggregation
Pre
spark structured streaming
Massive
Aggregations
Lambda Flow
● raw data from kafka:
● Needs to do aggregation by:
○ Country
○ Country and OS and AppId
● Batch / Stream
Secor
Stream Hourly +Daily Batch
Stream
aggregate
Hourly
Data
Batch - recovery hourly data from raw data
Analytic
Parquet is being used in order to avoid read-update-save cycle in C*
In short...
● Exactly once semantic :
○ recovery from failure (Yarn also helps)
○ recovery from updates (checkpoint)
■ Non idempotent data (aggregation)
■ Non transactional DB (Cassandra)
● Offsets management:
○ Save in Spark checkpoint ? No , we use ZK
● Out of order data
● Flow:
We are saving data in hdfs , folder name contains “from” offset
○ we update ZK with “from” offset in the beginning of each stream iteration
○ In case spark crash , during streaming initialization we retrieve offsets from
ZK (“from” of last iteration)
○ data is partitioned by date to manage out of order data
In short...
Example :
● Before update Data in DB, only ZK was updated:
○ read from kafka offset 200-300
○ update ZK with 200
○ crash
○ recover
○ get offsets from ZK
○ read again from 200 , might be till 305
○ write to hdfs - no data lost.
● After update data in DB (and ZK):
○ read from kafka offset 200-300
○ update ZK with 200
○ update in hdfs data in folder “200”
○ crash
○ recover
○ get offsets from ZK
○ read from 200 till 305
○ overwrite data in hdfs folder “200” - no duplication.
Can we make
it simple ?
We could use checkpoint , enjoy from built-in offset management , Only during
deployment , fix data with batch but its maintenance nightmare , not aligned with
CI-CD
Spark 2.1 api
https://www.youtube.com/watch?v=UQiuyov4J-4
Analytic
Analytic
ETL,
DashBoard,
● Data Format : Spark batch convert raw data to parquet
format, which reduce significant query time
● ETL : once we have parquet files we run several ETL’s
● Dashboard : Databricks scheduler jobs update dashboard
Multi-Dimension
16PAGE //
Druid
● Cube
● Time series
● Columnar DB
● Fast
● ThetaSketch
● load Data Stream / batch
● Great UI
● Complicated Deploy
17PAGE //
Druid
Components
18PAGE //
Druid
Usage
● Hourly - Stream
○ Segments are available once they are closed, we
are using tranquility(kafka consumer) to create
hourly segment.
● Daily - Batch
○ We are using batch (fire-house) to create daily
segments from hourly segments (from start of
day till now)
● Hourly Batch
○ We are using EMR with batch to fix missing hours
due to streaming failure, to create hourly
segments from S3
19PAGE //
Druid
Usage
Hourly - Stream Daily - Batch Hourly - Batch (EMR)
Anomaly
Detector
Flow
We are using Twitter Anomaly detector
https://github.com/twitter/AnomalyDetection
we have scheduler process that query db, generate csv
with data and time series, the csv file is the input for
anomaly detection , send email incase of anomaly
Targeting
23PAGE //
Requirement
Send Ad to
20 year old,
male, from
New-York...
Data Types
● Regular DMP can provide information per user
like if its male 20 years old , from New york that
like sports and has car (Taxonomy).
● Internal DMP - InnerActive see cross publishers
and demands , InnerActive monitor user ad
experience such as which users clicks more, and
on what, type of ad video user see till end...
Data Collect and Merge
● 8T daily raw data needs to be aggregated to
provide relevant information per user, and then
merged with several DMP’s data.
Create
Audiences
(offline)
25PAGE //
Flow
● Spark batch generate hourly / daily / monthly
aggregations per user from S3 (Kafka consumer
upload data to S3) → 800M raws with InnerActive
DMP data
● Data is merged with DMP data(align with taxonomy)
● Raws are ready to use and can be loaded to DB for
analytic usage, and later on for audience selections
throw the console.
1
26PAGE //
Raw Data
● 120 columns with:
○ Dimensions: Age, Gender, Country
○ Metrics: #Clicks, #Impressions, #Video
● 20 columns with MultiValue Dimensions:
○ Domains: [CNN.com, Ebay.com]
○ Interests: [Sport, Shopping, Cars]
● Checking if DB support advanced feature for future
requirements like Map:
{#number of clicks per domain}
in addition to total number of clicks that the user is doing
2
27PAGE //
DB &
Queries
POC
Requirement
3
● 1-2 sec – queries over 400M users (not all queries took 2s)
● complex query but still avoid Join (multiValued / Map)
● Statistics functionality like HyperLogLog / ThetaSketch
● JDBC compliance
● Easy maintained
● Low Concurrency
● Scale Scale Scale
● Supported / Community
● Price estimation
28PAGE //
DB - How we
choosed
1.
columnar
database
● Minimize Read-write from disk:
“select age,name from tbl where age >30”
instead of reading all rows and return all columns, and
select only 2 fields, columnar DB only reads data from
2 columns and return only 2 columns
● High compression
4
29PAGE //
DB - How we
choosed
2.MPP
Data is big,
needs to be
split across
machines to get
result within ~2 sec
0.5-1T
● Massively Parallel Processing:
○ multiple processors working on different
parts of the program.
○ Each processor has its own operating
system and memory.
○ It speeds the performance of huge
databases that deal with massive amounts
of data.
4
30PAGE //
DB - How we
choosed
3.FAST
In Memory
DB Or
OS Cache?
Memory main layers
RAM / In process memory like Java HashMap
Operation System cache
Disk: SSD or not
Speed
Prices
● In Memory
○ Row Data resides in a computer’s random access memory
(RAM) – not physical disk
● OS Cache
○ Columnar/compressed data in Disk, execute query loads the
data to the OS memory
4
31PAGE //
● we found out that it's faster (query time) to use columnar
data that is loaded to OS cache, instead of row data in
memory as it needs to read all data (we use random
queries index will not help)
● Columnar compress data reduce storage size therefore it
load more raw data to OS cache, disadvantage is that we
pay more CPU time to decompress data per query
DB - How we
choosed
3.FAST
In Memory
DB Or
OS Cache?
4
32PAGE //
Let the
Game Begin
FS with OS cache IN-Memory
33PAGE //
What
was
not
tested
34PAGE //
ClickHouse
Jdbc compliance
Very Fast
FS Columnar DB (load data to OS memory)
MultiValue Support - “IN”
HyperLogLog Support
Easy to Install + Scale
Load CSV data
Build for our use case
No Support - Open source
Community?
35PAGE //
MemSql
Commercial
○ Combination of Aggregator nodes that save data in
memory as raw data, and Leaf nodes that save data
in FS columnar
○ Increase Aggregators to better handle concurrency
○ Increase Leafs to minimize latency
○ We checked both options (raw data in memory,
columnar data in FS)
36PAGE //
MemSql
Memory
VS.
Cache
■ Jdbc compliance
■ Very Fast
■ Columnar DB + Memory
■ MultiValue Support? Json search, we avoid Join
■ Easy to Install + Scale
■ Load CSV data
■ Support / commercial
37PAGE //
RedShift
■ Jdbc compliance
■ Fast
■ Columnar DB + Memory
■ No MultiValue Support - you can use “like”,
Join are not fast enough.
■ service
■ commercial
■ price high
built upon postgress, save data in columnar , no index , scalable , each query run on its node (MPP)
38PAGE //
Solr
We tried Solr although its handling data differently,
Solr index documents and allows very rich queries.
Solr fits our complex queries requierments using its
faceting navigation
once you run queries the data is loaded to cache and it
provide good query time
we pay during loading/indexing data - time
We didn't finished POC on Solr, as we decided to
continue with another solution.
39PAGE //
Presto
Supported by TeraData
40PAGE //
Presto
How It Works
● Use connectors to Mysql / HDFS / Cassandra
● MPP shared nothing across machines
● Priority Queries
● Can load parquet (columnar compress format) -
no need for Join
● Support Hive queries
41PAGE //
Presto
On Steroid
● Raptor is Presto connector (configuration) that load data to
Presto machines (sharded on SSD)
● Instead of doing query to HDFS or S3 , it queries its local SSD
while the second queries use OS cache
○ Short Load time (<1H) from remote HDFS to locals SSD
(we also tried to use Presto on top of Alluxio, and hdfs & presto on same machine)
42PAGE //
Presto
+
Raptor
Load data
Flow
● Create table using Hive (data located in hdfs cluster)
● Create table in Raptor
○ CREATE TABLE raptor.audienceTbl AS SELECT * FROM hive.default.audience;
● Load data with Raptor to Presto machines
○ update table raptorTbl as select from hiveTbl where day = <day>
● In case of raptor failure, we can continue using Presto to
query hdfs via Hive, and in the meantime load hdfs data to
raptor again.
43PAGE //
Presto
On Steroid
● Another option instead of Raptor is LLAP (Hive Cache)
44PAGE //
Presto
On Steroid
● Another option instead of Raptor is Presto Memory Connector
(RAM) - we are going to test it
45PAGE //
Presto
UI
AirPal (AirBNB)
https://github.com/airbnb/superset
46PAGE //
We didn't looked for the fastest DB in the world.
We looked for valid solutions for our use case, and we
checked functionality, price, etc …
Some solutions failed in the functionality requirements like
MariaDB (Columnar) Some due to high price (RedShift)
We decided to continue with Presto + Raptor, we can use
our parquet data as is, load it to HDFS, load it to Presto
machines...
And The
Winner
is
RealTime
Targeting
48PAGE //
Serving flow ● Once we selected audiences, next phase is real time match
audiences to adRequest
● We are using spark batch that create key-value mapping
between userId and audiences, and we upload it to aerospike
● During adRequest flow we retrieve (~4ms) user audiences...
Key-Value, scale - In memory KV
Lots of reads ,
update once a day in batch
MLib - next time
THANK YOUDori.waldman@inner-active.com
https://www.linkedin.com/in/doriwaldman/
https://www.slideshare.net/doriwaldman

More Related Content

What's hot

HBaseCon 2013: Compaction Improvements in Apache HBase
HBaseCon 2013: Compaction Improvements in Apache HBaseHBaseCon 2013: Compaction Improvements in Apache HBase
HBaseCon 2013: Compaction Improvements in Apache HBaseCloudera, Inc.
 
Argus Production Monitoring at Salesforce
Argus Production Monitoring at SalesforceArgus Production Monitoring at Salesforce
Argus Production Monitoring at SalesforceHBaseCon
 
RocksDB compaction
RocksDB compactionRocksDB compaction
RocksDB compactionMIJIN AN
 
HBase for Architects
HBase for ArchitectsHBase for Architects
HBase for ArchitectsNick Dimiduk
 
Hw09 Sqoop Database Import For Hadoop
Hw09   Sqoop Database Import For HadoopHw09   Sqoop Database Import For Hadoop
Hw09 Sqoop Database Import For HadoopCloudera, Inc.
 
Brian Bulkowski. Aerospike
Brian Bulkowski. AerospikeBrian Bulkowski. Aerospike
Brian Bulkowski. AerospikeVolha Banadyseva
 
Delta: Building Merge on Read
Delta: Building Merge on ReadDelta: Building Merge on Read
Delta: Building Merge on ReadDatabricks
 
Enabling Presto Caching at Uber with Alluxio
Enabling Presto Caching at Uber with AlluxioEnabling Presto Caching at Uber with Alluxio
Enabling Presto Caching at Uber with AlluxioAlluxio, Inc.
 
Alluxio Data Orchestration Platform for the Cloud
Alluxio Data Orchestration Platform for the CloudAlluxio Data Orchestration Platform for the Cloud
Alluxio Data Orchestration Platform for the CloudShubham Tagra
 
BIG DATA: From mammoth to elephant
BIG DATA: From mammoth to elephantBIG DATA: From mammoth to elephant
BIG DATA: From mammoth to elephantRoman Nikitchenko
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guideRyan Blue
 
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UKIntroduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UKSkills Matter
 
The Apache Spark File Format Ecosystem
The Apache Spark File Format EcosystemThe Apache Spark File Format Ecosystem
The Apache Spark File Format EcosystemDatabricks
 
Introduction to AWS Big Data
Introduction to AWS Big Data Introduction to AWS Big Data
Introduction to AWS Big Data Omid Vahdaty
 
HBaseCon 2012 | Gap Inc Direct: Serving Apparel Catalog from HBase for Live W...
HBaseCon 2012 | Gap Inc Direct: Serving Apparel Catalog from HBase for Live W...HBaseCon 2012 | Gap Inc Direct: Serving Apparel Catalog from HBase for Live W...
HBaseCon 2012 | Gap Inc Direct: Serving Apparel Catalog from HBase for Live W...Cloudera, Inc.
 
Introduction to NoSql
Introduction to NoSqlIntroduction to NoSql
Introduction to NoSqlOmid Vahdaty
 
Project Voldemort: Big data loading
Project Voldemort: Big data loadingProject Voldemort: Big data loading
Project Voldemort: Big data loadingDan Harvey
 
Composable Data Processing with Apache Spark
Composable Data Processing with Apache SparkComposable Data Processing with Apache Spark
Composable Data Processing with Apache SparkDatabricks
 

What's hot (20)

HBaseCon 2013: Compaction Improvements in Apache HBase
HBaseCon 2013: Compaction Improvements in Apache HBaseHBaseCon 2013: Compaction Improvements in Apache HBase
HBaseCon 2013: Compaction Improvements in Apache HBase
 
Argus Production Monitoring at Salesforce
Argus Production Monitoring at SalesforceArgus Production Monitoring at Salesforce
Argus Production Monitoring at Salesforce
 
RocksDB compaction
RocksDB compactionRocksDB compaction
RocksDB compaction
 
HBase for Architects
HBase for ArchitectsHBase for Architects
HBase for Architects
 
RubiX
RubiXRubiX
RubiX
 
Hw09 Sqoop Database Import For Hadoop
Hw09   Sqoop Database Import For HadoopHw09   Sqoop Database Import For Hadoop
Hw09 Sqoop Database Import For Hadoop
 
Brian Bulkowski. Aerospike
Brian Bulkowski. AerospikeBrian Bulkowski. Aerospike
Brian Bulkowski. Aerospike
 
Delta: Building Merge on Read
Delta: Building Merge on ReadDelta: Building Merge on Read
Delta: Building Merge on Read
 
Enabling Presto Caching at Uber with Alluxio
Enabling Presto Caching at Uber with AlluxioEnabling Presto Caching at Uber with Alluxio
Enabling Presto Caching at Uber with Alluxio
 
Alluxio Data Orchestration Platform for the Cloud
Alluxio Data Orchestration Platform for the CloudAlluxio Data Orchestration Platform for the Cloud
Alluxio Data Orchestration Platform for the Cloud
 
BIG DATA: From mammoth to elephant
BIG DATA: From mammoth to elephantBIG DATA: From mammoth to elephant
BIG DATA: From mammoth to elephant
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guide
 
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UKIntroduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
 
In-Memory DataBase
In-Memory DataBaseIn-Memory DataBase
In-Memory DataBase
 
The Apache Spark File Format Ecosystem
The Apache Spark File Format EcosystemThe Apache Spark File Format Ecosystem
The Apache Spark File Format Ecosystem
 
Introduction to AWS Big Data
Introduction to AWS Big Data Introduction to AWS Big Data
Introduction to AWS Big Data
 
HBaseCon 2012 | Gap Inc Direct: Serving Apparel Catalog from HBase for Live W...
HBaseCon 2012 | Gap Inc Direct: Serving Apparel Catalog from HBase for Live W...HBaseCon 2012 | Gap Inc Direct: Serving Apparel Catalog from HBase for Live W...
HBaseCon 2012 | Gap Inc Direct: Serving Apparel Catalog from HBase for Live W...
 
Introduction to NoSql
Introduction to NoSqlIntroduction to NoSql
Introduction to NoSql
 
Project Voldemort: Big data loading
Project Voldemort: Big data loadingProject Voldemort: Big data loading
Project Voldemort: Big data loading
 
Composable Data Processing with Apache Spark
Composable Data Processing with Apache SparkComposable Data Processing with Apache Spark
Composable Data Processing with Apache Spark
 

Viewers also liked

Cloud Machine Learning with Google Cloud Platform
Cloud Machine Learning with Google Cloud PlatformCloud Machine Learning with Google Cloud Platform
Cloud Machine Learning with Google Cloud PlatformMichal Brys
 
Big data and machine learning for Businesses
Big data and machine learning for BusinessesBig data and machine learning for Businesses
Big data and machine learning for BusinessesAbdul Wahid
 
Getting started with TensorFlow
Getting started with TensorFlowGetting started with TensorFlow
Getting started with TensorFlowElifTech
 
Google Developer Groups Talk - TensorFlow
Google Developer Groups Talk - TensorFlowGoogle Developer Groups Talk - TensorFlow
Google Developer Groups Talk - TensorFlowHarini Gunabalan
 
Machine learning and big data
Machine learning and big dataMachine learning and big data
Machine learning and big dataPoo Kuan Hoong
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert홍배 김
 
Image Recognition With TensorFlow
Image Recognition With TensorFlowImage Recognition With TensorFlow
Image Recognition With TensorFlowYaz Santissi
 

Viewers also liked (7)

Cloud Machine Learning with Google Cloud Platform
Cloud Machine Learning with Google Cloud PlatformCloud Machine Learning with Google Cloud Platform
Cloud Machine Learning with Google Cloud Platform
 
Big data and machine learning for Businesses
Big data and machine learning for BusinessesBig data and machine learning for Businesses
Big data and machine learning for Businesses
 
Getting started with TensorFlow
Getting started with TensorFlowGetting started with TensorFlow
Getting started with TensorFlow
 
Google Developer Groups Talk - TensorFlow
Google Developer Groups Talk - TensorFlowGoogle Developer Groups Talk - TensorFlow
Google Developer Groups Talk - TensorFlow
 
Machine learning and big data
Machine learning and big dataMachine learning and big data
Machine learning and big data
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert
 
Image Recognition With TensorFlow
Image Recognition With TensorFlowImage Recognition With TensorFlow
Image Recognition With TensorFlow
 

Similar to Big data should be simple

AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned Omid Vahdaty
 
Understanding Hadoop
Understanding HadoopUnderstanding Hadoop
Understanding HadoopAhmed Ossama
 
Etl confessions pg conf us 2017
Etl confessions   pg conf us 2017Etl confessions   pg conf us 2017
Etl confessions pg conf us 2017Corey Huinker
 
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a ServiceZeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a ServiceDatabricks
 
Spark Meetup at Uber
Spark Meetup at UberSpark Meetup at Uber
Spark Meetup at UberDatabricks
 
Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3  Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3 Omid Vahdaty
 
How to Develop and Operate Cloud First Data Platforms
How to Develop and Operate Cloud First Data PlatformsHow to Develop and Operate Cloud First Data Platforms
How to Develop and Operate Cloud First Data PlatformsAlluxio, Inc.
 
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB plc
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixC4Media
 
Logs @ OVHcloud
Logs @ OVHcloudLogs @ OVHcloud
Logs @ OVHcloudOVHcloud
 
MongoDB World 2019: Packing Up Your Data and Moving to MongoDB Atlas
MongoDB World 2019: Packing Up Your Data and Moving to MongoDB AtlasMongoDB World 2019: Packing Up Your Data and Moving to MongoDB Atlas
MongoDB World 2019: Packing Up Your Data and Moving to MongoDB AtlasMongoDB
 
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | EnglishAWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | EnglishOmid Vahdaty
 
Stream, Stream, Stream: Different Streaming Methods with Apache Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Apache Spark and KafkaStream, Stream, Stream: Different Streaming Methods with Apache Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Apache Spark and KafkaDatabricks
 
Big data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerBig data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerFederico Palladoro
 
Challenges of Building a First Class SQL-on-Hadoop Engine
Challenges of Building a First Class SQL-on-Hadoop EngineChallenges of Building a First Class SQL-on-Hadoop Engine
Challenges of Building a First Class SQL-on-Hadoop EngineNicolas Morales
 
Best Practices for Migrating your Data Warehouse to Amazon Redshift
Best Practices for Migrating your Data Warehouse to Amazon RedshiftBest Practices for Migrating your Data Warehouse to Amazon Redshift
Best Practices for Migrating your Data Warehouse to Amazon RedshiftAmazon Web Services
 
QuestDB: ingesting a million time series per second on a single instance. Big...
QuestDB: ingesting a million time series per second on a single instance. Big...QuestDB: ingesting a million time series per second on a single instance. Big...
QuestDB: ingesting a million time series per second on a single instance. Big...javier ramirez
 

Similar to Big data should be simple (20)

AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned AWS Big Data Demystified #1: Big data architecture lessons learned
AWS Big Data Demystified #1: Big data architecture lessons learned
 
Understanding Hadoop
Understanding HadoopUnderstanding Hadoop
Understanding Hadoop
 
Etl confessions pg conf us 2017
Etl confessions   pg conf us 2017Etl confessions   pg conf us 2017
Etl confessions pg conf us 2017
 
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a ServiceZeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
 
Spark Meetup at Uber
Spark Meetup at UberSpark Meetup at Uber
Spark Meetup at Uber
 
Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3  Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3
 
How to Develop and Operate Cloud First Data Platforms
How to Develop and Operate Cloud First Data PlatformsHow to Develop and Operate Cloud First Data Platforms
How to Develop and Operate Cloud First Data Platforms
 
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance Optimization
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
Logs @ OVHcloud
Logs @ OVHcloudLogs @ OVHcloud
Logs @ OVHcloud
 
EQUNIX - PPT 11DB-Postgres™.pdf
EQUNIX - PPT 11DB-Postgres™.pdfEQUNIX - PPT 11DB-Postgres™.pdf
EQUNIX - PPT 11DB-Postgres™.pdf
 
MongoDB World 2019: Packing Up Your Data and Moving to MongoDB Atlas
MongoDB World 2019: Packing Up Your Data and Moving to MongoDB AtlasMongoDB World 2019: Packing Up Your Data and Moving to MongoDB Atlas
MongoDB World 2019: Packing Up Your Data and Moving to MongoDB Atlas
 
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | EnglishAWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
 
Stream, Stream, Stream: Different Streaming Methods with Apache Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Apache Spark and KafkaStream, Stream, Stream: Different Streaming Methods with Apache Spark and Kafka
Stream, Stream, Stream: Different Streaming Methods with Apache Spark and Kafka
 
The DBpedia databus
The DBpedia databusThe DBpedia databus
The DBpedia databus
 
Cloud arch patterns
Cloud arch patternsCloud arch patterns
Cloud arch patterns
 
Big data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerBig data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on docker
 
Challenges of Building a First Class SQL-on-Hadoop Engine
Challenges of Building a First Class SQL-on-Hadoop EngineChallenges of Building a First Class SQL-on-Hadoop Engine
Challenges of Building a First Class SQL-on-Hadoop Engine
 
Best Practices for Migrating your Data Warehouse to Amazon Redshift
Best Practices for Migrating your Data Warehouse to Amazon RedshiftBest Practices for Migrating your Data Warehouse to Amazon Redshift
Best Practices for Migrating your Data Warehouse to Amazon Redshift
 
QuestDB: ingesting a million time series per second on a single instance. Big...
QuestDB: ingesting a million time series per second on a single instance. Big...QuestDB: ingesting a million time series per second on a single instance. Big...
QuestDB: ingesting a million time series per second on a single instance. Big...
 

More from Dori Waldman

iceberg introduction.pptx
iceberg introduction.pptxiceberg introduction.pptx
iceberg introduction.pptxDori Waldman
 
spark stream - kafka - the right way
spark stream - kafka - the right way spark stream - kafka - the right way
spark stream - kafka - the right way Dori Waldman
 
Druid meetup @walkme
Druid meetup @walkmeDruid meetup @walkme
Druid meetup @walkmeDori Waldman
 
Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies Dori Waldman
 
whats new in java 8
whats new in java 8 whats new in java 8
whats new in java 8 Dori Waldman
 
Spark streaming with kafka
Spark streaming with kafkaSpark streaming with kafka
Spark streaming with kafkaDori Waldman
 
Spark stream - Kafka
Spark stream - Kafka Spark stream - Kafka
Spark stream - Kafka Dori Waldman
 
Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2Dori Waldman
 
Dori waldman android _course
Dori waldman android _courseDori waldman android _course
Dori waldman android _courseDori Waldman
 

More from Dori Waldman (12)

openai.pptx
openai.pptxopenai.pptx
openai.pptx
 
iceberg introduction.pptx
iceberg introduction.pptxiceberg introduction.pptx
iceberg introduction.pptx
 
spark stream - kafka - the right way
spark stream - kafka - the right way spark stream - kafka - the right way
spark stream - kafka - the right way
 
Druid meetup @walkme
Druid meetup @walkmeDruid meetup @walkme
Druid meetup @walkme
 
Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies
 
Druid
DruidDruid
Druid
 
Memcached
MemcachedMemcached
Memcached
 
whats new in java 8
whats new in java 8 whats new in java 8
whats new in java 8
 
Spark streaming with kafka
Spark streaming with kafkaSpark streaming with kafka
Spark streaming with kafka
 
Spark stream - Kafka
Spark stream - Kafka Spark stream - Kafka
Spark stream - Kafka
 
Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2
 
Dori waldman android _course
Dori waldman android _courseDori waldman android _course
Dori waldman android _course
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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 MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Big data should be simple

  • 1. Big Data Should Be Simple Dori Waldman - Big Data Lead
  • 2. AT A GLANCE 1.2M TRANSACTIONS/S 8T RAW DATA /d NEW YORK LONDON SAN FRANCISCO TEL AVIV BEIJING 500-1000 SERVERS 2007 FOUNDED 100EMPLOYEES 800M UNIQUE USERS InnerActive in numbers
  • 4. Big data challenges are complicated and includes features like: ● Massive cross dimensions aggregation, drill down in real time, for presenting ad ROI… ● Analytics (Databricks / Zeppelin) on Raw data ● Cube (Dynamic reports) ● Anomaly detection ● Audience targeting like google adwords: ○ Offline process to analyze users ○ Real time targeting request ● ML: filter bad traffic , targeting recommendation InnerActive Main DB Challenges
  • 5. Main DB Stack Aggregations Configuration Analytic - Cube Analytic KV - Cache SSOT Q
  • 8. Massive Aggregations Lambda Flow ● raw data from kafka: ● Needs to do aggregation by: ○ Country ○ Country and OS and AppId ● Batch / Stream Secor Stream Hourly +Daily Batch Stream aggregate Hourly Data Batch - recovery hourly data from raw data Analytic Parquet is being used in order to avoid read-update-save cycle in C*
  • 9. In short... ● Exactly once semantic : ○ recovery from failure (Yarn also helps) ○ recovery from updates (checkpoint) ■ Non idempotent data (aggregation) ■ Non transactional DB (Cassandra) ● Offsets management: ○ Save in Spark checkpoint ? No , we use ZK ● Out of order data ● Flow: We are saving data in hdfs , folder name contains “from” offset ○ we update ZK with “from” offset in the beginning of each stream iteration ○ In case spark crash , during streaming initialization we retrieve offsets from ZK (“from” of last iteration) ○ data is partitioned by date to manage out of order data
  • 10. In short... Example : ● Before update Data in DB, only ZK was updated: ○ read from kafka offset 200-300 ○ update ZK with 200 ○ crash ○ recover ○ get offsets from ZK ○ read again from 200 , might be till 305 ○ write to hdfs - no data lost. ● After update data in DB (and ZK): ○ read from kafka offset 200-300 ○ update ZK with 200 ○ update in hdfs data in folder “200” ○ crash ○ recover ○ get offsets from ZK ○ read from 200 till 305 ○ overwrite data in hdfs folder “200” - no duplication.
  • 11. Can we make it simple ? We could use checkpoint , enjoy from built-in offset management , Only during deployment , fix data with batch but its maintenance nightmare , not aligned with CI-CD
  • 14. Analytic ETL, DashBoard, ● Data Format : Spark batch convert raw data to parquet format, which reduce significant query time ● ETL : once we have parquet files we run several ETL’s ● Dashboard : Databricks scheduler jobs update dashboard
  • 16. 16PAGE // Druid ● Cube ● Time series ● Columnar DB ● Fast ● ThetaSketch ● load Data Stream / batch ● Great UI ● Complicated Deploy
  • 18. 18PAGE // Druid Usage ● Hourly - Stream ○ Segments are available once they are closed, we are using tranquility(kafka consumer) to create hourly segment. ● Daily - Batch ○ We are using batch (fire-house) to create daily segments from hourly segments (from start of day till now) ● Hourly Batch ○ We are using EMR with batch to fix missing hours due to streaming failure, to create hourly segments from S3
  • 19. 19PAGE // Druid Usage Hourly - Stream Daily - Batch Hourly - Batch (EMR)
  • 21. Flow We are using Twitter Anomaly detector https://github.com/twitter/AnomalyDetection we have scheduler process that query db, generate csv with data and time series, the csv file is the input for anomaly detection , send email incase of anomaly
  • 23. 23PAGE // Requirement Send Ad to 20 year old, male, from New-York... Data Types ● Regular DMP can provide information per user like if its male 20 years old , from New york that like sports and has car (Taxonomy). ● Internal DMP - InnerActive see cross publishers and demands , InnerActive monitor user ad experience such as which users clicks more, and on what, type of ad video user see till end... Data Collect and Merge ● 8T daily raw data needs to be aggregated to provide relevant information per user, and then merged with several DMP’s data.
  • 25. 25PAGE // Flow ● Spark batch generate hourly / daily / monthly aggregations per user from S3 (Kafka consumer upload data to S3) → 800M raws with InnerActive DMP data ● Data is merged with DMP data(align with taxonomy) ● Raws are ready to use and can be loaded to DB for analytic usage, and later on for audience selections throw the console. 1
  • 26. 26PAGE // Raw Data ● 120 columns with: ○ Dimensions: Age, Gender, Country ○ Metrics: #Clicks, #Impressions, #Video ● 20 columns with MultiValue Dimensions: ○ Domains: [CNN.com, Ebay.com] ○ Interests: [Sport, Shopping, Cars] ● Checking if DB support advanced feature for future requirements like Map: {#number of clicks per domain} in addition to total number of clicks that the user is doing 2
  • 27. 27PAGE // DB & Queries POC Requirement 3 ● 1-2 sec – queries over 400M users (not all queries took 2s) ● complex query but still avoid Join (multiValued / Map) ● Statistics functionality like HyperLogLog / ThetaSketch ● JDBC compliance ● Easy maintained ● Low Concurrency ● Scale Scale Scale ● Supported / Community ● Price estimation
  • 28. 28PAGE // DB - How we choosed 1. columnar database ● Minimize Read-write from disk: “select age,name from tbl where age >30” instead of reading all rows and return all columns, and select only 2 fields, columnar DB only reads data from 2 columns and return only 2 columns ● High compression 4
  • 29. 29PAGE // DB - How we choosed 2.MPP Data is big, needs to be split across machines to get result within ~2 sec 0.5-1T ● Massively Parallel Processing: ○ multiple processors working on different parts of the program. ○ Each processor has its own operating system and memory. ○ It speeds the performance of huge databases that deal with massive amounts of data. 4
  • 30. 30PAGE // DB - How we choosed 3.FAST In Memory DB Or OS Cache? Memory main layers RAM / In process memory like Java HashMap Operation System cache Disk: SSD or not Speed Prices ● In Memory ○ Row Data resides in a computer’s random access memory (RAM) – not physical disk ● OS Cache ○ Columnar/compressed data in Disk, execute query loads the data to the OS memory 4
  • 31. 31PAGE // ● we found out that it's faster (query time) to use columnar data that is loaded to OS cache, instead of row data in memory as it needs to read all data (we use random queries index will not help) ● Columnar compress data reduce storage size therefore it load more raw data to OS cache, disadvantage is that we pay more CPU time to decompress data per query DB - How we choosed 3.FAST In Memory DB Or OS Cache? 4
  • 32. 32PAGE // Let the Game Begin FS with OS cache IN-Memory
  • 34. 34PAGE // ClickHouse Jdbc compliance Very Fast FS Columnar DB (load data to OS memory) MultiValue Support - “IN” HyperLogLog Support Easy to Install + Scale Load CSV data Build for our use case No Support - Open source Community?
  • 35. 35PAGE // MemSql Commercial ○ Combination of Aggregator nodes that save data in memory as raw data, and Leaf nodes that save data in FS columnar ○ Increase Aggregators to better handle concurrency ○ Increase Leafs to minimize latency ○ We checked both options (raw data in memory, columnar data in FS)
  • 36. 36PAGE // MemSql Memory VS. Cache ■ Jdbc compliance ■ Very Fast ■ Columnar DB + Memory ■ MultiValue Support? Json search, we avoid Join ■ Easy to Install + Scale ■ Load CSV data ■ Support / commercial
  • 37. 37PAGE // RedShift ■ Jdbc compliance ■ Fast ■ Columnar DB + Memory ■ No MultiValue Support - you can use “like”, Join are not fast enough. ■ service ■ commercial ■ price high built upon postgress, save data in columnar , no index , scalable , each query run on its node (MPP)
  • 38. 38PAGE // Solr We tried Solr although its handling data differently, Solr index documents and allows very rich queries. Solr fits our complex queries requierments using its faceting navigation once you run queries the data is loaded to cache and it provide good query time we pay during loading/indexing data - time We didn't finished POC on Solr, as we decided to continue with another solution.
  • 40. 40PAGE // Presto How It Works ● Use connectors to Mysql / HDFS / Cassandra ● MPP shared nothing across machines ● Priority Queries ● Can load parquet (columnar compress format) - no need for Join ● Support Hive queries
  • 41. 41PAGE // Presto On Steroid ● Raptor is Presto connector (configuration) that load data to Presto machines (sharded on SSD) ● Instead of doing query to HDFS or S3 , it queries its local SSD while the second queries use OS cache ○ Short Load time (<1H) from remote HDFS to locals SSD (we also tried to use Presto on top of Alluxio, and hdfs & presto on same machine)
  • 42. 42PAGE // Presto + Raptor Load data Flow ● Create table using Hive (data located in hdfs cluster) ● Create table in Raptor ○ CREATE TABLE raptor.audienceTbl AS SELECT * FROM hive.default.audience; ● Load data with Raptor to Presto machines ○ update table raptorTbl as select from hiveTbl where day = <day> ● In case of raptor failure, we can continue using Presto to query hdfs via Hive, and in the meantime load hdfs data to raptor again.
  • 43. 43PAGE // Presto On Steroid ● Another option instead of Raptor is LLAP (Hive Cache)
  • 44. 44PAGE // Presto On Steroid ● Another option instead of Raptor is Presto Memory Connector (RAM) - we are going to test it
  • 46. 46PAGE // We didn't looked for the fastest DB in the world. We looked for valid solutions for our use case, and we checked functionality, price, etc … Some solutions failed in the functionality requirements like MariaDB (Columnar) Some due to high price (RedShift) We decided to continue with Presto + Raptor, we can use our parquet data as is, load it to HDFS, load it to Presto machines... And The Winner is
  • 48. 48PAGE // Serving flow ● Once we selected audiences, next phase is real time match audiences to adRequest ● We are using spark batch that create key-value mapping between userId and audiences, and we upload it to aerospike ● During adRequest flow we retrieve (~4ms) user audiences... Key-Value, scale - In memory KV Lots of reads , update once a day in batch
  • 49. MLib - next time