[FREE] 🗄️BigDB - Advanced key-value storage with TTL, metadata, multi-table support, encryption, and more

🧩 BigDB

Extension for MIT AI2
BigDB - Advanced key-value storage with TTL, metadata, multi-table support, encryption, and more
My Other Extensions
Built by Sarthak Gupta

BigDB is a feature-rich, scalable, and secure alternative to TinyDB, designed for complex App Inventor projects. Its support for multi-table storage, TTL, encryption, asynchronous operations, and advanced querying makes it ideal for modern, data-intensive applications. Whether you're building a secure app, managing large datasets, or needing real-time notifications, BigDB provides the tools to elevate your App Inventor projects! :star2:

Benefits of BigDB vs. TinyDB in App Inventor :rocket:

BigDB (com.bigdb) is a powerful key-value storage extension for App Inventor, offering advanced features that surpass the capabilities of TinyDB. Below are the key advantages of using BigDB, with comparisons to TinyDB:

Feature BigDB TinyDB Benefit
Multi-Table Support :clipboard: Supports multiple tables for organized data (SetTable). Single namespace only. Better data organization and scalability. :star2:
TTL (Time-to-Live) :alarm_clock: Set expiration times (Expire, PurgeExpired). No TTL support. Automates data lifecycle management. :hammer_and_wrench:
Metadata Support :memo: Store and query metadata (SetMetadata, FindByMetadata). No metadata support. Enhances data searchability and context. :mag:
Encryption :lock: Database encryption (SetPassword, IsEncrypted). No encryption. Protects sensitive data. :shield:
Asynchronous Operations :zap: Async data retrieval (Get, Keys). Synchronous operations. Improves app responsiveness. :rocket:
Bulk Operations :package: Bulk store/delete (BulkStore, BulkDelete). Individual operations only. Speeds up large dataset management. :chart_with_upwards_trend:
Data Import/Export :outbox_tray::inbox_tray: CSV and JSON support (ExportCSV, ImportJSON). No built-in import/export. Simplifies data portability. :floppy_disk:
Change Notifications :bell: Watch key changes (Watch, Unwatch). No notifications. Enables reactive programming. :satellite:
Advanced Querying :mag_right: Query by metadata, JSON records (FindByMetadata, GetRecord). Basic key-value retrieval. Supports complex data operations. :bar_chart:
Database Management :straight_ruler: Check size, list tables (DBSize, ListTables). No such utilities. Improves storage monitoring. :toolbox:
Indexing :gear: Automatic key indexing for faster lookups. No indexing. Enhances query performance. :racing_car:
Error Handling :stop_sign: Robust error reporting (ErrorOccurred). Limited error feedback. Simplifies debugging and reliability. :white_check_mark:

:memo: Specifications


:package: Package: com.bigdb
:floppy_disk: Size: 33.66 KB
:gear: Version: 1.0
:iphone: Minimum API Level: 7
License: Free Extension License
:date: Updated On: 2025-05-24T18:30:00Z
:computer: Built & documented using: FAST-CLI v3.4.0

Blocks

Events:

BigDB has total 4 events.

:yellow_heart: DataChanged

DataChanged_Event
Fires when data changes in the current table

:yellow_heart: ErrorOccurred

ErrorOccurred_Event
Fires when an error occurs

Parameter Type
message text

:yellow_heart: Got

Got_Event
Fires when a value is retrieved

Parameter Type
queryId text
value text

:yellow_heart: KeyList

KeyList_Event
Fires when a key list is returned

Parameter Type
queryId text
keys any

Methods:

BigDB has total 28 methods.

:purple_heart: BulkDelete

BulkDelete_Method
Delete multiple keys

Parameter Type
keys list

:purple_heart: BulkStore

BulkStore_Method
Store multiple key-value pairs

Parameter Type
keys list
values list

:purple_heart: Clear

Clear_Method
Clear all data in the current table

:purple_heart: Count

Count_Method
Get total record count in current table

:purple_heart: DBSize

DBSize_Method
Get database file size in bytes

:purple_heart: Delete

Delete_Method
Delete a key

Parameter Type
key text

:purple_heart: Exists

Exists_Method
Check if a key exists

Parameter Type
key text

:purple_heart: Expire

Expire_Method
Set expiry time in seconds for a key

Parameter Type
key text
seconds number

:purple_heart: ExportCSV

ExportCSV_Method
Export current table as CSV to the specified file path. If filePath is empty, uses the app's external files directory.

Parameter Type
filePath text

:purple_heart: ExportJSON

ExportJSON_Method
Export current table as JSON string

:purple_heart: FindByMetadata

FindByMetadata_Method
Find keys by metadata substring asynchronously

Parameter Type
query text
queryId text

:purple_heart: Get

Get_Method
Get the value for a key asynchronously

Parameter Type
key text
queryId text

:purple_heart: GetMetadata

GetMetadata_Method
Get metadata for a key

Parameter Type
key text

:purple_heart: GetRecord

GetRecord_Method
Get full record as JSON asynchronously

Parameter Type
key text
queryId text

:purple_heart: GetTTL

GetTTL_Method
Get remaining TTL in seconds for a key (0 if none or expired)

Parameter Type
key text

:purple_heart: ImportCSV

ImportCSV_Method
Import data into current table from CSV

Parameter Type
filename text

:purple_heart: ImportJSON

ImportJSON_Method
Import data into current table from JSON

Parameter Type
json text

:purple_heart: IsEncrypted

IsEncrypted_Method
Check if database is encrypted

:purple_heart: Keys

Keys_Method
List all keys in the current table asynchronously

Parameter Type
queryId text

:purple_heart: ListTables

ListTables_Method
List all tables in database

:purple_heart: PurgeExpired

PurgeExpired_Method
Purge expired keys from the current table

:purple_heart: RemovePassword

RemovePassword_Method
Remove encryption (PRAGMA rekey to empty)

:purple_heart: RenameKey

RenameKey_Method
Rename a key

Parameter Type
oldKey text
newKey text

:purple_heart: SetMetadata

SetMetadata_Method
Set metadata for a key

Parameter Type
key text
metadata text

:purple_heart: SetPassword

SetPassword_Method
Set database encryption password (PRAGMA key)

Parameter Type
pwd text

:purple_heart: Store

Store_Method
Store a value for a key with optional TTL and metadata

Parameter Type
key text
value text
useTTL boolean
ttlSeconds number
metadata text

:purple_heart: Unwatch

Unwatch_Method
Stop watching changes to a key

Parameter Type
key text
queryId text

:purple_heart: Watch

Watch_Method
Watch changes to a key in the current table

Parameter Type
key text
queryId text

Setter:

BigDB has total 1 setter property.

:green_heart: SetTable

SetTable_Set_Property
Set the current table to operate on

  • Input type: text

Download the extension! :tada:

This is a big project and I am making it available for free to the community. If you like my work please support here. It will make my day :smile:

BigDB V1 (1.0)- Released on 25/02/25

Please share any feedback below! I will be happy to answer any questions. My other extensions are available here.

Regards
Sarthak Gupta

5 Likes

is this database locally or online?
if locally, why we need to watch the data change event? isn't it changed by yourself?

2 Likes

This database works locally. The 'Data Changed' event is returned whenever Data is changed in the table. The data although changed automatically, the event comes really handy for showing notifiers etc.
The purpose of the extension is to address the limitations of TinyDB combined with the features of SQLite in native android development.

Bulk Store, Bulk Delete, Watching for changes to a key, TTL, Metadata, Encryption, Renaming Keys, Data Export / Import as Json, csv and endless utilities like DBSize, Clear are offered by BigDB

why the data will change automatically?

1 Like

I was referring to the use of a block like BulkStore or BulkDelete. These blocks will change the database and then the DataChanged event will be returned.

Maybe to enforce relational integrity after the fact?

1 Like

BigDB has many features including indexing the database.

Just clarifying, @Kevinkun asked about the Data Changed event and what was its need. I was trying to say that Data is changed as soon as an operation is used like Bulk store and the event is returned indicating the operation to be successful.