Performance

Optimize your Appivo applications for speed and efficiency

Performance Guide

Learn how to optimize your Appivo applications for the best user experience.

Performance Overview

Application performance depends on:

FactorImpact
Data queriesHow efficiently data is retrieved
UI complexityNumber and complexity of widgets
Rule executionHow much processing occurs
Network latencyDistance and connection speed
Asset sizeImages and file downloads

Data Performance

Pagination

Always paginate large data sets:

DataGrid: Orders
Data Source: Order model
Pagination: Enabled
Page Size: 25

Benefits:

  • Faster initial load
  • Less memory usage
  • Better user experience
  • Reduced server load

Filtering at the Source

Apply filters in the data query, not in the UI:

Good: Filter in the data binding

DataGrid: Active Customers
Filter: status = "Active"

Avoid: Loading all records then filtering

DataGrid: Customers
Post-filter: Hide inactive rows

Index Your Data

For frequently queried attributes, configure indexes:

Attribute TypeWhen to Index
Foreign keysAlways
Status fieldsFrequently filtered
Date fieldsDate range queries
Search fieldsText searches

Limit Retrieved Attributes

Only request the attributes you need:

DataGrid: Customer List
Columns: name, email, status

Don't load all 50 attributes when displaying only 3.

UI Performance

Widget Efficiency

Minimize Widget Count

Each widget adds overhead:

  • Use DataGrid instead of individual row widgets
  • Combine labels where possible
  • Remove hidden widgets that are never shown

Simplify Complex Views

Break complex views into:

  • Tabbed sections (load on demand)
  • Detail views (navigate to see more)
  • Modal dialogs (load when opened)

Image Optimization

Use Appropriate Sizes

ContextRecommended Size
Thumbnails100x100 px
List images200x200 px
Detail images600x400 px
Full screen1200x800 px max

Image Best Practices

  • Compress images before upload
  • Use appropriate file formats (JPEG for photos, PNG for graphics)
  • Implement lazy loading for below-the-fold images
  • Use image thumbnails in lists

Conditional Loading

Load content only when needed:

TabContainer: Customer Details
├── Tab: Overview (loads immediately)
├── Tab: Orders (loads when clicked)
├── Tab: History (loads when clicked)
└── Tab: Documents (loads when clicked)

Rule Performance

Efficient Scripts

Minimize Database Operations

// Inefficient: Multiple queries
for (const item of items) {
    const product = await context.getRecord('Product', item.product_id);
    // process...
}

// Better: Single batch query
const productIds = items.map(i => i.product_id);
const products = await context.find('Product', {
    filter: { id: { $in: productIds } }
});

Cache Repeated Lookups

// Cache configuration values
const taxRate = context.getConfig('tax_rate');
const currency = context.getConfig('currency');

// Use cached values in loop
for (const item of items) {
    item.tax = item.price * taxRate;
}

Rule Triggers

Be Specific with Triggers

Rule: Update Order Total
Type: DATA
Trigger: Order line_items modified

Don't trigger on every Order change if you only need line item changes.

Avoid Cascading Updates

Design rules to prevent update loops:

Rule A updates Model X
Model X update triggers Rule B
Rule B updates Model X (loop!)

Use conditions to prevent re-triggering:

if (context.record.total !== calculatedTotal) {
    context.record.total = calculatedTotal;
    // Only updates if actually changed
}

Scheduled Rules

For heavy processing, use scheduled rules:

Use CaseSchedule
Daily reportsOnce per day, off-peak
Data syncEvery hour
CleanupWeekly

Avoid running heavy processes on every data change.

Network Performance

Minimize API Calls

Batch operations where possible:

// Instead of:
await context.createRecord('OrderLine', item1);
await context.createRecord('OrderLine', item2);
await context.createRecord('OrderLine', item3);

// Consider bulk operations when available

Webhook Optimization

For external integrations:

SettingRecommendation
TimeoutSet appropriate limits
RetriesEnable with backoff
PayloadSend only needed data
AsyncUse for non-blocking operations

Offline Support

For mobile apps, configure offline caching:

Offline Models:
  - Product (read-only cache)
  - Customer (sync on connect)

Cache Strategy: Sync when connected

Monitoring Performance

Built-in Monitoring

Appivo provides performance insights:

MetricDescription
Page load timeTime to display view
Query durationDatabase query time
Rule executionScript processing time
API responseExternal call latency

Identifying Bottlenecks

Common performance issues:

  1. Slow page load
    • Too many widgets
    • Large unoptimized images
    • Loading too much data
  2. Slow data operations
    • Missing indexes
    • Complex queries
    • Large record counts
  3. Slow rules
    • Inefficient scripts
    • Multiple database calls
    • External API delays

Performance Testing

Test with realistic data:

TestApproach
Data volumeTest with expected record counts
Concurrent usersSimulate multiple active users
Network conditionsTest on slow connections
Device varietyTest on mobile and desktop

Best Practices Summary

Data

  1. Always paginate lists (25-50 items per page)
  2. Filter at the query level
  3. Index frequently searched fields
  4. Only retrieve needed attributes

User Interface

  1. Minimize widget count
  2. Use lazy loading for tabs and modals
  3. Optimize images for their display size
  4. Test on mobile devices

Rules and Actions

  1. Batch database operations
  2. Cache repeated lookups
  3. Use specific triggers
  4. Schedule heavy processing

Network

  1. Minimize API calls
  2. Configure appropriate timeouts
  3. Enable offline support where needed
  4. Monitor external dependencies

Common Optimizations

Slow List View

Problem: DataGrid takes long to load

Solutions:

  • Enable pagination
  • Reduce visible columns
  • Add filters to limit data
  • Check for missing indexes

Slow Form Save

Problem: Saving records takes long

Solutions:

  • Review triggered rules
  • Check for cascading updates
  • Simplify validation logic
  • Move heavy processing to async rules

Slow Dashboard

Problem: Dashboard loads slowly

Solutions:

  • Reduce widget count
  • Use summary/aggregated data
  • Cache calculated values
  • Load charts on demand

Next Steps