SlideShare a Scribd company logo
Radu Chilom
radu.chilom@gmail.com
In-memory data pipeline
and warehouse at scale
using Spark, Spark SQL,
Tachyon and Parquet
Buzzwords Berlin - 2015
Ema Iancuta
iorhian@gmail.com
‹#›
• Big data analytics / machine learning
• 6+ years with Hadoop ecosystem
• 2 years with Spark
• http://atigeo.com/
• A research group that focuses on the technical
problems that exist in the big data industry and
provides open source solutions
• http://bigdataresearch.io/
‹#›
• Intro
• Use Case
• Data pipeline with Spark
• Spark Job Rest Service
• Spark SQL Rest Service (Jaws)
• Parquet
• Tachyon
• Demo
Agenda
‹#›
• Build an in memory data pipeline for millions
financial transactions used downstream by
data scientists for detecting fraud
• Ingestion from S3 to our Tachyon/HDFS
cluster
• Data transformation
• Data warehouse
Use Case
‹#›
• “fast and general engine for large-scale
data processing”
• Built around the concept of RDD
• API for Java/Scala/Python (80 operators)
• powers a stack of high level tools including
Spark SQL, MLlib, Spark Streaming.
Apache Spark
‹#›
Public S3 Bucket: public-financial-transactions
public-financial-
transactions
(s3-bucket)
scheme scheme.csv
data input-0.csv
data2
input-1.csv
. . .
. . .
‹#›
• Download from S3
1. Ingestion
• Resolving the wildcards means listing files
metadata
• Listing the metadata for a large number
of files from external sources can take a
long time
‹#›
Listing the metadata (distributed)
Driver
Worker Worker Worker
folder1
folder2
folder3
folder4
folder5
folder6
folder1
folder2
folder3
folder4
folder5
folder6
file-11
file-12
file-21
file-22
file-23
file-31
file-32
file-41
file-42
file-43
file-44
file-51
file-52
file-61
‹#›
Listing the metadata (distributed)
• For fine tuning, specify the number of partitions
‹#›
• Unbalanced partitions
Download Files
‹#›
Unbalanced partitions
Partition 0
transactions.csv
Partition 1
input.csv
data.csv
values.csv
buzzwords.csv
buzzwords.txt
‹#›
Balancing partitions
Partition 0
(0, transactions.csv)
(2, data.csv)
(4, buzzwords.csv)
Partition 1
(1, input.csv)
(3, values.csv)
(5, buzzwords.txt)
‹#›
• Balancing partitions
Keep in mind that repartitioning your data is a
fairly expensive operation.
Balancing partitions
‹#›
• Data cleaning is the first step in any data
science project
• For this use-case:
- Remove lines that don't match the structure
- Remove “useless” columns
- Transform data to be in a consistent format
2. Data Transformation
‹#›
• Join
Find Country char code
Numeric Format Alpha 2 Format
276 DE
Name
Germany
• Problem with skew in the key distribution
‹#›
Metrics for Join
‹#›
• Broadcast Country Codes Map
Find Country char code
‹#›
Metrics
‹#›
Transformation with
Join vs Broadcasted Map
(skewed key)
Seconds
0
60
120
180
240
300
Rows
1 Million 2 Million 3 Million
Join Broadcasted Map
‹#›
• Supports multiple contexts
• Launches a new process for each Spark context
• Inter-process communication with Akka actors
• Easy context creation & job runs
• Supports Java and Scala code
• Friendly UI
Spark-Job-Rest
https://github.com/Atigeo/spark-job-rest
‹#›
• Hive
• Apache Pig
• Impala
• Presto
• Stinger (Hive on Tez)
• Spark SQL
Build a data warehouse
‹#›
Spark SQL
• Support for multiple
input formats
• Rich language interfaces
• RDD-aware optimizer
RDD
DataFrame / SchemaRDD
JDBC
HIVE QL SQL
‹#›
Creating a data frame
‹#›
Perform a simple query:
Explore data
> Directly on the data frame
> Registering a temporary table
- select
- filter
- join
- groupBy
- agg
- join
- count
- sort
- where ..etc.
‹#›
Creating a data warehouse
https://github.com/Atigeo/xpatterns-spark-parquet
‹#›
• TextFile
• SequenceFile
• RCFile (RowColumnar)
• ORCFile (OptimizedRowColumnar)
• Avro
• Parquet
File Formats
> columnar format
> good for aggregation queries
> only the required columns are read from disk
> nested data structures
> schema with the data
> spark sql supports schema evolution
> efficient compression
‹#›
Tachyon
• memory-centric distributed file system
enabling reliable file sharing at memory-speed
across cluster frameworks
• Pluggable underlayer file system: hdfs, S3,…
‹#›
Caching in Spark SQL
• Cache data in columnar format
• Automatically compression tune
‹#›
• spark context might crash
Spark cache vs Tachyon
• GC kicks in
• share data between different applications
‹#›
- Highly scalable and resilient data warehouse
- Submit queries concurrently and asynchronously
- Restful alternative to Spark SQL JDBC having a
interactive UI
- Since Spark 091 with Shark
- Support for Spark SQL and Hive - MR (and more to
come)
https://github.com/Atigeo/jaws-spark-sql-rest
Jaws spark sql rest
‹#›
- Akka actors to communicate through instances
- Support cancel queries
- Supports large results retrieval
- Parquet in memory warehouse
- returns persisted logs, results, query history
- provides a metadata browser
- configuration file to fine tune spark
Jaws main features
‹#›
https://github.com/big-data-research/in-memory-data-pipeline
Code available at
‹#›
Q & A
© 2013 Atigeo, LLC. All rights reserved. Atigeo and the xPatterns logo are trademarks of Atigeo. The information herein is for informational purposes only and represents the current view of Atigeo as of
the date of this presentation. Because Atigeo must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Atigeo, and Atigeo cannot guarantee the
accuracy of any information provided after the date of this presentation. ATIGEO MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

What's hot (20)

PDF
Writing Continuous Applications with Structured Streaming in PySpark
Databricks
 
PPTX
Getting started with SparkSQL - Desert Code Camp 2016
clairvoyantllc
 
PDF
The SparkSQL things you maybe confuse
vito jeng
 
PPTX
Apache Spark Fundamentals
Zahra Eskandari
 
PDF
Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...
Databricks
 
PPTX
Intro to Big Data Analytics using Apache Spark and Apache Zeppelin
Alex Zeltov
 
PDF
Lessons from the Field, Episode II: Applying Best Practices to Your Apache S...
Databricks
 
PDF
Optimizing Delta/Parquet Data Lakes for Apache Spark
Databricks
 
PPTX
Spark SQL
Caserta
 
PDF
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...
Spark Summit
 
PDF
Hadoop & Complex Systems Research
Dr. Mirko Kämpf
 
PDF
Apache Spark Based Reliable Data Ingestion in Datalake with Gagan Agrawal
Databricks
 
PPTX
Introduction to Apache Spark
Rahul Jain
 
PPTX
Building a Large Scale SEO/SEM Application with Apache Solr
Rahul Jain
 
PDF
Building a Dataset Search Engine with Spark and Elasticsearch: Spark Summit E...
Spark Summit
 
PPTX
Learn Apache Spark: A Comprehensive Guide
Whizlabs
 
PPTX
3 CityNetConf - sql+c#=u-sql
Łukasz Grala
 
PPTX
Case study of Rujhaan.com (A social news app )
Rahul Jain
 
PDF
SQL on Hadoop in Taiwan
Treasure Data, Inc.
 
PDF
Performance of Spark vs MapReduce
Edureka!
 
Writing Continuous Applications with Structured Streaming in PySpark
Databricks
 
Getting started with SparkSQL - Desert Code Camp 2016
clairvoyantllc
 
The SparkSQL things you maybe confuse
vito jeng
 
Apache Spark Fundamentals
Zahra Eskandari
 
Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...
Databricks
 
Intro to Big Data Analytics using Apache Spark and Apache Zeppelin
Alex Zeltov
 
Lessons from the Field, Episode II: Applying Best Practices to Your Apache S...
Databricks
 
Optimizing Delta/Parquet Data Lakes for Apache Spark
Databricks
 
Spark SQL
Caserta
 
What No One Tells You About Writing a Streaming App: Spark Summit East talk b...
Spark Summit
 
Hadoop & Complex Systems Research
Dr. Mirko Kämpf
 
Apache Spark Based Reliable Data Ingestion in Datalake with Gagan Agrawal
Databricks
 
Introduction to Apache Spark
Rahul Jain
 
Building a Large Scale SEO/SEM Application with Apache Solr
Rahul Jain
 
Building a Dataset Search Engine with Spark and Elasticsearch: Spark Summit E...
Spark Summit
 
Learn Apache Spark: A Comprehensive Guide
Whizlabs
 
3 CityNetConf - sql+c#=u-sql
Łukasz Grala
 
Case study of Rujhaan.com (A social news app )
Rahul Jain
 
SQL on Hadoop in Taiwan
Treasure Data, Inc.
 
Performance of Spark vs MapReduce
Edureka!
 

Similar to In Memory Data Pipeline And Warehouse At Scale - BerlinBuzzwords 2015 (20)

PDF
Big Telco Real-Time Network Analytics
Yousun Jeong
 
PDF
Big Telco - Yousun Jeong
Spark Summit
 
PPTX
xPatterns - Spark Summit 2014
Claudiu Barbura
 
PPTX
Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...
Michael Rys
 
PDF
Apache Spark Presentation good for big data
kijekormu1
 
PPTX
Teaching Apache Spark: Demonstrations on the Databricks Cloud Platform
Yao Yao
 
PPTX
xPatterns on Spark, Shark, Mesos, Tachyon
Claudiu Barbura
 
PDF
Understanding Query Plans and Spark UIs
Databricks
 
PDF
Spark Saturday: Spark SQL & DataFrame Workshop with Apache Spark 2.3
Databricks
 
PDF
Spark + AI Summit 2020 イベント概要
Paulo Gutierrez
 
PDF
Databricks Meetup @ Los Angeles Apache Spark User Group
Paco Nathan
 
PPTX
.NET for Azure Synapse (and viceversa)
Marco Parenzan
 
PPTX
Apache Spark in Scientific Applications
Dr. Mirko Kämpf
 
PPTX
Apache Spark in Scientific Applciations
Dr. Mirko Kämpf
 
PPTX
Azure Databricks - An Introduction 2019 Roadshow.pptx
pascalsegoul
 
PDF
Build Deep Learning Applications for Big Data Platforms (CVPR 2018 tutorial)
Jason Dai
 
PPTX
Jump Start with Apache Spark 2.0 on Databricks
Databricks
 
PPTX
Processing Large Data with Apache Spark -- HasGeek
Venkata Naga Ravi
 
PDF
Apache Spark for Everyone - Women Who Code Workshop
Amanda Casari
 
PDF
What to Expect for Big Data and Apache Spark in 2017
Databricks
 
Big Telco Real-Time Network Analytics
Yousun Jeong
 
Big Telco - Yousun Jeong
Spark Summit
 
xPatterns - Spark Summit 2014
Claudiu Barbura
 
Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...
Michael Rys
 
Apache Spark Presentation good for big data
kijekormu1
 
Teaching Apache Spark: Demonstrations on the Databricks Cloud Platform
Yao Yao
 
xPatterns on Spark, Shark, Mesos, Tachyon
Claudiu Barbura
 
Understanding Query Plans and Spark UIs
Databricks
 
Spark Saturday: Spark SQL & DataFrame Workshop with Apache Spark 2.3
Databricks
 
Spark + AI Summit 2020 イベント概要
Paulo Gutierrez
 
Databricks Meetup @ Los Angeles Apache Spark User Group
Paco Nathan
 
.NET for Azure Synapse (and viceversa)
Marco Parenzan
 
Apache Spark in Scientific Applications
Dr. Mirko Kämpf
 
Apache Spark in Scientific Applciations
Dr. Mirko Kämpf
 
Azure Databricks - An Introduction 2019 Roadshow.pptx
pascalsegoul
 
Build Deep Learning Applications for Big Data Platforms (CVPR 2018 tutorial)
Jason Dai
 
Jump Start with Apache Spark 2.0 on Databricks
Databricks
 
Processing Large Data with Apache Spark -- HasGeek
Venkata Naga Ravi
 
Apache Spark for Everyone - Women Who Code Workshop
Amanda Casari
 
What to Expect for Big Data and Apache Spark in 2017
Databricks
 
Ad

Recently uploaded (20)

PPTX
UVA-Ortho-PPT-Final-1.pptx Data analytics relevant to the top
chinnusindhu1
 
PPTX
lecture 13 mind test academy it skills.pptx
ggesjmrasoolpark
 
PPTX
HSE WEEKLY REPORT for dummies and lazzzzy.pptx
ahmedibrahim691723
 
PDF
McKinsey - Global Energy Perspective 2023_11.pdf
niyudha
 
PDF
SUMMER INTERNSHIP REPORT[1] (AutoRecovered) (6) (1).pdf
pandeydiksha814
 
PPTX
White Blue Simple Modern Enhancing Sales Strategy Presentation_20250724_21093...
RamNeymarjr
 
PPT
From Vision to Reality: The Digital India Revolution
Harsh Bharvadiya
 
PDF
apidays Munich 2025 - Developer Portals, API Catalogs, and Marketplaces, Miri...
apidays
 
PDF
An Uncut Conversation With Grok | PDF Document
Mike Hydes
 
PPTX
Probability systematic sampling methods.pptx
PrakashRajput19
 
PPTX
Data-Users-in-Database-Management-Systems (1).pptx
dharmik832021
 
PPTX
Introduction-to-Python-Programming-Language (1).pptx
dhyeysapariya
 
PPT
Real Life Application of Set theory, Relations and Functions
manavparmar205
 
PPTX
Data Security Breach: Immediate Action Plan
varmabhuvan266
 
PPTX
M1-T1.pptxM1-T1.pptxM1-T1.pptxM1-T1.pptx
teodoroferiarevanojr
 
PDF
apidays Munich 2025 - Integrate Your APIs into the New AI Marketplace, Senthi...
apidays
 
PPTX
The whitetiger novel review for collegeassignment.pptx
DhruvPatel754154
 
PPTX
Fluvial_Civilizations_Presentation (1).pptx
alisslovemendoza7
 
PPTX
Nursing Shift Supervisor 24/7 in a week .pptx
amjadtanveer
 
PPTX
MR and reffffffvvvvvvvfversal_083605.pptx
manjeshjain
 
UVA-Ortho-PPT-Final-1.pptx Data analytics relevant to the top
chinnusindhu1
 
lecture 13 mind test academy it skills.pptx
ggesjmrasoolpark
 
HSE WEEKLY REPORT for dummies and lazzzzy.pptx
ahmedibrahim691723
 
McKinsey - Global Energy Perspective 2023_11.pdf
niyudha
 
SUMMER INTERNSHIP REPORT[1] (AutoRecovered) (6) (1).pdf
pandeydiksha814
 
White Blue Simple Modern Enhancing Sales Strategy Presentation_20250724_21093...
RamNeymarjr
 
From Vision to Reality: The Digital India Revolution
Harsh Bharvadiya
 
apidays Munich 2025 - Developer Portals, API Catalogs, and Marketplaces, Miri...
apidays
 
An Uncut Conversation With Grok | PDF Document
Mike Hydes
 
Probability systematic sampling methods.pptx
PrakashRajput19
 
Data-Users-in-Database-Management-Systems (1).pptx
dharmik832021
 
Introduction-to-Python-Programming-Language (1).pptx
dhyeysapariya
 
Real Life Application of Set theory, Relations and Functions
manavparmar205
 
Data Security Breach: Immediate Action Plan
varmabhuvan266
 
M1-T1.pptxM1-T1.pptxM1-T1.pptxM1-T1.pptx
teodoroferiarevanojr
 
apidays Munich 2025 - Integrate Your APIs into the New AI Marketplace, Senthi...
apidays
 
The whitetiger novel review for collegeassignment.pptx
DhruvPatel754154
 
Fluvial_Civilizations_Presentation (1).pptx
alisslovemendoza7
 
Nursing Shift Supervisor 24/7 in a week .pptx
amjadtanveer
 
MR and reffffffvvvvvvvfversal_083605.pptx
manjeshjain
 
Ad

In Memory Data Pipeline And Warehouse At Scale - BerlinBuzzwords 2015

  • 1. Radu Chilom [email protected] In-memory data pipeline and warehouse at scale using Spark, Spark SQL, Tachyon and Parquet Buzzwords Berlin - 2015 Ema Iancuta [email protected]
  • 2. ‹#› • Big data analytics / machine learning • 6+ years with Hadoop ecosystem • 2 years with Spark • http://atigeo.com/ • A research group that focuses on the technical problems that exist in the big data industry and provides open source solutions • http://bigdataresearch.io/
  • 3. ‹#› • Intro • Use Case • Data pipeline with Spark • Spark Job Rest Service • Spark SQL Rest Service (Jaws) • Parquet • Tachyon • Demo Agenda
  • 4. ‹#› • Build an in memory data pipeline for millions financial transactions used downstream by data scientists for detecting fraud • Ingestion from S3 to our Tachyon/HDFS cluster • Data transformation • Data warehouse Use Case
  • 5. ‹#› • “fast and general engine for large-scale data processing” • Built around the concept of RDD • API for Java/Scala/Python (80 operators) • powers a stack of high level tools including Spark SQL, MLlib, Spark Streaming. Apache Spark
  • 6. ‹#› Public S3 Bucket: public-financial-transactions public-financial- transactions (s3-bucket) scheme scheme.csv data input-0.csv data2 input-1.csv . . . . . .
  • 7. ‹#› • Download from S3 1. Ingestion • Resolving the wildcards means listing files metadata • Listing the metadata for a large number of files from external sources can take a long time
  • 8. ‹#› Listing the metadata (distributed) Driver Worker Worker Worker folder1 folder2 folder3 folder4 folder5 folder6 folder1 folder2 folder3 folder4 folder5 folder6 file-11 file-12 file-21 file-22 file-23 file-31 file-32 file-41 file-42 file-43 file-44 file-51 file-52 file-61
  • 9. ‹#› Listing the metadata (distributed) • For fine tuning, specify the number of partitions
  • 11. ‹#› Unbalanced partitions Partition 0 transactions.csv Partition 1 input.csv data.csv values.csv buzzwords.csv buzzwords.txt
  • 12. ‹#› Balancing partitions Partition 0 (0, transactions.csv) (2, data.csv) (4, buzzwords.csv) Partition 1 (1, input.csv) (3, values.csv) (5, buzzwords.txt)
  • 13. ‹#› • Balancing partitions Keep in mind that repartitioning your data is a fairly expensive operation. Balancing partitions
  • 14. ‹#› • Data cleaning is the first step in any data science project • For this use-case: - Remove lines that don't match the structure - Remove “useless” columns - Transform data to be in a consistent format 2. Data Transformation
  • 15. ‹#› • Join Find Country char code Numeric Format Alpha 2 Format 276 DE Name Germany • Problem with skew in the key distribution
  • 17. ‹#› • Broadcast Country Codes Map Find Country char code
  • 19. ‹#› Transformation with Join vs Broadcasted Map (skewed key) Seconds 0 60 120 180 240 300 Rows 1 Million 2 Million 3 Million Join Broadcasted Map
  • 20. ‹#› • Supports multiple contexts • Launches a new process for each Spark context • Inter-process communication with Akka actors • Easy context creation & job runs • Supports Java and Scala code • Friendly UI Spark-Job-Rest https://github.com/Atigeo/spark-job-rest
  • 21. ‹#› • Hive • Apache Pig • Impala • Presto • Stinger (Hive on Tez) • Spark SQL Build a data warehouse
  • 22. ‹#› Spark SQL • Support for multiple input formats • Rich language interfaces • RDD-aware optimizer RDD DataFrame / SchemaRDD JDBC HIVE QL SQL
  • 24. ‹#› Perform a simple query: Explore data > Directly on the data frame > Registering a temporary table - select - filter - join - groupBy - agg - join - count - sort - where ..etc.
  • 25. ‹#› Creating a data warehouse https://github.com/Atigeo/xpatterns-spark-parquet
  • 26. ‹#› • TextFile • SequenceFile • RCFile (RowColumnar) • ORCFile (OptimizedRowColumnar) • Avro • Parquet File Formats > columnar format > good for aggregation queries > only the required columns are read from disk > nested data structures > schema with the data > spark sql supports schema evolution > efficient compression
  • 27. ‹#› Tachyon • memory-centric distributed file system enabling reliable file sharing at memory-speed across cluster frameworks • Pluggable underlayer file system: hdfs, S3,…
  • 28. ‹#› Caching in Spark SQL • Cache data in columnar format • Automatically compression tune
  • 29. ‹#› • spark context might crash Spark cache vs Tachyon • GC kicks in • share data between different applications
  • 30. ‹#› - Highly scalable and resilient data warehouse - Submit queries concurrently and asynchronously - Restful alternative to Spark SQL JDBC having a interactive UI - Since Spark 091 with Shark - Support for Spark SQL and Hive - MR (and more to come) https://github.com/Atigeo/jaws-spark-sql-rest Jaws spark sql rest
  • 31. ‹#› - Akka actors to communicate through instances - Support cancel queries - Supports large results retrieval - Parquet in memory warehouse - returns persisted logs, results, query history - provides a metadata browser - configuration file to fine tune spark Jaws main features
  • 34. © 2013 Atigeo, LLC. All rights reserved. Atigeo and the xPatterns logo are trademarks of Atigeo. The information herein is for informational purposes only and represents the current view of Atigeo as of the date of this presentation. Because Atigeo must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Atigeo, and Atigeo cannot guarantee the accuracy of any information provided after the date of this presentation. ATIGEO MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.