intro to apache apex, the next gen hadoop platform for ingestion & transformation

31
Introduction to Apache Apex Dr. Munagala Ramanath Software Engineer & Apex Committer

Upload: datatorrent

Post on 19-Feb-2017

89 views

Category:

Technology


6 download

TRANSCRIPT

Page 1: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

Introduction to Apache Apex

Dr. Munagala RamanathSoftware Engineer & Apex

Committer

Page 3: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

3

Stream Processing

•Data from variety of sources (IoT, Kafka, files, social media etc.)

•Unbounded, continuous data streams•Batch can be processed as stream (but a stream is not a batch)

•(In-memory) Processing with temporal boundaries (windows)

•Stateful operations: Aggregation, Rules, … -> Analytics

•Results stored to variety of sinks or destinations•Streaming application can also serve data with very low latency

Browser

Web Server

Kafka Input(logs)

Decompress, Parse, Filter

Dimensions Aggregate Kafka

LogsKafka

Page 4: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

4

Apache Apex

•In-memory, distributed stream processing•Application logic broken into components called operators that run in a distributed fashion across your cluster

•Natural programming model•Unobtrusive Java API to express (custom) logic

•Maintain state and metrics in your member variables

•Scalable, high throughput, low latency•Operators can be scaled up or down at runtime according to the load and SLA

•Dynamic scaling (elasticity), compute locality

•Fault tolerance & correctness•Automatically recover from node outages without having to reprocess from beginning

•State is preserved, checkpointing, incremental recovery

•End-to-end exactly-once

•Operability•System and application metrics, record/visualize data

•Dynamic changes

Page 5: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

Apache Apex and DataTorrent Product StackDesigned to help you at every stage of your data-in-motion pipeline

Solutions for Business Problems

Ingestion & Data Prep ETL Pipelines

Ease of Use Tools Real-Time Data VisualizationManagement & MonitoringGUI Application Assembly

Application Templates

Apex-Malhar Operator Library

Big Data Infrastructure Hadoop 2.x – YARN + HDFS – On Prem & Cloud

Core

High-level APITransformation ML & Score SQL Analytics

FileSync

Dev Framework Batch Support

Apache Apex Core

Kafka HDFS HDFS HDFS JDBC HDFS JDBC Kafka

Page 6: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

6

Application Development Model

▪A Stream is a sequence of data tuples▪A typical Operator takes one or more input streams, performs computations & emits one or more output streams

• Each Operator is YOUR custom business logic in java, or built-in operator from our open source library• Operator has many instances 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)

Filtered

Stream

Output StreamTuple Tuple

Filtered Stream

Enriched Stream

Enriched

Stream

er

Operator

er

Operator

er

Operator

er

Operator

er

Operator

er

Operator

Page 7: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

7

Native Hadoop Integration

• YARN is the resource manager

• HDFS for storing persistent state

Page 8: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

8

Sample Application

KafkaInput

Parser

WordCount

er

Database

Output

CountsWordsLinesKafka DatabaseApex Application

• Design and develop operators or use existing ones from the library• Connect operators to form an Application• Configure operators• Configure scaling and other platform attributes• Test functionality, performance and iterate

Filter

Filtered

Page 9: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

Apex Malhar - Production Ready Operators

RDBMS• Vertica• MySQL• Oracle• JDBC

NoSQL• Cassandra• Hbase• MongoDB• Aerospike, Accumulo• Couchbase/ CouchDB• Redis

Messaging• Kafka• Solace• Flume• ActiveMQ• Kinesis

File Systems• HDFS/ Hive• NFS• S3

Parsers• XML • JSON• CSV• Avro• Parquet

Transformations• Filters• Rules• Expression• Dedup• Enrich

Analytics• Dimensional Aggregations

Protocols• HTTP• FTP• WebSocket• MQTT• SMTP

Other• Elastic Search• Script (JavaScript, Python,

R)• Geode• Nifi• Twitter

Operator Maturity Framework

Scalability and Idempotency

Documentation

Example Applications

Internal Certification

Benchmarking

Page 10: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

10

Filter Operator

Page 11: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

11

Application Definition

Instantiate operators Connect operators by connecting output port to input port

• Multiple ways• Compositional, High Level with Windowing, Beam, Stream SQL, JSON, Property file

• Compositional example

Page 12: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

12

Scalability

0Unifier

1a

1b

1c

2a

2b

Unifier

3

Unifier

0 4

3a

2a

1a

1b

2b

3b

Unifier

uopr1uopr2uopr3uopr4

dopr

unifier

unifier

unifier

Container

Container

NIC

NIC

NIC

NIC

NIC

Container

Partitioning & Unification

Cascade Unifier

Parallel Partitioning

Page 13: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

13

Dynamic Scaling

• Partitioning change while application is runningᵒ Change number of partitions at runtime based on statsᵒ Determine initial number of partitions dynamically

• Kafka operators scale according to number of kafka partitionsᵒ Supports redistribution of state when number of partitions changeᵒ API for custom scaler or partitioner

2b

2c

3

2a

2d

1b

1a1a 2a

1b 2b

3

1a 2b

1b 2c 3b

2a

2d

3a

Unifiers not shown

Page 14: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

14

Runtime topology

Page 15: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

15

Fault Tolerance & Checkpointing

▪ Application window ▪ Sliding window and tumbling window▪ Checkpoint window▪ No artificial latency

Page 16: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

• In-memory PubSub

• Stores results emitted by operator until committed

• Handles backpressure / spillover to local disk

• Ordering, idempotency

Operator 1

Container 1

BufferServer

Node 1

Operator 2

Container 2

Node 2

Buffer Server

16

Page 17: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

17

End-to-End Exactly Once

•Important when writing to external systems

•Data should not be duplicated or lost in the external system in case of application failures

•Common external systems•Databases•Files•Message queues

•Exactly-once = at-least-once + idempotency + consistent state

•Data duplication must be avoided when data is replayed from checkpoint•Operators implement the logic dependent on the external system•Platform provides checkpointing and repeatable windowing

Page 18: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

18

Monitoring Console

•Logical View Physical View

Page 19: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

19

Real-Time Dashboards

Page 20: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

Application Designer

Page 21: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

AppHub – App Template Repository

• Application repository that serves demos and applications that are backed by DataTorrent

• Provides version updates via dtManage

•Future Opportunities• Apps on Cloud Big Data

environments such as Azure, EMR

• Marketplace for applications created by the community

Page 22: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

GE powers Industrial IoT applications with DataTorrent

18 | © 2016 DataTorrent Confidential – Do Not Distribute

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 DataTorrent Solution Client Outcome

• Ingest and analyze high-volume, high speed data from thousands of devices, sensors per customer in real-time without data loss

• Predictive analytics to reduce costly maintenance and improve customer service

• Unified monitoring of all connected sensors and devices to minimize disruptions

• Fast application development cycle

• High scalability to meet changing business and application workloads

• Built an ingestion application using DataTorrent Enterprise platform

• Powered by Apache Apex• In-memory stream processing• Built-in fault tolerance• Dynamic scalability• Comprehensive library of pre-built

operators including connectors• Management UI console

• Helps GE improve performance and lower costs

• Helps GE detect possible failures and minimize unplanned downtimes with easy, centralized management & monitoring of devices

• Enables faster innovation with short application development cycle

• No data loss and 24x7 availability of applications

• Helps GE easily adjust to scalability needs with auto-scaling

Page 23: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

CapitalOne prevents fraudulent credit card transactions in real-time with DataTorrent

18 | © 2016 DataTorrent Confidential – Do Not Distribute

Capital One is the eighth-largest bank holding company in the US and specializes in credit cards, home loans, auto loans, banking and savings products. It is using Apache Apex to build their next generation decisioning platform, achieving an ultra-low latency of under 2 ms for decision making, and handling 2,000 events burst at a net rate of 70,000 events/sec.

Business Need DataTorrent Solution

• Replaces existing mainframe system for CapitalOne

• No data loss and 24x7 availability of applications

• Easy integration with the existing infrastructure HDFS, messaging queues & in-memory data grids

• Achieved 0.25 ms latency (on average), 2 ms latency (99.99%), 16 ms (99.9999).

Client Outcome

• Decline fraudulent credit card transactions• Open Source • Decision to authorize or decline a

transaction in real time - SLA is 40 ms (ideally 15 ms)

• Process 2,000 events/ 10ms• Transactions may be declined based on

• a transaction attribute or several attributes &

• dynamically changing rules (e.g. an account is disabled or an account limit is reached)

• DataTorrent 2.0 Enterprise platform, powered by Apache Apex

• In-memory stream processing • Comprehensive library of pre-built

operators including connectors• The only enterprise ready solution• Built-in fault tolerance• Dynamically scalable• Use precomputed ML model for

scoring• Management UI & Data Visualization

console

Page 25: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

25

Resources• Apache Apex - http://apex.apache.org/

• Subscribe to forums

○ Apex - http://apex.apache.org/community.html

○ DataTorrent - https://groups.google.com/forum/#!forum/dt-users

• Download - https://datatorrent.com/download/

• Twitter○ @ApacheApex; Follow - https://twitter.com/apacheapex○ @DataTorrent; Follow – https://twitter.com/datatorrent

• Meetups - http://meetup.com/topics/apache-apex

• Webinars - https://datatorrent.com/webinars/

• Videos - https://youtube.com/user/DataTorrent

• Slides - http://slideshare.net/DataTorrent/presentations

• Startup Accelerator Program - Full featured enterprise product○ https://datatorrent.com/product/startup-accelerator/

• Big Data Application Templates Hub – https://datatorrent.com/apphub

Page 26: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

26

We Are Hiring• [email protected]

• Developers/Architects

• QA Automation Developers

• Information Developers

• Build and Release

• Community Leaders

Page 27: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

27

Q&A

Thank you

Page 28: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

EXTRA

Page 29: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

Application Specification (Java)

29

Java Stream API (declarative)

DAG API (compositional)

Page 30: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

Writing an Operator

30

Page 31: Intro to Apache Apex, the Next Gen Hadoop Platform for Ingestion & Transformation

Attributes

31

• Attributes are platform features and apply to all operators