This project is about an sqlite database that is a cache of a very large remote file system (think large). Since the files are stored remotely and there are a lot of them, we want the database to store just the most recently used files (say the last 10K files) and delay the updates on the remote file system for performance reasons.
We want the sql database to have a single table (file_name, file_content, last_access, is_dirty).
We need five php functions:
1. add(filename, file_content)
2. update(filename, file_content)
3. delete(filename)
4. get(filename)
5. update_cache() // update_cache is the core function we need.
When called, update_cache
1. should check if there are "dirty" files that are more than x minutes (say 10mins) old and writes them to the filesystem (use an index to find these. Do not crawl the database table)
2. should check if there are files that have not been accessed for the last y minutes (say 10 minutes) and cleans them (unless they are dirty).
update_cache should be a very quick function (it will be called every second or so).
Another reason we want this is because we want to use database transactions to prevent lost updates on the files. Thus all of the above will be done within a database transaction.
The API for reading/deleting/writing to the remote file system will be provided.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
PHP 5.x