title: Should I use Python native multithread or Multiple Tasks in Airflow?
body: <p>I'm refactoring a .NET application to airflow. This .NET application uses multiple threads to extract and process data from a mongoDB (Without multiple threads the process takes ~ 10hrs, with multi threads i can reduce this) .</p>
  <p>In each documment on mongoDB I have a key value named<code>process</code>. This value is used to control which thread process the documment. I'm going to develop an Airflow DAG to optimize this process. My doubt is about performance and the best way to do this.</p>
  <p>My application should have multiple tasks (I will control the <code>process</code> variable in the input of the python method). Or should I use only 1 task and use Python MultiThreading inside this task? The image below illustrates my doubt.</p>
  <p><a href="https://i.stack.imgur.com/7CpQ6.jpg" rel="nofollow noreferrer">Multi Task X Single Task (Multi Threading)</a></p>
  <p>I know that using MultiTask I'm going to do more DB Reads (1 per task). Although, using Python Multi Threading I know I'll have to do a lot of control processing inside de task method. What is the best, fastest and optimized way to do this?</p>