Cloud DB seems to have trouble responding

After prolonged response time in the last few days, Cloud DB seems to have increasingly trouble responding.
This often results in a time out error.
I've been using App Inventor Cloud DB for several years now in an unchanged application and hardly experienced any down time.
The application is for Garden Lights control/automation, and it uses an Arduino plus an old Android phone for communication with CloudDB.
This old phone started switching off the AI2 application probably due to time out errors in the CloudDB Handling. So I tried a newer phone with the same AI2 app and it shows CloudDB time out error messages on a regular bases. However it doesn't drop out of the app.

So to test things further I made a tiny app that has one button and a single variable.
When the button is pushed, it adds 1 to a variable and writes that variable to CloudDB.
Immediately after that it reads the variable in CloudDB and as soon as a value is received, that value is printed on my screen.
So I can see in almost real time how much time the system needs to get the newly saved value. Generally it returns the right value within half a second.
But sometimes it takes a much longer time, resulting in a time out error.

Has anyone else the same issue?
Kind regards,
Wil.

If you are a "heavy" user of cloudDB, it is possible that your calls and responses are being throttled by the server provider.

However, given your simple test shows that cloudDB is working as expected, you may need to review the code/blocks in your app for any issues that may cause the delay in your responses.

Thanks for your reply.
My simple test app shows that generally the response time is ok.
But sometimes it takes a much longer time, resulting in a time out error.
My GardenLight app reads one CloudDB variable once every second, to see if something has changed.
Is that heavy use? I have no idea...
It worked flawless for several years.

Another cause might be drop-outs in my internet connection I guess, but I don't have any other indications for that.

Kind regards,
Wil

Whose cloudDB server are you using?

This could be a case of The Tragedy of the Commons.

I use the common MIT CloudDB, I don't have an account of my own.
Do you think that might cause it?

Cheers,
Wil

Most likely

Ok, I'll see what I can do about that.
Thanks for now.

Cheers,
Wil

It might b e easier to switch to something like this:

Once every second should be doable with CloudDB. Our benchmark internally is Sketch and Guess, basically an App Inventor version of Pictionary where the players draw in real time and we have this working in Hong Kong while the server lives at MIT.

Ok, thanks for the additional information.
It worked fine here for years as well.
So I think I will try to find some means of internet continuity monitor.
To make sure there are no gaps in the local internet availability, which may cause the issue.
Today the delay between write and read is generally 2 seconds and then suddenly the next cycle is taking 13 seconds. (on wifi)
Strange...

Why are you even polling? One of the features of CloudDB is that it can notify you when a variable is updated (there is a method block that is called). So you should not need to poll to see if a value changed.

1 Like

Well, probably because I am a rooky and I didn't know that, thanks for the info! :slight_smile:
That method could be a bit faster I think.
BUT, that's not really the issue: Even with the polling once every second my application has run fine 99% of the time.
It checks once per second if the Refresh Flag is set, and if so, it reads a few other data lines to copy these into its settings.
So, if CloudDB doesn't respond we aren't getting anywhere.
And right now I am sure that is the case: Yesterday or the day before I noticed again that the Garden light control App didn't respond and eventually it gave a CloudDB time-out error. This took several minutes. In this timespan I opened a youtube video using the same phone and when that worked fine I retried the Garden App resulting in the same time-out error.
So I switched back and forth a few times loading different videos each time to make sure my wifi connection is fine and at the same time the CloudDB response isn't.
So, for me it is clear that it is CloudDB related, and I am looking to store the necessary data somewhere in my webspace using small PHP commands.

I've made another AI2 app (for radio direction finding) that uses the same method to exchange radio bearings with other hunting teams.
Not my specialty but there are plenty of dark winter evenings coming so a new project will be welcome entertainment.
Thanks again for your suggestion!
Wil.