I'm moving data from my postgres database to kafka and in the middle doing some transformations with spark. I Have 50 tables and for each table i have transformations totally different from the others. So, i want to know how is the best way to structure my spark structured streaming code. I think in three options:
To Put all the logical of read and write this 50 tables in one object and call only this object.
Create 50 different objects for each table and in a new object create a main method calling each of 50 objects and after call spark.streams.awaitAnyTermination()
Submit individually each of these 50 objects via spark submit
If exist another better option, please talk to me.
Thank you