Integration / Apache NiFi Interview Questions
What is the GenerateTableFetch and QueryDatabaseTable pattern for incremental database ingestion?
QueryDatabaseTable and GenerateTableFetch are the two primary patterns for incrementally ingesting data from relational database tables. Each has different performance characteristics and use cases.
QueryDatabaseTable: A simpler, single-processor approach. It issues a SELECT query using a configurable Maximum Value Columns setting to track the last seen value (typically a timestamp or auto-increment ID). On each execution, it queries only rows where the tracked column exceeds the stored state — an incremental read. It produces one FlowFile per execution containing all new rows. Suited for moderate-size increments on single tables.
GenerateTableFetch + ExecuteSQL: A scalable, parallelizable pattern for large tables. GenerateTableFetch queries the database to determine the range of new rows (min and max of the tracking column), then generates one SQL SELECT statement per partition chunk as FlowFile attributes. Each generated FlowFile is routed to ExecuteSQL, which executes the SQL and returns that chunk's result set. Multiple ExecuteSQL processors can run in parallel, fetching different partitions simultaneously — dramatically improving throughput for large incremental loads.
Both processors use NiFi's State Management to persist the last processed value across restarts, ensuring no rows are missed or re-read on processor restart.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
