Firebase Realtime Database has traditionally been the go-to backend for Kodular creators. However, as applications scale to thousands of users, Firebase's document-based pricing model can quickly become exorbitant. Moreover, executing complex SQL queries, relational table joins, and atomic wallet calculations in Firebase requires complicated Cloud Functions.
The Cloudflare D1 Database extension (.aix) connects your Kodular and App Inventor apps directly to Cloudflare's serverless distributed SQL database. With zero server management, sub-50ms global latency, and massive free allowances, D1 is the ultimate modern backend for mobile apps.
Cloudflare Database Extension (.aix)
Serverless Multi-Table SQL • Async CRUD • Concurrency-Safe Math
1. Advantages of Cloudflare D1 for App Builders
- Native SQL Engine: Write standard SQL (SELECT, INSERT, UPDATE, DELETE, ORDER BY, LIMIT) with ease.
- Fully Asynchronous: All network queries execute in background threads—your app's UI will never freeze.
- Concurrency-Safe Math: Safely increment or decrement user wallet balances, coins, or scores without collision errors.
- Multi-Table Operations: Manage multiple tables (Users, Purchases, Products, Notifications) in a single database.
2. Extension Setup
Drag the CloudflareDatabase component onto your screen. In the properties panel, enter your Cloudflare Worker endpoint URL and authentication bearer token:
3. Block Implementation
Step 3.1: Fetching Rows or Full Tables
Pass the table name to retrieve all rows as a structured JSON object:
Step 3.2: Updating Records by Column Value
Unlike basic extensions that only allow updates via primary row IDs, Cloudflare Database lets you update any record using a custom column filter:
Step 3.3: Safe Wallet Increment / Decrement
Conclusion
Switching to Cloudflare D1 gives your mobile apps enterprise-grade database speed and reliability without the monthly server bills. Download the Cloudflare Database extension on AIX Hub Store today!