I am interested in hearing opinions from experienced developers on which represents best practice in the following scenario:
When files appear in a filesystem, processing needs to occur. Meta data about the files also exists in a database. Which is better: 1) to monitor the file system directly for new work, then query the database for meta data needed in processing or 2) to monitor the database for new work and then inspect the filesystem to pick the file to work on?
I am an experienced architect myself and this is a real-world problem at a client. I have an opinion, but I'm interested in hearing arguments for both sides that will help me refine my opinion and/or better defend my recommendation to the client.
If you've worked with a similar situation or otherwise have an opinion on best practice in this scenario, please share your thoughts!