Web database suggestions

Alex Tweedly alex at tweedly.net
Tue Jan 25 12:01:34 EST 2005


Richard Miller wrote:

> I'm looking for a simple solution for storing and accessing data on a 
> hosted server. Initially, the database need hold only about 1000 
> records, containing simple contact information (15 fields). Reading 
> and writing data is the main purpose... only a small amount of 
> searching need take place. Access will be directly from a Rev 
> application (not a browser or html file). Suggestions?

SQL, like Andre said. Or, if there's a reason to avoid it, a simple CGI 
script that will read the file and send lines as needed. Or (depending 
on the hosted server characteristics), a Rev based server using a 
different socket.

But you should be able to do simple text file - so read on ....

> I've been experimenting with placing a simple text file on the server 
> and accessing it as if it was a local file, using lines like:
>
>     put line 1 of url "ftp://myaddress.com/data.txt" into var1

I'd do whole file transfers, rather than (implied) single lines at a time.
   put url "ftp://myaddress.com/data.txt" into tData
   put line 1 of tData into var1

I'd consider compressing the file (depending on what other uses it is 
being put to). Guessing each field at an average 20 bytes, you have 1000 
* 15 * 20 = 30kbytes - could compress to 10-20K depending on data, and 
so half the transfer time.

> This seems to work reasonably well for testing purposes, but access 
> time is rather slow (even through a broadband connection) and the file 
> seems prone to corruption. Comments?

It's very worrying that you say the file is liable to corruption - ftp 
shouldn't do that :-).
Is it being accessed by multiple clients at same time ?
How are you doing the writes to the remote file ?

-- Alex.


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.3 - Release Date: 24/01/2005



More information about the use-livecode mailing list