AsteroidDB
Hi everyone!
I want to introduce you my new database service AsteroidDB which helps you save data online (like Firebase, TinyWebDB) but AsteroidDB is much simplier to setup and its source is open-source.
It’s structrue is based on TinyWebDB, and it is a cloned and improved project from Pavitra’s TinyWebDB repository which coded in Python. I added new methods and named it as AsteroidDB, because it is not a “Tiny” database service anymore And as it is works with HTTP requests, I wrote an extension for App Inventor, so you can use it in App Inventor directly.
Data
AsteroidDB is 2 column data table, tags and values. When you want to get/delete or modify the value of a record you need to know its tags. (Like you do in TinyDB)
Methods
TinyWebDB has 2 methods; get value and store value .
But AsteroidDB has these methods:
-
Store
- Stores a new value or changes existing one. -
Get Value
- Returns a value using its tag. -
Get All Data
- Returns all tags along with values. -
Get All Tags
- Returns all tags. -
Delete
- Deletes one record. -
Format
- Deletes all records. -
Set Password
- Sets a new password or changes the current one. -
Unlock
- Removes password protection. -
Count
- Counts records. -
Is Locked
- Returnstrue
if database is locked with a password. Otherwise,false
. -
Is True
- Returnstrue
if database password is same with entered password, useful for checking the password before connecting to the database.
Events / Methods
Properties
Security
You can set a password to your AsteroidDB instance, setting a password will require a password for every data operation. Password is keeping as a record in database with “dbpass” tag, however no any method will allow you to read the password of course.
Hosting
AsteroidDB is coded with Python and uses Flask, Flask_SQLAlchemy, gunicorn and psycopg2 libraries. So it can be installed on any environment which support these. But I recommend using Heroku (cloud application platform) because it has a one-click deploy feature which allows to create a new AsteroidDB instance with one-click.
Quick Start
-
Click this button and create a Heroku account (if you don’t have one).
-
After end of the build log, Heroku will give you a URL which you can access your deployed app.
-
Open your App Inventor project, Import the AsteroidDB extension and fill the properties.
After that, you can now use blocks to manage your database! That’s it! As you deployed your app on Heroku, it uses your Heroku account’s plan.
Details
However, Heroku’s free plan offers 10.000 rows/records and maximum connection limit is 20. You should pay for Heroku if you want more storage. If you don’t want to host on Heroku, you can host AsteroidDB in VPS also.
Resources
Download Extension
Allows to manage your AsteroidDB instance in App Inventor platform.
Latest AsteroidDB for App Inventor Extension (version v1.1)
Source code of extension:
https://github.com/ysfchn/AsteroidDB-AI2
Docs
Includes example snippets, update guides, method descriptions and with its return types and more!
Source Code
Web Editor
I created a client app for AsteroidDB instances to manage your database online by just typing the database URL and password.
Let me know if you have any questions about AsteroidDB