Apache Apex: Next Gen Big Data Analytics
Thomas Weise <thw@apache.org> @thweise PMC Chair Apache Apex, Architect DataTorrent Apache Big Data Europe, Sevilla, Nov 14th 2016
Apache Apex: Next Gen Big Data Analytics Thomas Weise - - PowerPoint PPT Presentation
Apache Apex: Next Gen Big Data Analytics Thomas Weise <thw@apache.org> @thweise PMC Chair Apache Apex, Architect DataTorrent Apache Big Data Europe, Sevilla, Nov 14 th 2016 Stream Data Processing Real-time Data Delivery Transform /
Thomas Weise <thw@apache.org> @thweise PMC Chair Apache Apex, Architect DataTorrent Apache Big Data Europe, Sevilla, Nov 14th 2016
2
Data Sources
Events Logs Sensor Data Social Databases CDC
Oper1 Oper2 Oper3
Real-time visualization, …
Data Delivery Transform / Analytics
SQL Declarative API DAG API
SAMOA
Beam Operator Library
SAMOA
Beam
(roadmap)
3
Financial Services Ad-Tech Telecom Manufacturing Energy IoT Fraud and risk monitoring Real-time customer facing dashboards on key performance indicators Call detail record (CDR) & extended data record (XDR) analysis Supply chain planning &
Smart meter analytics Data ingestion and processing Credit risk assessment Click fraud detection Understanding customer behavior AND context Preventive maintenance Reduce outages & improve resource utilization Predictive analytics Improve turn around time of trade settlement processes Billing
Packaging and selling anonymous customer data Product quality & defect tracking Asset & workforce management Data governance
HORIZONTAL
4
5
6
A Stream is a sequence of data tuples A typical Operator takes one or more input streams, performs computations & emits one or more
business logic in java, or built-in
library
that run in parallel and each instance is single-threaded Directed Acyclic Graph (DAG) is made up of operators and streams
Directed Acyclic Graph (DAG)
Operator Operator Operator Operator Operator Operator Tuple Output Stream Filtered Stream Enriched Stream Filtered Stream Enriched Stream
7
Kafka Input Parser Word Counter JDBC Output
Counts Words Lines
Filter
Filtered
8
9
10
RDBMS
NoSQL
Messaging
File Systems
Parsers
Transformations
Analytics
(with state management for historical data + query)
Protocols
Other
11
(All) : 5 t=4:00 : 2 t=5:00 : 3 k=A, t=4:00 : 2 k=A, t=5:00 : 1 k=B, t=5:00 : 2 (All) : 4 t=4:00 : 2 t=5:00 : 2 k=A, t=4:00 : 2 K=B, t=5:00 : 2 k=A t=5:00 (All) : 1 t=4:00 : 1 k=A, t=4:00 : 1 k=B t=5:59 k=B t=5:00 k=A t=4:30 k=A t=4:00
Processing Time +30s +60s +90s
12
ApexStream<String> stream = StreamFactory .fromFolder(localFolder) .flatMap(new Split()) .window(new WindowOption.GlobalWindow(), new TriggerOption().withEarlyFiringsAtEvery(Duration.millis(1000)).accumulatingFiredPanes()) .countByKey(new ConvertToKeyVal()).print();
13
ᵒ Automatically performed by engine, no additional coding needed ᵒ Asynchronous and distributed ᵒ In case of failure operators are restarted from checkpoint state
ᵒ Heartbeat mechanism ᵒ YARN process status notification
ᵒ Fast, incremental recovery, spike handling
ᵒ Snapshot of physical (and logical) plan ᵒ Execution layer change log
14
Operator 1 Container 1
Node 1 Operator 2 Container 2 Node 2
15
… EW2, 1, 3, BW2, EW1, 4, 2, 1, BW1 sum … EW2, 1, 3, BW2, EW1, 4, 2, 1, BW1 sum 7 … EW2, 1, 3, BW2, EW1, 4, 2, 1, BW1 sum 10 … EW2, 1, 3, BW2, EW1, 4, 2, 1, BW1 sum 7
16
17
ᵒ No messages lost ᵒ Default, suitable for most applications
ᵒ Transactions with meta information, Rewinding output, Feedback from external entity, Idempotent operations
ᵒ Useful in use cases where some data loss is acceptable and latest data is sufficient
ᵒ At-least-once + idempotency + transactional mechanisms (operator logic) to achieve end-to-end exactly once behavior
18
ᵒ Databases ᵒ Files ᵒ Message queues
ᵒ Operators implement the logic dependent on the external system ᵒ Platform provides checkpointing and repeatable windowing
19
NxM Partitions Unifier
1 2 3
Logical DAG
1 2 1 1 Unifier 1 2
Logical Diagram Physical Diagram with operator 1 with 3 partitions
Unifier 1a 1b 1c 2a 2b Unifier 3
Physical DAG with (1a, 1b, 1c) and (2a, 2b): No bottleneck
Unifier Unifier 1a 1b 1c 2a 2b Unifier 3
Physical DAG with (1a, 1b, 1c) and (2a, 2b): Bottleneck on intermediate Unifier
20
1a 1b 2 3 4 Unifier
Physical DAG
4 3a 2a 1a 1b 2b 3b Unifier
Physical DAG with Parallel Partition
Parallel Partition
Container
uopr uopr1 uopr2 uopr3 uopr4 uopr1 uopr2 uopr3 uopr4 dopr dopr dopr unifier unifier unifier unifier
Container Container
NIC NIC NIC NIC NIC
Container
NIC
Logical Plan
Execution Plan, for N = 4; M = 1 Execution Plan, for N = 4; M = 1, K = 2 with cascading unifiers
Cascading Unifiers
1 2 3 4
Logical DAG
21
ᵒ Change number of partitions at runtime based on stats ᵒ Determine initial number of partitions dynamically
ᵒ Supports re-distribution of state when number of partitions change ᵒ API for custom scaler or partitioner
2b 2c 3 2a 2d 1b 1a 1a 2a 1b 2b 3 1a 2b 1b 2c 3b 2a 2d 3a
Unifiers not shown
22
ᵒ Pluggable component, can use any system or custom metric ᵒ Externally driven partitioning example: KafkaInputOperator
ᵒ Uses checkpointed state ᵒ Ability to transfer state from old to new partitions (partitioner, customizable) ᵒ Steps:
ᵒ No loss of data (buffered) ᵒ Incremental operation, partitions that don’t change continue processing
23
ᵒ RACK_LOCAL: Data does not traverse network switches ᵒ NODE_LOCAL: Data transfer via loopback interface, frees up network bandwidth ᵒ CONTAINER_LOCAL: Data transfer via in memory queues between
ᵒ THREAD_LOCAL: Data passed through call stack, operators share thread
ᵒ Operators can be deployed on specific hosts
ᵒ Ability to express relative deployment without specifying a host
24
25
2.7 million events/second, Kafka latency limit
43 million events/second with more than 90 percent of events processed with the latency less than 0.5 seconds
26
27
28
29
30
PubMatic is the leading marketing automation software company for publishers. Through real-time analytics, yield management, and workflow automation, PubMatic enables publishers to make smarter inventory decisions and improve revenue performance
Business Need Apex based Solution Client Outcome
views in real-time to help customers improve revenue
flow
monetization from auction and client logs
efficient resource utilization
powered by Apache Apex
console
insights to publishers and advertisers in real-time instead of 5+ hours
performance and adjust ad inventory in real-time to maximize their revenue
efficient compute resource utilization
customers can always access ad network
31
GE is dedicated to providing advanced IoT analytics solutions to thousands of customers who are using their devices and sensors across different verticals. GE has built a sophisticated analytics platform, Predix, to help its customers develop and execute Industrial IoT applications and gain real-time insights as well as actions.
Business Need Apex based Solution Client Outcome
data from thousands of devices, sensors per customer in real-time without data loss
maintenance and improve customer service
and devices to minimize disruptions
and application workloads
Enterprise platform
cost by enabling real-time Big Data analytics
minimize unplanned downtimes with centralized management & monitoring of devices
application development cycle
applications
auto-scaling
32
Silver Spring Networks helps global utilities and cities connect, optimize, and manage smart energy and smart city
remote operations per year
Business Need Apex based Solution Client Outcome
millions of devices & sensors in real-time without data loss
without delay to improve customer service
understand & improve grid operations
integrating with 3rd party apps
by Apache Apex
analyze data in real-time for effective load management & customer service
possible failures and reduce outages with centralized management & monitoring of devices
faster time to market
easy to partition operators
33
apache-apex-hadoop
silver-spring-networks
34
35