Traditional vs PriceIndex Payment
| Aspect | Traditional (BTree/Hash) | PriceIndex |
|---|---|---|
| Cost basis | Data size | Field value |
| Formula | cost = data_size_kb * rate | cost = field_value |
| Revenue sharing | None | Automatic |
| Example | 10 KB order costs ~$0.001 USDC | 100 USDC |
How It Works
Creating a PriceIndex
Using PriceIndex in Applications
Use Cases
PriceIndex is perfect for:| Use Case | PriceIndex Field |
|---|---|
| E-commerce | orderTotal |
| Ticketing | ticketPrice |
| Marketplace | transactionAmount |
| Subscriptions | planPrice |
| Service fees | feeAmount |
- Product catalogs (use BTree for filtering by price range)
- Free/public data storage
- Internal analytics data
- User-generated content without pricing
Complete E-commerce Example
Checking App Wallet Balance
Your application’s revenue share is credited to the app wallet balance:Revenue Split Configuration
The default revenue split is:- 80% to the application owner
- 20% to the platform (OnDB)
createWriteIndex():
Next Steps
Paid Reads
HTTP 402 for read operations
Cost Estimation
Estimate operation costs