Let's say you have a database with a lot of products/customers/orders and the codebase (java/c#) contains all the business logic. During the night several batches are needed to export data to flat files and then ftp them to a proprietary system.
How should we do this "write-database-into-a-flat-file? What are the best-practices?
Some thoughts:
we could create a stored procedure and use f.ex ssis to fetch the data? Maybe we can do this if we have a "batch-output-database-table" but not if we have to do logic before the file is written?
we could do all the logic in managed code using the same repositories / business logic as the rest of the domain? (this could be a slow process compared to the stored procedure solution)
What if the only interface for the domain-services are web services (which could take "long" time for each request), will the "best practices" change ?