php progress bar through database

I need to run long (mintues to hours) matlab code on server side and send the user its progress status (0-100%). I can't send the data directly to client-side because the client may disconnect and check the status hours later.

Should I do it through the database? Thought about updating the database through matlab/php while the client side (php via javascript/ajax) can query the database every few seconds but I am afraid its very "expensive" (many read & write operations for only one user).

What should I do? by the way, its an internal network, dozenes of users, no more.


You did not mention the kind of database you are using. If it is mysql and since you are only in an internal network with some dozens users: yes you can use the database. If you want to keep read/write-operations low, you can use the MEMORY-Database-Engine for that purpose.

Also, you can use Memcache for interprocess-communication. One process writes into memcache, and another process reads the value out.

Need Your Help

Count lines found with find command

linux bash command-line find

I have configured glusterfs into two servers.

Table view with bottom corner like the iPad Notes app

ios uitableview uiscrollview

I'm doing something which looks like the list of notes of the iPad Notes app: a classic table view, but with a corner at the bottom, like this:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.