How do I host my website to 'redis' to use CloudDB on AI2?

1,845 views
Skip to first unread message

Charles Schwedes

unread,
Dec 26, 2018, 9:00:55 PM12/26/18
to MIT App Inventor Forum
Hi,

I have coded a simple CloudDB procedure that seems to work fine on my AI2 app. It uses the provided CloudDB info and is used by all for testing. I have been told I should connect it to my own website, and told this this info is provided by 'redis.io'. I've read their tutorial, downloaded some of their code, which I didn't understand; but was unable to find any information about hosting. Can anyone point my in the right direction? Thanks, Charles

Chris Ward

unread,
Dec 26, 2018, 10:17:12 PM12/26/18
to MIT App Inventor Forum
Hi Charles



...but certainly the MIT documentation is too sparse for anyone to get CloudDB running on their own Web Server.

TimAI2

unread,
Dec 27, 2018, 4:28:17 AM12/27/18
to MIT App Inventor Forum
Here is my howto on setting up your own redis server for AI2 use


you will need full access to the server, e.g. admin permissions to install software, unless you hosting offers redis as an option.

There are also docker containers for redis if you are running a cloud

Chris Ward

unread,
Dec 27, 2018, 9:38:18 AM12/27/18
to MIT App Inventor Forum
Hi Tim

Docker containers?  

TimAI2

unread,
Dec 27, 2018, 11:14:50 AM12/27/18
to MIT App Inventor Forum

Chris Ward

unread,
Dec 27, 2018, 5:54:14 PM12/27/18
to MIT App Inventor Forum
...so nothing to do with Harbours or Ships then :)

Charles Schwedes

unread,
Dec 27, 2018, 6:04:34 PM12/27/18
to MIT App Inventor Forum
Chris Ward,

You're funny. 😉

Yep! All I want to do is replace my mini Texting code with my little CloudDB proc. Seems simple to me, but...

But thanks for your humour. Charles

TimAI2

unread,
Dec 27, 2018, 6:43:20 PM12/27/18
to MIT App Inventor Forum
RedisLabs appear to offer a free 30mb/30user redis server
Not signed up, but tempted....

ABG

unread,
Dec 28, 2018, 1:56:11 PM12/28/18
to MIT App Inventor Forum
I just tried a 30mb freebie signup for redislabs.com,
and came away with credentials without setting up payment.

However, note the lack of persistence on the free plan
(see attached).  That probably means they store the data on the
hood of a car in their parking lot.

The signup might be good for chat or tic tac toe.

ABG

CloudDB account 30 mb.PNG

Charles Schwedes

unread,
Dec 28, 2018, 2:32:42 PM12/28/18
to MIT App Inventor Forum
ABG,

I signed up just like you and was given a 'non-Permanence' note as well. Sounds just like the same service Google offers for CloudDB. I've asked Support for the info I need to update the CloudDB ID, Token, etc. This may be a 'you get what you pay for' offer. Thanks for you comment. Charles

Chris Ward

unread,
Dec 28, 2018, 6:26:44 PM12/28/18
to MIT App Inventor Forum
Hi Charles

If you already have your own website, it shouldn't cost you anything more to set-up CloudDB on it. The only issue is the confused mass of information and unfamiliar terminology - what we all need is a diagram and step-by-step instructions. Given that MIT have already set up there own CloudDB Server, I'm hoping they can deliver these instructions, but bear in mind, they are a very small team climbing a very high mountain.

Charles Schwedes

unread,
Dec 28, 2018, 8:41:23 PM12/28/18
to MIT App Inventor Forum
ABG,

You're absolutely right. It must be a big hurdle for you to climb. I'm very anxious to learn more of CloudDB capabilities. Bet your server support people are working hard to make the product successful.

I am in 'debug' mode with the Redis Labs folk. I hope the Permeance question is a liability tool they put in for free service. My 30mb segment must be all mine for the price. 

Charles

Charles Schwedes

unread,
Jan 3, 2019, 5:10:39 PM1/3/19
to MIT App Inventor Forum
Chris Ward & ABG,

I have asked Redis Labs Support for help. They sent the CloudDB Port, Server & Token info which didn't allow my TestCloudDB to work correctly. In response, CaptureTo_Redis, they suggested, in Redis_1 and Redis_2, you may be able figure out the next steps. You should have the above AIA code,  or I'll happily send you another  copy. The info the Redis people sent is in AI_2Capture. tThink we are making headway. Cheers Charles
CaptureTo_Redis.PNG
Redis_1.PNG
Redis_2.PNG
AI2_Capture.PNG

TimAI2

unread,
Jan 3, 2019, 5:42:28 PM1/3/19
to MIT App Inventor Forum
Works for me if I untick SSL

TimAI2

unread,
Jan 3, 2019, 5:56:46 PM1/3/19
to MIT App Inventor Forum
I created my redislabs account

here is my config page identifying what is needed:

redislabs-setup1.png


Here is setup in designer


redislabs-setup2.png


I then created a simple app that saved names to CloudDB and then retrieved them as a list for selection


BLOCKS


blocksredislabs.png


aia attached (but with cloudDB info removed!)




CDBTest.aia

TimAI2

unread,
Jan 3, 2019, 6:26:44 PM1/3/19
to MIT App Inventor Forum
Have done some further reading, the free version just doesn't offer SSL as an option so storage of personal or other confidential data might be compromised en route.

Charles Schwedes

unread,
Jan 3, 2019, 7:54:13 PM1/3/19
to MIT App Inventor Forum

TimAI,

 

I unchecked the SSL and everything worked great. Thank you and your team for great support. Charles

ABG

unread,
Jan 3, 2019, 9:14:59 PM1/3/19
to MIT App Inventor Forum

TimAI2

unread,
Jan 4, 2019, 1:58:42 AM1/4/19
to mitappinv...@googlegroups.com
Will you let Redis Labs know of the fix, Charles?

EDIT: The entry below is not true, look a few posts down for how to access your RedisLabs data from the command line (TimAI2)

Also, there doesn't seem to be any command line access to the server. If you want all the data, or wish to delete tags and values, you will need to do it in your app.

Charles Schwedes

unread,
Jan 4, 2019, 11:28:44 AM1/4/19
to MIT App Inventor Forum
ABD -->  Your library is excellent! I'll, as usual, add this new link to my library as well. Thanks, Charles

TimAI2 -->  Yes. I thanked Redis Labs for their help passed your assistance on as well.

Your question about 'command line access to the server'. This is new to me. Was I wrong in assuming that when one of my phones is able to send info to another phone, with the same app, that the Redis server was involved? This is early days with my efforts with CloudDB but everything seems to be OK so far. What have I missed?

Thank you both. Charles

Charles Schwedes

unread,
Jan 4, 2019, 1:25:18 PM1/4/19
to MIT App Inventor Forum
TimAI2,

Re: 'command line access'

Sorry, your comment confused me. The app control of the server I believe is the blocks GetDBValues & StoreDBValues. Again, in any case it seems to work. Chales

TimAI2

unread,
Jan 4, 2019, 2:53:19 PM1/4/19
to MIT App Inventor Forum
@ Charles

cli access is just another way of getting at the data on the server.

If I have my own redis server on my own PC, I can login to the server and issue commands

This facility does not seem to be available for the free RedisLabs server

Planning to stress test RedisLabs to see when it goes pop !

Charles Schwedes

unread,
Jan 4, 2019, 3:11:16 PM1/4/19
to MIT App Inventor Forum
TimAI2,

Thanks. Please let me hear what happens to your test pop. 

In any case... how are my two phones communicating with each other? The message must be communicating on someone's server - maybe I'm talking to myself on my wifi/server. Scarry. Thanks Charles

TimAI2

unread,
Jan 4, 2019, 3:47:17 PM1/4/19
to MIT App Inventor Forum
Unlikely they are communicating via wifi.

If they are both using the same app and the redisLabs connection using cloudDB, safe to say that is how they are communicating

Severler

unread,
Jan 4, 2019, 4:36:47 PM1/4/19
to MIT App Inventor Forum
So we can use RedisLab free plan without SSL, thats good.Do you know is there is limit for download ? Whats happen if i use 10GB for each month? anyone know? I m looking firebase alternative.

Thanks for efforts.I tried it before and its not work for me ( I dont try untick ssl :) )

TimAI2

unread,
Jan 4, 2019, 4:49:40 PM1/4/19
to MIT App Inventor Forum
The free plan has a 30 mb storage limit (use more and the oldest records are deleted) and allows for 30 connections at one time. You can of course pay for more.

TimAI2

unread,
Jan 5, 2019, 1:06:46 PM1/5/19
to MIT App Inventor Forum
Command Line Access

Have since found that it is simple to access your RedisLabs database using the command line (redis-cli)


For me: (using Xubuntu Linux)

Install redis-tools to get redis-cli

sudo apt-get install redis-tools


Then using the server, port and password info

redis-cli -h redis-<PORT>.c8.us-east-1-4.ec2.cloud.redislabs.com -p <PORT> -a <PASSWORD>


puts you on the command prompt for redis-cli. You can then look for keys, delete, add etc.

quit

to finish


For Windows users (or those who need a GUI) there are other methods

here is one example: https://redisdesktop.com/
(not tried it, so comes with no recommendation)

Charles Schwedes

unread,
Jan 5, 2019, 1:40:23 PM1/5/19
to MIT App Inventor Forum
TimAI2,

Thanks a lot. I'll appreciate having those Redis tools when I'm ready for more extensive CloudDB features. Charles

TimAI2

unread,
Jan 8, 2019, 8:50:04 AM1/8/19
to MIT App Inventor Forum
Threw some data at the redislabs server to see what would happen

At reset with no tags or data sent by AI2/CloudDB

Ram: 2.26mb
Keys: 1  (?)
Connections: 7

I then created a list of lists from a Mockaroo table with 12 columns and 1000 entries, so 12,000 cells of data.
I added this to 6 different tags, so 72,000 cells of data in all

Ram: 3.05mb
Keys: 7  (?)
Connections: 7

an increase of RAM usage of 0.79mb per 72,000 data/table cells

Extrapolate that out and the free service could provide @ 2.5 million data/table cells (or individual list items) before the service starts thinking about throwing data out, but you will get email alerts before that happens.

Not sure what will happen on the connections front. If only me being connected took up 7 connections then does this mean that only 3 more users could concurrently use the service ?

Severler

unread,
Jan 8, 2019, 11:13:48 AM1/8/19
to MIT App Inventor Forum
Thanks for test.

I m thinking about how its count connection? There is a problem


Do you know gui, some
think likefirebase? How can we see data visual?

TimAI2

unread,
Jan 8, 2019, 11:20:54 AM1/8/19
to MIT App Inventor Forum
Just ran another test created 6 different keys with a single value (just to see if adding tags with little or nothing in them made a difference.

RAM level hardly moved, so it is the data not the structure.

On this occasion only two connections ??

@ Serverier

When you open up your RedisLabs database click on Metrics (should open by default) and change the time to minute

If you mean a data gui, see my post further up about redisdesktop

Charles Schwedes

unread,
Jan 8, 2019, 11:58:38 AM1/8/19
to MIT App Inventor Forum
TimAI2,

That's very interesting. I'll look forward to your more extensive tests. Obviously we'd like know how many subscribers/data we get for free from Redis Labs.

Using 2 tags (I hope my tags are the same as yours), with a slight change to the aia I sent you, I use 4 characters for one and 11 for the other. If 2 subscribers impact the other (let's call it converse) and there are 15 conversation each overwriting the other, there is not a lot of mb created (225 + overhead). I only have 3 android phones so more are needed to test whether or when Redis Labs sends you an email.

Thanks to you & Severier's interest. Charles

Evan Patton

unread,
Jan 8, 2019, 4:12:53 PM1/8/19
to MIT App Inventor Forum
Hi Tim,

Just to clarify, App Inventor uses 3 connections per device. One is to perform atomic operations (get/set), another is the pubsub channel, and the third is to receive updates to keys received over pubsub. Presumably, one of the connections will be from redislabs as you're loading data. I can't speak for the others.

Regards,
Evan

TimAI2

unread,
Jan 8, 2019, 5:59:23 PM1/8/19
to MIT App Inventor Forum
Thanks Evan

Just hit the wall (30 connections!) Only me, working with companion app, setting up a simple contact database (12 columns @ 25 entries)
Only loading and calling 1 tag

Will contact redislabs about this to try to better understand connections and how best to manage them when developing / using....

Severler

unread,
Jan 9, 2019, 6:21:58 AM1/9/19
to MIT App Inventor Forum
So free plan capacity is 10 active user.Why redis lab count more?

Reply all
Reply to author
Forward
0 new messages