Skip to main content

Performance Optimization

Learn how to optimize your Cocobase application for maximum speed and efficiency.

Query Optimization

Always Use Limits

Select Only Required Fields

Use Efficient Filters


Pagination Strategies

Offset Pagination

Good for small datasets with random page access:

Cursor Pagination

Better for large datasets and infinite scroll:

Caching Strategies

In-Memory Caching

React Query / SWR Integration

Flutter Caching


Batch Operations

Batch Creates

Batch Updates

Parallel Fetching


Real-time Optimization

Debounce Updates

Selective Real-time Subscriptions

Cleanup Subscriptions


Image and File Optimization

Lazy Loading Images

Compress Before Upload


Database Design Tips

Denormalize for Read Performance

Use Computed Fields


Monitoring Performance

Track Query Times

Performance Checklist

  • All queries have limits
  • Using field selection where possible
  • Batch operations for multiple items
  • Caching frequently accessed data
  • Real-time subscriptions cleaned up
  • Images compressed before upload
  • Lazy loading for images
  • Parallel fetches where possible
  • Denormalized data for read-heavy paths

Next Steps

Best Practices

General development best practices

Security

Secure your application

Querying

Advanced query techniques

Real-time

Real-time data sync