Hello, I have created a free account at redislabs.com (30 MB, 30 connections) in order to learn how to use the CloudDB block in AI2.
I was wondering if some way exists to reduce the number of simultaneously open Redis connections using CloudDB. I mean, opening the connection, performing the read and write operations needed, then closing the connection until it is needed the next time (perhaps some minutes later).
If I understand well, the connection with the Redis server is established as soon as my app is started and it will be kept permanently open until the app is killed. Is this assumption correct?
My assumption is based in what I am experiencing when I enable the “UseSSL” option. Please see SSL connection error when connecting to a Redis CloudDB. As I am showing any Redis errors on screen, I noticed that the first error shows up immediately when the app is started. After that, it keeps trying to reconnect forever, so that I get a new error through the CloudDBError event every 4 seconds.
After a few weeks investigating all the options AI2 offers for persistence of data in the cloud, my conclusion is that there are none that people can easily use. I’m sorry, in each of them I found some kind of problem.
Via CloudDB, which seems the most powerful and interesting, the problem is concurrent connections. If you intend to create an app that can have some success and is used by hundreds of people, the price to be paid to Redis (or other providers) may be high. Or you have to deploy your own Redis server.
On the other hand, if you opt for the traditional DB route, TinyWebDB does not offer you compatibility with the main cloud storage providers. So again, you have to deploy your own DB server.
Are you missing something David? Yes. Not everything in life is free.
No database is perfect. If you want to develop a sophisticated app that is used by hundreds of people using a database, consider using the professional Android Studio and using one of the dozens of commercial databases ( alternative databases are discussed here: https://groups.google.com/forum/#!msg/mitappinventortest/MRp3w3X-ecg/zwLL6wM1AgAJ. )
Android Studio is free; many of the database alternatives to the MIT CloudDB incur charges to the developer. i.e. Firebase (which has a certain amount of free usage, then starts charging)
If you use the MIT CloudDB, you should:
use your own server and maintain it using the Redis database. To run 24/7, you maintain the server, pay your isp and your power bill.
or
Use the Redis server and pay them for their services, and costs
TinyWebDB … yes “you have to deploy your own DB server.”
If you cannot afford server fees because your app does not generate sufficient revenue, consider using a GoogleSpreadsheet on your GoogleDrive and use it as a database… that is ‘free’
It’s something we can think about. One of those connections is the one to push data changed events from the server to the device, so we can’t really get rid of that without breaking that functionality. It’s possible the other two could have some timeout associated with them, but we would need to think what a reasonable default might be. A project that we do as part of our work is called Sketch and Guess, which is a two player game where someone draws something and the other person has to guess. The drawing happens in as close to real time as possible. If we opened and closed a connection for every transaction, that would severely impact the performance. However, I accept that not every use of CloudDB will need low latency and that there might be more economical ways to handle those transactions.