using a filesharing site / SQL-Database

Creating desktop or client-server database solutions?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Zood
Posts: 22
Joined: Mon Apr 24, 2017 7:17 pm

using a filesharing site / SQL-Database

Post by Zood » Wed Jul 05, 2017 7:19 pm

Hello,

I came across a problem earlier this week when moving my files (databases) online to enable future use of tablets etc with the same database.
My programm has a few small (<500kb) .csv files on which to rely but when accessing it via dropbox/windows cloud it takes about 1-2 seconds to load the data, which is too long.
is there any way to speed this process up?
Whenever I store the files internally (desktop), there is almost no rendering-time and the data is shown immediately.
Any solution would greatly be apreciated!

Thanks in advance,
Zood

shaosean
Posts: 830
Joined: Thu Nov 04, 2010 7:53 am

Re: using a filesharing site / SQL-Database

Post by shaosean » Wed Jul 05, 2017 7:37 pm

That's the cost of moving it to the internet.. If the data in those CSV files isn't changing, or not changing often, just cache it on the client side for local use.. You can always do a check to see if the server holds newer data..

jiml
Posts: 134
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: using a filesharing site / SQL-Database

Post by jiml » Thu Jul 06, 2017 3:23 pm

You might also try compressing prior to upload and decompressing after download.

Zood
Posts: 22
Joined: Mon Apr 24, 2017 7:17 pm

Re: using a filesharing site / SQL-Database

Post by Zood » Thu Jul 06, 2017 10:09 pm

jiml wrote:You might also try compressing prior to upload and decompressing after download.
great suggestion! thanks, had not thought of that before.
When using just a simple file-upload to dropbox i use:
[code[ put url ("File:" & specialfolderpath("Desktop") & "/fileX.csv") into url ("http://dl.dropbox.com/s/ywdblh201pkv7qn/fileX.csv") [/code]
I have uploaded fileX.csv manually to dropbox in order to get the link, i then replaced the "www" with "dl" and replaced "Https" with "Http".
The downloading part works like a charm but when I start uploading it does not change the initial file.
Any suggestions?

Thanks!
Zood

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 552
Joined: Fri Jun 27, 2008 9:00 pm

Re: using a filesharing site / SQL-Database

Post by Mikey » Fri Jul 07, 2017 3:13 am

Zood, look at the LC dropbox library for your dropbox activities.

Things you can do:
1) query dropbox for last modified date/time on the file(s) you are interested in, or name them with the seconds when they were updated or with a sequence number.
2) If you're using LC indy/commercial/etc., and the dropbox library, then make your calls asynchronously to get multiple things happening at once, which will remove some of the waits.
3) Have a master file and change files so that your clients can just download changes. If you name your change files with a sequence number, then the clients just have to keep track of the last sequence they saw, and download the ones following (although the overhead with this can be larger than you might like, so you may want to have intermediate change files, too (files that have, say, an hour worth of updates in them).
4) Have a separate machine sitting at home base that is monitoring your service (e.g. dropbox), then when there are changes uses push notifications to silently push changes to the clients. Please remember that push notifications are not guaranteed to reach the intended recipients, so while this can improve your app performance, it also may fail, so a backup plan is important.

MaxV
Posts: 1342
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: using a filesharing site / SQL-Database

Post by MaxV » Fri Jul 07, 2017 1:22 pm

Free dropbox lib will be included in livecode 9-dp7.
See https://github.com/macMikey/phxDropboxLib
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

Zood
Posts: 22
Joined: Mon Apr 24, 2017 7:17 pm

Re: using a filesharing site / SQL-Database

Post by Zood » Sat Jul 29, 2017 3:04 pm

MaxV wrote:Free dropbox lib will be included in livecode 9-dp7.
See https://github.com/macMikey/phxDropboxLib
Hey Max,

I saw they had indeed put a dropbox support with the update, i just cant seem to get it up and running
Is there anyone with a sample stack to learn from?
Greatly apreciated!

Post Reply

Return to “Databases”