Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to Apache NiFi dws19 DWS - DC 2019

375 views

Published on

A quick introduction to Apache NiFi and it's ecosystem. Also a hands on demo on using processors, examining provenance, ingesting REST Feeds, XML, Cameras, Files, Running TensorFlow, Running Apache MXNet, integrating with Spark and Kafka. Storing to HDFS, HBase, Phoenix, Hive and S3.

Published in: Data & Analytics
  • Be the first to comment

Introduction to Apache NiFi dws19 DWS - DC 2019

  1. 1. Introduction to Apache NiFi Timothy Spann Field Engineer tspann@cloudera.com @PaasDev
  2. 2. 2© Cloudera, Inc. All rights reserved. FLOW MANAGEMENT POWERED BY APACHE NIFI • Ingestion: connectors to read/write data from/to several data sources • Transformation: • Format conversion • Compression/decompression, Merge, Split, encryption, etc.. • Data enrichment • Attribute, content, rules, etc… • Routing • Priority, dynamic/static, based on content or metadata, etc… • Parsing
  3. 3. 3© Cloudera, Inc. All rights reserved. APACHE NIFI HIGH LEVEL CAPABILITIES • Web-based user interface • Design, control, feedback & monitoring • Highly configurable • Loss tolerant vs guaranteed delivery • Low latency vs high throughput • Dynamic prioritization • Flow can be modified at runtime • Back pressure • Data provenance • Track dataflow from beginning to end • Designed for extension • Build your own processors • Secure • SSL, SSH, HTTPS, etc.
  4. 4. • Guaranteed delivery • Data buffering - Backpressure - Pressure release • Prioritized queuing • Flow specific QoS - Latency vs. throughput - Loss tolerance • Data provenance • Supports push and pull models • Hundreds of processors • Visual command and control • Flow templates • Pluggable/multi-role security • Designed for extension • Clustering • Version Control Why Apache NiFi?
  5. 5. 5© Cloudera, Inc. All rights reserved. 285+ PROCESSORS FOR DEEPER ECOSYSTEM INTEGRATION Hash Extract Merge Duplicate Scan GeoEnrich Replace ConvertSplit Translate Route Content Route Context Route Text Control Rate Distribute Load Generate Table Fetch Jolt Transform JSON Prioritized Delivery Encrypt Tail Evaluate Execute All Apache project logos are trademarks of the ASF and the respective projects. Fetch HTTP Syslog Email HTML Image HL7 FTP UDP XML SFTP AMQP WebSocket
  6. 6. 6© Cloudera, Inc. All rights reserved. Apache NiFi 1.9 Features Key New Features • Apache Kafka 2.0 support • Apache Hive 3.1.0 support • Connection load balancing • MQTT Performance improvements Updated to 1.9.0
  7. 7. FLOW FILES ARE LIKE HTTP DATA HTTP Data FlowFile HTTP/1.1 200 OK Date: Sun, 10 Oct 2010 23:26:07 GMT Server: Apache/2.2.8 (CentOS) OpenSSL/0.9.8g Last-Modified: Sun, 26 Sep 2010 22:04:35 GMT ETag: "45b6-834-49130cc1182c0" Accept-Ranges: bytes Content-Length: 13 Connection: close Content-Type: text/html Hello world! Standard FlowFile Attributes Key: 'entryDate’ Value: 'Fri Jun 17 17:15:04 EDT 2016' Key: 'lineageStartDate’ Value: 'Fri Jun 17 17:15:04 EDT 2016' Key: 'fileSize’ Value: '23609' FlowFile Attribute Map Content Key: 'filename’ Value: '15650246997242' Key: 'path’Value: './’ Binary Content * Header Content
  8. 8. SQL BASED ROUTING WITH NiFi’s QueryRecord Processor • QueryRecord Processor- Executes a SQL statement against records and writes the results to the flow file content. • CSVReader: Looking up schema from SR, it will converts CSV Records into ProcessRecords • SQ execution via Apache Calcite: execute configured SQL against the ProcessRecords for routing • CSVRecordSetWriter: Converts the result of the query from Process records into CSV for the for the flow file content Why should you care? Do routing(routing geo and speed streams) using standard SQL as opposed to complex regular expressions.
  9. 9. INFRASTRUCTURE AND FLOW MONITORING
  10. 10. Custom Apache NiFi Processors for Open Source Computer Vision
  11. 11. TEXT PROCESSING https://community.hortonworks.com/articles/178510/integration-apache-opennlp-184-into-apache-nifi-15.html • Dates • Locations • Names • Money • Organizations https://community.hortonworks.com/articles/52415/processing-social-media-feeds-in-stream-with-apach.html Sentiment AnalysisNamed Entity Extraction https://community.hortonworks.com/articles/76935/using-sentiment-analysis-and-nlp-tools-with-hdp-25.html https://community.hortonworks.com/articles/163776/parsing-any-document-with-apache-nifi-15-with-apac.html https://community.hortonworks.com/articles/81222/adding-stanford-corenlp-to-big-data-pipelines-apac.html https://community.hortonworks.com/articles/81270/adding-stanford-corenlp-to-big-data-pipelines-apac-1.html
  12. 12. TENSORFLOW PROCESSOR IN JAVA https://community.hortonworks.com/content/kbentry/116803/building-a-custom-processor-in-apache-nifi-12-for.html https://github.com/tspannhw/nifi-tensorflow-processor
  13. 13. INGEST S3 FILES
  14. 14. INGEST RDBMS TABLES https://community.hortonworks.com/articles/64122/incrementally-streaming-rdbms-data-to-your-hadoop.html
  15. 15. ETL LOOKUPS WITH HBASE
  16. 16. NiFi Positioning Apache NiFi / MiNiFi ETL (Informatica, etc.) Enterprise Service Bus (Fuse, Mule, etc.) Messaging Bus (Kafka, MQ, etc.) Processing Framework (Storm, Spark, etc.)
  17. 17. Apache NiFi / Processing Frameworks NiFi Simple event processing • Primarily feed data into processing frameworks, can process data, with a focus on simple event processing • Operate on a single piece of data, or in correlation with an enrichment dataset (enrichment, parsing, splitting, and transformations) • Can scale out, but scale up better to take full advantage of hardware resources, run concurrent processing tasks/threads (processing terabytes of data per day on a single node) ⚠ Not another distributed processing framework, but to feed data into those Processing Frameworks (Flink, Kafka Streams, Storm, Spark, etc.) Complex and distributed processing • Complex processing from multiple streams (JOIN operations) • Analyzing data across time windows (rolling window aggregation, standard deviation, etc.) • Scale out to thousands of nodes if needed ⚠ Not designed to collect data or manage data flow
  18. 18. Apache NiFi / Messaging Bus Services NiFi Provide dataflow solution • Centralized management, from edge to core • Great traceability, event level data provenance starting when data is born • Interactive command and control – real time operational visibility • Dataflow management, including prioritization, back pressure, and edge intelligence • Visual representation of global dataflow ⚠ Not a messaging bus, flow maintenance needed when you have frequent consumer side updates Messaging Bus (Kafka, JMS, etc.) Provide messaging bus service • Low latency • Great data durability • Decentralized management (producers & consumers) • Low broker maintenance for dynamic consumer side updates ⚠ Not designed to solve dataflow problems (prioritization, edge intelligence, etc.) ⚠ Traceability limited to in/out of topics, no lineage ⚠ Lack of global view of components/connectivities
  19. 19. Apache NiFi / Integration, or Ingestion, Frameworks NiFi End user facing dataflow management tool • Out of the box solution for dataflow management • Interactive command and control in the core, design and deploy on the edge • Flexible failure handling at each point of the flow • Visual representation of global dataflow and connectivities • Native cross data center communication • Data provenance for traceability ⚠ Not a library to be embedded in other applications Integration framework (Spring Integration, Camel, etc), ingestion framework (Flume, etc) Developer facing integration tool with a focus on data ingestion • A set of tools to orchestrate workflow • A fixed design and deploy pattern • Leverage messaging bus across disconnected networks ⚠ Developer facing, custom coding needed to optimize ⚠ Pre-built failure handling, lack of flexibility ⚠ No holistic view of global dataflow ⚠ No built-in data traceability
  20. 20. Apache NiFi / ETL Tools NiFi NOT schema dependent • Dataflow management for both structured and unstructured data, powered by separation of metadata and payload • Schema is not required, but you can have schema • Minimum modeling effort, just enough to manage dataflows • Do the plumbing job, maximize developers’ brainpower for creative work ⚠ Not designed to do heavy lifting transformation work for DB tables (JOIN datasets, etc.). You can create custom processors to do that, but long way to go to catch up with existing ETL tools from user experience perspective (GUI for data wrangling, cleansing, etc.) ETL (Informatica, etc.) Schema dependent • Tailored for Databases/WH • ETL operations based on schema/data modeling • Highly efficient, optimized performance ⚠ Must pre-prepare your data, time consuming to build data modeling, and maintain schemas ⚠ Not geared towards handling unstructured data, PDF, Audio, Video, etc. ⚠ Not designed to solve dataflow problems
  21. 21. NiFi and Kafka Are Complementary NiFi Provide dataflow solution • Centralized management, from edge to core • Great traceability, event level data provenance starting when data is born • Interactive command and control – real time operational visibility • Dataflow management, including prioritization, back pressure, and edge intelligence • Visual representation of global dataflow Kafka Provide durable stream store • Low latency • Distributed data durability • Decentralized management of producers & consumers + ⚠ Requires adding/removing processors according to consumer-side updates ⚠ Not optimized to manage dataflows (prioritization, enrichment, protocols, formats, event level authorizations, objects with various sizes, etc.)
  22. 22. THANK YOU

×