I'd create another special file (maybe even database) that will keep
information about current file that your program should be working
with. So separate process will create new database and then update
this file. And program will just read this file and then work with
database mentioned in the file. If you work on Unix you even will not
have problems deleting old databases - after updating this special
file just unlink old database and after last file handle to it is
closed it will be gone...

Pavel

On Mon, Jun 8, 2009 at 3:07 PM, Mohit Sindhwani<m...@onghu.com> wrote:
> Hi Everyone,
>
> I'm having a problem that I'm trying to find an elegant solution to.  I
> have a database that stores real-time information - this information is
> replaced by new values every 5 minutes and has about 30,000 entries.
> Once a new database is made available, I should start using that one.
>
> This database is used as part of an HTTP server that responds to
> requests based on the data stored in the database.  So, I'm running into
> a design issue trying to solve how to "switch" the database from the old
> one to the new one.  With multiple incoming requests, I'm not sure how/
> when to update the database.  Also, due to the large number of records
> (30,000) that are to be put in every 5 minutes, I don't think I should
> just keep adding to the database since it takes quite some time - it
> feels better to let a separate process create the database and alert my
> program that a new file is ready!
>
> Any suggestions on how I should approach this problem?
>
> Cheers,
> Mohit.
> 6/9/2009 | 3:07 AM.
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to