SlideShare a Scribd company logo
1 of 52
Impala internals
By David Gruzman
BigDataCraft.com
Impala
by David Gruzman
►Impala is
– Relational Query Engine
– Open source
– Massive parallel processing
Why do we care, about internals?
► SQL is declarative, no need for internals...
► In the same time, even small problems in
engine operation require good understanding of
its work principles to fix...
► It is hardly possible to optimize without
understanding algorithms under the hood.
► It is hard to make decisions about engine
suitability to future needs without knowing
technical limitations.
Engine parts
How to understand engine?
What it is doing?
Main principle of operation
Main building block
Operation sequence
Operation environment
Efficiency
Design decisions
Materials
Main problems and fixes
What it is doing
Impala is Relation engine. It executes SQL
queries.
Data is append-able only. There is no “Update” or
“Delete” statements.
Principle of operation
Main differentiators are:
Distribution of Query among nodes (MPP)
LLVM and Code generation. Impala is compiler.
Relay on HDFS
Use external metadata – hive metastore.
Parallel query capability (per node, per cluster).
Sequence of operation
Query parsing – translate SQL to AST(Abstract
syntax tree)
Match objects to metadata
Query planning – create physical execution plan.
In case of MPP – divide plan into plan fragments
for nodes.
Distribute plan fragments to nodes
Execute plan fragments.
Main building blocks
Front End. This is Java code which implements a
lot of logic with non-critical performance
- database objects
fe/src/main/java/com/cloudera/impala/analysis/
- execution plan parts :
fe/src/main/java/com/cloudera/impala/planner/
BackEnd (Be)
Backend is written on C++, and used mostly for
performance critical parts. Specifically:
- Execution of the plan fragments on nodes
- Services implementation
ImpalaD service
StateStore
Catalog Service
Services - ImpalaD
This is “main” service of impala which runs on
each node. It logically consists of the following
sub-services of our interest.
ImpalaService – service, used to execute query.
Console, JDBC/ODBC connects here.
ImpalaInternalService – service is used to
coordinate work within the impala cluster.
Example of usage – to coordinate the job of
running query fragments on planned impala
nodes.
What is interesting for us? Each node can serve
Dual role of ImpalaD service
Query coordinator
Fragment executor
Services view
Front End
Impala
Service
Impala Internal
Service
ImpalaService – main methods
inherited from beeswax :
ExecuteAndWait
Fetch
Explain
Impala specific :
ResetCatalog
GetRuntimeProfile
ImpalaInternalService – main
methods
ExecPlanFragment
ReportExecStatus
CancelPlanFragment
TransmitData
Services - StateStore
In many clusters we have to solve “cluster
synchronization” problem on some or other way.
In impala it is solved by StateStore –
published/subscriber service, similar to
Zookeeper. Why Zookeeper is not used?
It speaks with its clients in terms of topics. Clients
can subscribe to different topics. So to find
“endpoints” - look in the sources for the usage of
“StatestoreSubscriber”
StateStore – main topics
IMPALA_MEMBERSHIP_TOPIC – updates about
attached and detached nodes.
IMPALA_CATALOG_TOPIC – updates about
metadata changes.
IMPALA_REQUEST_QUEUE_TOPIC – updates
in the queue of waiting queries.
Admission control
There is module called AdmissionController.
Via topic impala-request-queue it is know about
queries currently running and their basic
statistics like memory and CPU consumption.
Based on this info it can decide to:
-run query
-queue query
-reject query
Catalog Service
It caches in Java code metadata from hive
metastore:
/fe/src/main/java/com/cloudera/impala/catalog/
It is important since Hive's native partition pruning
is slow especially with large number of
partitions.
It use C++ code be/src/catalog/
To relay changes (delta's) to other nodes via
StateStore.
Differance with hive
Catalog Service store in memory and operate on
metadata, leaving MetaStore for persistance
only.
Technically it mean that disconnection from
MetaStore is not that complicated.
ImpalaInternalService - details
This is place where the real heavy lifting takes
place.
Before diving in, what we want to understand
here:
Threading model
File System interface
Predicate pushdown
Resource management
Threading model
DiskIoMgr schedules access of all readers to all
disks. It should include predicates.
It can give optimal concurrency. Sounds coherent
to the Intel TBB / Java Executor service
approach: give me small tasks and I will
schedule them.
The rest of operations – like Joins, Group By looks
like single threaded in current version.
IMHO – sort joins and group by are better for
concurrency.
File System interface
Impala is working via LibHDFS – so HDFS (not
DFS) is hard coded.
Impala required and checked that short circuit is
enabled.
During planning phase names of the block files to
be scanned are determined.
Main “database” algorithm
It is interesting to see, how main operations are
implemented, what options do we have:
Group By,
Order By (Sort),
Join
Join
Join is probably most powerful and performance
critical part of any analytical RDBMS.
Impala implements BroadCastJoin and
GraceHashJoin.(be/src/exec/partitioned-hash-join-
node.h). Both are kinds of Hash Join.
Basic idea of GraceHashJoin is to partition data,
and load in memory corresponding partitions of
the tables for the join.
DiskMemory
Part 2 Part 3 Part 4Part 1 Part 5
Part 2 Part 3 Part 4Part 1 Part 5
Part 2 Part 3 Part 4Part 1 Part 5Part 3 Part 4 Part 5
In-memory hash join
DiskMemory
Part 3 Part 4
Part 3 Part 4 Part 5
Part 5
BroadCast join
Just send small table to all nodes and join with big
one.
It is very similar to Map Side join in Hive.
Selection of join algorithm can be hinted.
Group by
There are two main approaches – using dictionary
or sorting.
Aggregation can be subject to memory problems
with too many groups.
Impala is using Partitioned Hash join which can
spill to disk using BufferedBlockManager.
It is somewhat analogous to join implementation.
User defined functions
Impala supports two kinds of UDF / UDAF
- Native, written in C/C++
- Hive's UDF written in java.
Caching
Impala does not cache data by itself.
It delegates it to the new HDFS caching capability.
In a nutshell – HDFS is capable to keep given
directory in memory.
Zero copy access via MMAP is implemented.
Why it is better then buffer cache?
Less task switching
No CRC Check
Spill to Disk
In order to be reliable, especially in face of Data
Skews, some sort of spilling data to disk is
needed.
Impala approach this problem with introduction of
BufferedBlockMgr
It implements mechanism somewhat similar to
virtual memory – pin, unpin blocks, persist them.
It can use many disks to distribute load.
It is used in all places where memory can be not
sufficient
Why not Virtual Memory?
Some databases offload all buffer management to
the OS Virtual Memory. Most popular example:
MongoDB.
Impala create BufferedBlockManager per
PlanFragment.
It gives control how much memory consumed by
single query on given node.
We can summarize answer as : better resource
management.
BufferedBlockMgr usage
Partitioned join
Sorting
Buffered Tuple Stream
Partitioned aggregation
Memory Management
Impala BE has its own MemPool class for memory
allocation.
It is used across the board by runtime primitives
and plan nodes.
Why own Runtime?
Impala has implemented own runtime – memory
management, virtual memory?
IMHO Existing runtime (both Posix, and C++
runtime) are not multi-tenant. It is hard to track
and limit resource usage by different requests in
the same process.
To solve this problem Impala has its own runtime
with tracking and limiting capabilities.
YARN integration
When Impala run as part of the Hadoop stack
resource sharing is important question...
Two main options are
- Just divide resources between Impala and Yarn
using cgroups.
- Use YARN for the resource management.
Yarn Impala Impedance
YARN is built to schedule batch processing.
Impala is aimed to sub-second queries.
Running application master per query does not
sounds “low latency”.
Requesting resources “as execution go” does not
suit pipeline execution of query fragments.
L..LAMA ?
LLAMA
Low Latency Application Master
Or
Long Living Application Master
It enable low latency requests by living longer –
for a whole application lifetime.
How LLAMA works
1. There is single LLAMA daemon to broker
resources between Impala and YARN
2. Impala ask for all resources at once - “gang
scheduling”
3. LLAMA cache resources before return them to
YARN.
Important point
Impala is capable of:
- Run real time queries In YARN environment
- Ask for more resources (especially memory)
when needed.
Main drawbacks:
Impala implements own resource management among concurrent
queries, thus partially duplicating YARN functionality.
Possible deadlocks between two YARN applications.
Find 10 similarities
What is source of similarity
With all the difference, they solve similar problem:
How to survive in Africa...
O, sorry,
How to run and coordinate number of tasks in the
cluster.
Hadoop parallels
QueryPlanner – Developer or Hive. Somebody
who create job.
Coordinator, ImpalaServer – Job Tracker
PlanFragment – Task. (map or reduce)
ImpalaInternalService – TaskTracker
RequestPoolService+Scheduler+AdmissionContr
oller = Hadoop job Scheduler.
StateStore – Zookeeper.
ImpalaToGo
While being a perfect product Impala is chained to
the hadoop stack
- HDFS
- Management
Why it is a the problem?
HDFS is perfect to store vast amounts of data.
HDFS is built from large inexpensive SATA drives.
For the interactive analytics we want fast storage.
We can not afford FLASH drives for whole big
data.
What is solution
We can create another hadoop cluster on flash
storage.
Minus – another namenode to manage, replication
will waste space.
If replication factor is one – any problems should
be manually repaired.
Cache Layer in place of DFS
HDFS/Hadoop cluster
ImpalaToGo cluster
Data caching (LRU)
Auto load
Elasticity
Having cache layer in place of distributed file
system it is much easier to resize cluster.
ImpalaToGo is used consistent hashing for its data
placement – to minimize impact on resize.
Who we are?
Group of like minded developers, working on
making Impala even greater.
Thank you!!!
Please ask questions!

More Related Content

What's hot

ORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big DataORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big DataDataWorks Summit
 
Apache Hudi: The Path Forward
Apache Hudi: The Path ForwardApache Hudi: The Path Forward
Apache Hudi: The Path ForwardAlluxio, Inc.
 
Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive

Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive

Cloudera, Inc.
 
Transactional operations in Apache Hive: present and future
Transactional operations in Apache Hive: present and futureTransactional operations in Apache Hive: present and future
Transactional operations in Apache Hive: present and futureDataWorks Summit
 
Transactional SQL in Apache Hive
Transactional SQL in Apache HiveTransactional SQL in Apache Hive
Transactional SQL in Apache HiveDataWorks Summit
 
LLAP: long-lived execution in Hive
LLAP: long-lived execution in HiveLLAP: long-lived execution in Hive
LLAP: long-lived execution in HiveDataWorks Summit
 
Introducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorIntroducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorFlink Forward
 
How to build a streaming Lakehouse with Flink, Kafka, and Hudi
How to build a streaming Lakehouse with Flink, Kafka, and HudiHow to build a streaming Lakehouse with Flink, Kafka, and Hudi
How to build a streaming Lakehouse with Flink, Kafka, and HudiFlink Forward
 
Druid: Sub-Second OLAP queries over Petabytes of Streaming Data
Druid: Sub-Second OLAP queries over Petabytes of Streaming DataDruid: Sub-Second OLAP queries over Petabytes of Streaming Data
Druid: Sub-Second OLAP queries over Petabytes of Streaming DataDataWorks Summit
 
HBase Advanced - Lars George
HBase Advanced - Lars GeorgeHBase Advanced - Lars George
HBase Advanced - Lars GeorgeJAX London
 
Local Secondary Indexes in Apache Phoenix
Local Secondary Indexes in Apache PhoenixLocal Secondary Indexes in Apache Phoenix
Local Secondary Indexes in Apache PhoenixRajeshbabu Chintaguntla
 
CDC Stream Processing with Apache Flink
CDC Stream Processing with Apache FlinkCDC Stream Processing with Apache Flink
CDC Stream Processing with Apache FlinkTimo Walther
 
All about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAll about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAltinity Ltd
 
Diving into Delta Lake: Unpacking the Transaction Log
Diving into Delta Lake: Unpacking the Transaction LogDiving into Delta Lake: Unpacking the Transaction Log
Diving into Delta Lake: Unpacking the Transaction LogDatabricks
 
A Day in the Life of a ClickHouse Query Webinar Slides
A Day in the Life of a ClickHouse Query Webinar Slides A Day in the Life of a ClickHouse Query Webinar Slides
A Day in the Life of a ClickHouse Query Webinar Slides Altinity Ltd
 

What's hot (20)

ORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big DataORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big Data
 
Apache Hudi: The Path Forward
Apache Hudi: The Path ForwardApache Hudi: The Path Forward
Apache Hudi: The Path Forward
 
Fig 9-02
Fig 9-02Fig 9-02
Fig 9-02
 
Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive

Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive


 
Apache Phoenix + Apache HBase
Apache Phoenix + Apache HBaseApache Phoenix + Apache HBase
Apache Phoenix + Apache HBase
 
Transactional operations in Apache Hive: present and future
Transactional operations in Apache Hive: present and futureTransactional operations in Apache Hive: present and future
Transactional operations in Apache Hive: present and future
 
Transactional SQL in Apache Hive
Transactional SQL in Apache HiveTransactional SQL in Apache Hive
Transactional SQL in Apache Hive
 
Scaling HBase for Big Data
Scaling HBase for Big DataScaling HBase for Big Data
Scaling HBase for Big Data
 
LLAP: long-lived execution in Hive
LLAP: long-lived execution in HiveLLAP: long-lived execution in Hive
LLAP: long-lived execution in Hive
 
Introducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorIntroducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes Operator
 
How to build a streaming Lakehouse with Flink, Kafka, and Hudi
How to build a streaming Lakehouse with Flink, Kafka, and HudiHow to build a streaming Lakehouse with Flink, Kafka, and Hudi
How to build a streaming Lakehouse with Flink, Kafka, and Hudi
 
Druid: Sub-Second OLAP queries over Petabytes of Streaming Data
Druid: Sub-Second OLAP queries over Petabytes of Streaming DataDruid: Sub-Second OLAP queries over Petabytes of Streaming Data
Druid: Sub-Second OLAP queries over Petabytes of Streaming Data
 
HBase Advanced - Lars George
HBase Advanced - Lars GeorgeHBase Advanced - Lars George
HBase Advanced - Lars George
 
HBase Storage Internals
HBase Storage InternalsHBase Storage Internals
HBase Storage Internals
 
Local Secondary Indexes in Apache Phoenix
Local Secondary Indexes in Apache PhoenixLocal Secondary Indexes in Apache Phoenix
Local Secondary Indexes in Apache Phoenix
 
CDC Stream Processing with Apache Flink
CDC Stream Processing with Apache FlinkCDC Stream Processing with Apache Flink
CDC Stream Processing with Apache Flink
 
All about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAll about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdf
 
Diving into Delta Lake: Unpacking the Transaction Log
Diving into Delta Lake: Unpacking the Transaction LogDiving into Delta Lake: Unpacking the Transaction Log
Diving into Delta Lake: Unpacking the Transaction Log
 
AWR Sample Report
AWR Sample ReportAWR Sample Report
AWR Sample Report
 
A Day in the Life of a ClickHouse Query Webinar Slides
A Day in the Life of a ClickHouse Query Webinar Slides A Day in the Life of a ClickHouse Query Webinar Slides
A Day in the Life of a ClickHouse Query Webinar Slides
 

Viewers also liked

Cloudera Impala technical deep dive
Cloudera Impala technical deep diveCloudera Impala technical deep dive
Cloudera Impala technical deep divehuguk
 
Impala Architecture presentation
Impala Architecture presentationImpala Architecture presentation
Impala Architecture presentationhadooparchbook
 
Impala 2.0 - The Best Analytic Database for Hadoop
Impala 2.0 - The Best Analytic Database for HadoopImpala 2.0 - The Best Analytic Database for Hadoop
Impala 2.0 - The Best Analytic Database for HadoopCloudera, Inc.
 
Impala Resource Management - OUTDATED
Impala Resource Management - OUTDATEDImpala Resource Management - OUTDATED
Impala Resource Management - OUTDATEDMatthew Jacobs
 
ImpalaToGo introduction
ImpalaToGo introductionImpalaToGo introduction
ImpalaToGo introductionDavid Groozman
 
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...VMware Tanzu
 
Kudu: Resolving Transactional and Analytic Trade-offs in Hadoop
Kudu: Resolving Transactional and Analytic Trade-offs in HadoopKudu: Resolving Transactional and Analytic Trade-offs in Hadoop
Kudu: Resolving Transactional and Analytic Trade-offs in Hadoopjdcryans
 
Keep your hadoop cluster at its best! v4
Keep your hadoop cluster at its best! v4Keep your hadoop cluster at its best! v4
Keep your hadoop cluster at its best! v4Chris Nauroth
 
(Aaron myers) hdfs impala
(Aaron myers)   hdfs impala(Aaron myers)   hdfs impala
(Aaron myers) hdfs impalaNAVER D2
 
Real-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using ImpalaReal-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using ImpalaJason Shih
 
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...Cloudera, Inc.
 
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache HadoopCloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache HadoopCloudera, Inc.
 
Hadoop & cloud storage object store integration in production (final)
Hadoop & cloud storage  object store integration in production (final)Hadoop & cloud storage  object store integration in production (final)
Hadoop & cloud storage object store integration in production (final)Chris Nauroth
 
SecPod: A Framework for Virtualization-based Security Systems
SecPod: A Framework for Virtualization-based Security SystemsSecPod: A Framework for Virtualization-based Security Systems
SecPod: A Framework for Virtualization-based Security SystemsYue Chen
 
Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Camuel Gilyadov
 
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...Cloudera, Inc.
 

Viewers also liked (20)

The Impala Cookbook
The Impala CookbookThe Impala Cookbook
The Impala Cookbook
 
Cloudera Impala technical deep dive
Cloudera Impala technical deep diveCloudera Impala technical deep dive
Cloudera Impala technical deep dive
 
Impala Architecture presentation
Impala Architecture presentationImpala Architecture presentation
Impala Architecture presentation
 
ImpalaToGo use case
ImpalaToGo use caseImpalaToGo use case
ImpalaToGo use case
 
Impala 2.0 - The Best Analytic Database for Hadoop
Impala 2.0 - The Best Analytic Database for HadoopImpala 2.0 - The Best Analytic Database for Hadoop
Impala 2.0 - The Best Analytic Database for Hadoop
 
Impala Resource Management - OUTDATED
Impala Resource Management - OUTDATEDImpala Resource Management - OUTDATED
Impala Resource Management - OUTDATED
 
ImpalaToGo introduction
ImpalaToGo introductionImpalaToGo introduction
ImpalaToGo introduction
 
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
 
Kudu: Resolving Transactional and Analytic Trade-offs in Hadoop
Kudu: Resolving Transactional and Analytic Trade-offs in HadoopKudu: Resolving Transactional and Analytic Trade-offs in Hadoop
Kudu: Resolving Transactional and Analytic Trade-offs in Hadoop
 
Keep your hadoop cluster at its best! v4
Keep your hadoop cluster at its best! v4Keep your hadoop cluster at its best! v4
Keep your hadoop cluster at its best! v4
 
(Aaron myers) hdfs impala
(Aaron myers)   hdfs impala(Aaron myers)   hdfs impala
(Aaron myers) hdfs impala
 
Real-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using ImpalaReal-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using Impala
 
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
Friction-free ETL: Automating data transformation with Impala | Strata + Hado...
 
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache HadoopCloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
 
Incredible Impala
Incredible Impala Incredible Impala
Incredible Impala
 
Hadoop & cloud storage object store integration in production (final)
Hadoop & cloud storage  object store integration in production (final)Hadoop & cloud storage  object store integration in production (final)
Hadoop & cloud storage object store integration in production (final)
 
SecPod: A Framework for Virtualization-based Security Systems
SecPod: A Framework for Virtualization-based Security SystemsSecPod: A Framework for Virtualization-based Security Systems
SecPod: A Framework for Virtualization-based Security Systems
 
Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
 
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
 

Similar to Cloudera Impala Internals

Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesJon Meredith
 
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010Yahoo Developer Network
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability ConsiderationsNavid Malek
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practiceswebuploader
 
Impala presentation ahad rana
Impala presentation ahad ranaImpala presentation ahad rana
Impala presentation ahad ranaData Con LA
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Baruch Sadogursky
 
HPC and HPGPU Cluster Tutorial
HPC and HPGPU Cluster TutorialHPC and HPGPU Cluster Tutorial
HPC and HPGPU Cluster TutorialDirk Hähnel
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceTim Ellison
 
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingNear Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingDibyendu Bhattacharya
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupesh Bansal
 
data stage-material
data stage-materialdata stage-material
data stage-materialRajesh Kv
 
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYCScalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYCCal Henderson
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Bhupesh Bansal
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop User Group
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareIndicThreads
 
Architecting and productionising data science applications at scale
Architecting and productionising data science applications at scaleArchitecting and productionising data science applications at scale
Architecting and productionising data science applications at scalesamthemonad
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Archroyans
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Archguest18a0f1
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Archmclee
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave databaseWipro
 

Similar to Cloudera Impala Internals (20)

Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
 
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
Data Applications and Infrastructure at LinkedIn__HadoopSummit2010
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
 
Impala presentation ahad rana
Impala presentation ahad ranaImpala presentation ahad rana
Impala presentation ahad rana
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
 
HPC and HPGPU Cluster Tutorial
HPC and HPGPU Cluster TutorialHPC and HPGPU Cluster Tutorial
HPC and HPGPU Cluster Tutorial
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
 
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingNear Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
 
data stage-material
data stage-materialdata stage-material
data stage-material
 
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYCScalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardware
 
Architecting and productionising data science applications at scale
Architecting and productionising data science applications at scaleArchitecting and productionising data science applications at scale
Architecting and productionising data science applications at scale
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave database
 

Recently uploaded

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

Cloudera Impala Internals

  • 1. Impala internals By David Gruzman BigDataCraft.com
  • 2.
  • 3. Impala by David Gruzman ►Impala is – Relational Query Engine – Open source – Massive parallel processing
  • 4. Why do we care, about internals? ► SQL is declarative, no need for internals... ► In the same time, even small problems in engine operation require good understanding of its work principles to fix... ► It is hardly possible to optimize without understanding algorithms under the hood. ► It is hard to make decisions about engine suitability to future needs without knowing technical limitations.
  • 6. How to understand engine? What it is doing? Main principle of operation Main building block Operation sequence Operation environment Efficiency Design decisions Materials Main problems and fixes
  • 7. What it is doing Impala is Relation engine. It executes SQL queries. Data is append-able only. There is no “Update” or “Delete” statements.
  • 8. Principle of operation Main differentiators are: Distribution of Query among nodes (MPP) LLVM and Code generation. Impala is compiler. Relay on HDFS Use external metadata – hive metastore. Parallel query capability (per node, per cluster).
  • 9. Sequence of operation Query parsing – translate SQL to AST(Abstract syntax tree) Match objects to metadata Query planning – create physical execution plan. In case of MPP – divide plan into plan fragments for nodes. Distribute plan fragments to nodes Execute plan fragments.
  • 10. Main building blocks Front End. This is Java code which implements a lot of logic with non-critical performance - database objects fe/src/main/java/com/cloudera/impala/analysis/ - execution plan parts : fe/src/main/java/com/cloudera/impala/planner/
  • 11. BackEnd (Be) Backend is written on C++, and used mostly for performance critical parts. Specifically: - Execution of the plan fragments on nodes - Services implementation ImpalaD service StateStore Catalog Service
  • 12. Services - ImpalaD This is “main” service of impala which runs on each node. It logically consists of the following sub-services of our interest. ImpalaService – service, used to execute query. Console, JDBC/ODBC connects here. ImpalaInternalService – service is used to coordinate work within the impala cluster. Example of usage – to coordinate the job of running query fragments on planned impala nodes. What is interesting for us? Each node can serve
  • 13. Dual role of ImpalaD service Query coordinator Fragment executor
  • 15. ImpalaService – main methods inherited from beeswax : ExecuteAndWait Fetch Explain Impala specific : ResetCatalog GetRuntimeProfile
  • 17. Services - StateStore In many clusters we have to solve “cluster synchronization” problem on some or other way. In impala it is solved by StateStore – published/subscriber service, similar to Zookeeper. Why Zookeeper is not used? It speaks with its clients in terms of topics. Clients can subscribe to different topics. So to find “endpoints” - look in the sources for the usage of “StatestoreSubscriber”
  • 18. StateStore – main topics IMPALA_MEMBERSHIP_TOPIC – updates about attached and detached nodes. IMPALA_CATALOG_TOPIC – updates about metadata changes. IMPALA_REQUEST_QUEUE_TOPIC – updates in the queue of waiting queries.
  • 19. Admission control There is module called AdmissionController. Via topic impala-request-queue it is know about queries currently running and their basic statistics like memory and CPU consumption. Based on this info it can decide to: -run query -queue query -reject query
  • 20. Catalog Service It caches in Java code metadata from hive metastore: /fe/src/main/java/com/cloudera/impala/catalog/ It is important since Hive's native partition pruning is slow especially with large number of partitions. It use C++ code be/src/catalog/ To relay changes (delta's) to other nodes via StateStore.
  • 21. Differance with hive Catalog Service store in memory and operate on metadata, leaving MetaStore for persistance only. Technically it mean that disconnection from MetaStore is not that complicated.
  • 22. ImpalaInternalService - details This is place where the real heavy lifting takes place. Before diving in, what we want to understand here: Threading model File System interface Predicate pushdown Resource management
  • 23. Threading model DiskIoMgr schedules access of all readers to all disks. It should include predicates. It can give optimal concurrency. Sounds coherent to the Intel TBB / Java Executor service approach: give me small tasks and I will schedule them. The rest of operations – like Joins, Group By looks like single threaded in current version. IMHO – sort joins and group by are better for concurrency.
  • 24. File System interface Impala is working via LibHDFS – so HDFS (not DFS) is hard coded. Impala required and checked that short circuit is enabled. During planning phase names of the block files to be scanned are determined.
  • 25. Main “database” algorithm It is interesting to see, how main operations are implemented, what options do we have: Group By, Order By (Sort), Join
  • 26. Join Join is probably most powerful and performance critical part of any analytical RDBMS. Impala implements BroadCastJoin and GraceHashJoin.(be/src/exec/partitioned-hash-join- node.h). Both are kinds of Hash Join. Basic idea of GraceHashJoin is to partition data, and load in memory corresponding partitions of the tables for the join.
  • 27. DiskMemory Part 2 Part 3 Part 4Part 1 Part 5 Part 2 Part 3 Part 4Part 1 Part 5 Part 2 Part 3 Part 4Part 1 Part 5Part 3 Part 4 Part 5 In-memory hash join DiskMemory Part 3 Part 4 Part 3 Part 4 Part 5 Part 5
  • 28. BroadCast join Just send small table to all nodes and join with big one. It is very similar to Map Side join in Hive. Selection of join algorithm can be hinted.
  • 29. Group by There are two main approaches – using dictionary or sorting. Aggregation can be subject to memory problems with too many groups. Impala is using Partitioned Hash join which can spill to disk using BufferedBlockManager. It is somewhat analogous to join implementation.
  • 30. User defined functions Impala supports two kinds of UDF / UDAF - Native, written in C/C++ - Hive's UDF written in java.
  • 31. Caching Impala does not cache data by itself. It delegates it to the new HDFS caching capability. In a nutshell – HDFS is capable to keep given directory in memory. Zero copy access via MMAP is implemented. Why it is better then buffer cache? Less task switching No CRC Check
  • 32. Spill to Disk In order to be reliable, especially in face of Data Skews, some sort of spilling data to disk is needed. Impala approach this problem with introduction of BufferedBlockMgr It implements mechanism somewhat similar to virtual memory – pin, unpin blocks, persist them. It can use many disks to distribute load. It is used in all places where memory can be not sufficient
  • 33. Why not Virtual Memory? Some databases offload all buffer management to the OS Virtual Memory. Most popular example: MongoDB. Impala create BufferedBlockManager per PlanFragment. It gives control how much memory consumed by single query on given node. We can summarize answer as : better resource management.
  • 34. BufferedBlockMgr usage Partitioned join Sorting Buffered Tuple Stream Partitioned aggregation
  • 35. Memory Management Impala BE has its own MemPool class for memory allocation. It is used across the board by runtime primitives and plan nodes.
  • 36. Why own Runtime? Impala has implemented own runtime – memory management, virtual memory? IMHO Existing runtime (both Posix, and C++ runtime) are not multi-tenant. It is hard to track and limit resource usage by different requests in the same process. To solve this problem Impala has its own runtime with tracking and limiting capabilities.
  • 37. YARN integration When Impala run as part of the Hadoop stack resource sharing is important question... Two main options are - Just divide resources between Impala and Yarn using cgroups. - Use YARN for the resource management.
  • 38. Yarn Impala Impedance YARN is built to schedule batch processing. Impala is aimed to sub-second queries. Running application master per query does not sounds “low latency”. Requesting resources “as execution go” does not suit pipeline execution of query fragments.
  • 40. LLAMA Low Latency Application Master Or Long Living Application Master It enable low latency requests by living longer – for a whole application lifetime.
  • 41. How LLAMA works 1. There is single LLAMA daemon to broker resources between Impala and YARN 2. Impala ask for all resources at once - “gang scheduling” 3. LLAMA cache resources before return them to YARN.
  • 42. Important point Impala is capable of: - Run real time queries In YARN environment - Ask for more resources (especially memory) when needed. Main drawbacks: Impala implements own resource management among concurrent queries, thus partially duplicating YARN functionality. Possible deadlocks between two YARN applications.
  • 44. What is source of similarity With all the difference, they solve similar problem: How to survive in Africa... O, sorry, How to run and coordinate number of tasks in the cluster.
  • 45. Hadoop parallels QueryPlanner – Developer or Hive. Somebody who create job. Coordinator, ImpalaServer – Job Tracker PlanFragment – Task. (map or reduce) ImpalaInternalService – TaskTracker RequestPoolService+Scheduler+AdmissionContr oller = Hadoop job Scheduler. StateStore – Zookeeper.
  • 46. ImpalaToGo While being a perfect product Impala is chained to the hadoop stack - HDFS - Management
  • 47. Why it is a the problem? HDFS is perfect to store vast amounts of data. HDFS is built from large inexpensive SATA drives. For the interactive analytics we want fast storage. We can not afford FLASH drives for whole big data.
  • 48. What is solution We can create another hadoop cluster on flash storage. Minus – another namenode to manage, replication will waste space. If replication factor is one – any problems should be manually repaired.
  • 49. Cache Layer in place of DFS HDFS/Hadoop cluster ImpalaToGo cluster Data caching (LRU) Auto load
  • 50. Elasticity Having cache layer in place of distributed file system it is much easier to resize cluster. ImpalaToGo is used consistent hashing for its data placement – to minimize impact on resize.
  • 51. Who we are? Group of like minded developers, working on making Impala even greater.