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

🛒 Get Extension (Free / Premium)

1. Advantages of Cloudflare D1 for App Builders

2. Extension Setup

Drag the CloudflareDatabase component onto your screen. In the properties panel, enter your Cloudflare Worker endpoint URL and authentication bearer token:

ServerEndpointUrl = "https://your-worker.your-subdomain.workers.dev" SecretAuthToken = "MeraSecretPassword123xyz"

3. Block Implementation

Step 3.1: Fetching Rows or Full Tables

Pass the table name to retrieve all rows as a structured JSON object:

when Button_LoadData.Click do: call CloudflareDatabase.FetchData( tableName: "extensions_data", recordId: "all" // Pass "all" for full table, or a specific ID ) when CloudflareDatabase.OnDataFetched(responseJson, isSuccess) do: if isSuccess then: // Parse JSON and populate listview call ListView1.SetElements(JsonTextDecode(responseJson))

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:

call CloudflareDatabase.UpdateByColumn( tableName: "users", targetColumn: "email", targetValue: "user@example.com", updateJsonPayload: "{\"is_premium\": true, \"credits\": 500}" )

Step 3.3: Safe Wallet Increment / Decrement

// Add 50 reward points safely without concurrency conflicts call CloudflareDatabase.IncrementValue( tableName: "user_wallets", primaryKeyId: "USER-1029", numericColumn: "coins", deltaAmount: 50 )

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!