LiveCode Server, can it read local (on the server) drives?
Richard Gaskin
ambassador at fourthworld.com
Wed Aug 28 10:19:06 EDT 2013
Roger Eller wrote:
> A direct SQL query followed by a FTP command to check existence,
> on a per file basis takes about 150 millisecs.
> The same query performed by LC Server, and FTP existence check,
> takes about 500 millisecs.
FTP is notoriously slow. All things considered, that's not bad, though
on a server with any appreciable traffic a half-second for a single
transaction may become problematic.
> I doubt that all of the data (the list) could be carried in a GET
> parameter of the URL. I don't know the URL length limitations, or
> if there is a limit.
It does, and there is no standard. POST can carry much more data, and
although it's also implemented with no consistent limitation at least it
should be big enough to handle a list of the size you describe.
In your original post you wrote:
> I wish to have the server perform a SQL query to a database of file
> paths, and follow that request with an existence verification to a
> local drive of that same server.
Rather than FTP between servers, I wonder if it may be more efficient,
and possible simpler in terms of the number of moving parts, to call
another LC Server routine (or PHP or whatever else could do this) on
that DB server to both query the DB and check for the existence of the
corresponding file there.
In LC, "if there is a file <path>" is darn fast, many times faster than
checking a file's existence via FTP (probably by at least an order of
magnitude).
Another possible benefit of this approach is that the addition of an LC
script as a sort of "middleware" on the other server turns that server
into a service, one that could be extended in other useful directions
down the road as your needs grow.
In cases like this I'm often reminded of Jeff Bezos' requirement for his
engineering team: "Don't give me code, give me APIs". With that
mandate they were able to implement a system that no only grew well
enough to make Amazon the largest retailer on earth, but also later
became a product in itself, known today as Amazon Web Services.
--
Richard Gaskin
Fourth World
LiveCode training and consulting: http://www.fourthworld.com
Webzine for LiveCode developers: http://www.LiveCodeJournal.com
Follow me on Twitter: http://twitter.com/FourthWorldSys
More information about the use-livecode
mailing list