954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Monitor Database or Monitor Filesystem?

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!

Darcy

dellarby
Newbie Poster
1 post since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

Couple things that seem unclear, that could affect the choice.

1. How did the meta data get there in the database if its a new file?

2. When you say "process file", does that mean you have application code or sql code that does this processing?

3. Is the processing of the files heavily intensive or quickly done?

dickersonka
Veteran Poster
1,175 posts since Aug 2008
Reputation Points: 130
Solved Threads: 143
 

I'd go for monitoring for new files. This can be done by creating an app that hooks into windows. This means you won't have to create a polling mechanism (either for files or for new database entries).

pritaeas
Posting Expert
Moderator
5,475 posts since Jul 2006
Reputation Points: 653
Solved Threads: 874
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You