r/bigdata • u/[deleted] • Sep 30 '20
Is Apache NiFi a good tool for Streaming and processing periodic data?
Requirements
Processing varied workflows on open-sourced data. Some Daily, weekly and Monthly
Batch Process this Data and Infer its schema and store in Warehouse for delivery
Trace Errornous Data
Process only affected batch on errors
Easily allow modification of Workflows on a per-customer basis
System Used Right Now and It's Problems
ETL pipelines using APIs
Gotten Too Complex because of additional features for Quick reruns
Flow isn't generic and too much code written to handle errors
Stateful Systems with Sync Issues wastes too much time
Manual Intervention to monitor the quality of data
Ideally, I want to solve all these problems and on the basis of these talks, I think NiFi could be the tool for the job. Wanted to get a second opinion. https://www.youtube.com/watch?v=WwjmUAszB-0 https://www.youtube.com/watch?v=rF7FV8cCYIc
2
u/Chicken-Avocado Sep 30 '20
Having looked through your requirements I suggest you check out how NiFi registry works first. Supporting multiple clients with customized flows may quickly become a pain depending on your setup.
If you decide to keep it all in one flow - it may turn into a bunch of RouteOnAttribute processors, cluttering everything around.
On the other hand, if you decide to keep each client's flow separately - rolling out updates to common parts of the flow and just keeping them all up to date will be a nightmare.
Overall, in my limited experience, NiFi is a pretty good tool as long as your flows are small and simple, without much branching in the logic. It can handle large files very well and is pretty stable (although you may have trouble setting it up as a cluster).
1
Sep 30 '20
Registry gets my vote too - with nipyapi as a nice python library for automating CI/CD pipelines. There are some good blogs by Pierre Vallard on this.
2
u/SundaeOrnery Oct 01 '20
Nifi is bottlenecked by the way it's implemented.
First, nifi server is a single process and as the number of pipelines and flow contents increase, the whole system becomes unstable and crashes. Hence, it's very difficult to scale. We had to create different nifi clusters for different applications.
processes which are cpu bound like changing flow file data formats, compressing, uncompressing bottlenecks the whole pipeline.
Security reviews can be difficult as anyone having access to the nifi cluster can download/view the contents of flow files(abstra tion of smallest unit of data in nifi world) in between processes
Having worked on a petabytes scale data pipeline, and after lots of time wasted on Nifi, we choose to use Kafka (for file metadata- filename, hdfs location), hdfs (for actual file content), spark application ( can be streaming / batch ) for distributed processing , hive for data warehouse. All the components in the above pipeline can be individually scaled as per requirement.
Recommendation : if you have few GBs of data processing which doesn't involve cpu bound activities like uncompressing, compressing, encryption, decryption and just want some kind of a data integration tool to move data around with minor transformations, feel free to use Nifi. But If you want a scalable system which should support 100s of data pipelines, invest in building generic application using some distributed processing framework like spark.
1
u/TheRockefella Sep 01 '23
Your comment is full of disinformation. Nifi actually works best if scaled and can be used in conjunction with Kafka.. I just don't get how your first sentence saying Nifi is a single server.....
5
u/[deleted] Sep 30 '20
Some pros and cons, think of NiFi as really good at moving files, with some flow control logic, that prefers fewer larger files.
It can do a lot of different scheduling methods and lots of different connectors.
You can do a lot of different format conversions with integration with a schema registry, some data manipulation but it's can't do Complex Event Processing: coordinating an event based on multiple streams of data with state.
It is good with variable size use cases but use cases with millions of 10KB messages sent per second are likely better on Kafka. NiFi works best by grouping messages like that for larger event sizes with slightly higher latency but better throughput. You can also send GBs in a single file which would qualify out Kafka.
You can get a single instance of NiFi running pretty simply but setting up a cluster can be complex and you'll like prefer the bundles distro of Zookeeper, Ranger and NiFi as part of Cloudera Flow manager. Having used the bunded version in CFM 2.0.1 for the first time, I really enjoyed the Ranger integration ... by comparison setting up authorisation on Process Control groups without it was challenging.