Common Issues
OCC Conflicts
Symptom: Mutations fail with OCC (Optimistic Concurrency Control) errors when multiple writes happen simultaneously. Cause: Multiple mutations are trying to update the same part of the aggregate B-tree at the same time. Solutions:Use namespaces for isolated data
Use namespaces for isolated data
If your data can be partitioned, use namespaces to isolate each partition in its own tree:Each namespace has its own internal tree, so writes to different games won’t conflict.
Use bounds to reduce read dependencies
Use bounds to reduce read dependencies
Instead of reading the entire aggregate, use bounds to limit your read scope:
Increase maxNodeSize
Increase maxNodeSize
Larger node sizes reduce tree depth and the number of internal nodes:Higher values (32, 64, 128) reduce contention but increase read latency slightly.
Use lazy root aggregation
Use lazy root aggregation
If your root isn’t already lazy (default is true), make it lazy to avoid all writes hitting a single node:
Queries Rerunning Too Often
Symptom: Your frontend is making excessive function calls because queries keep rerunning. Cause: Read dependencies on the aggregate tree are broader than necessary. Solutions:- Use bounds in your queries to limit the dependency footprint:
- Use prefix bounds for grouped data:
- Consider namespacing if queries should be completely isolated.
Incorrect Aggregate Results
Symptom: The count, sum, or other aggregate values don’t match the actual table data. Cause: The aggregate got out of sync with the source table, usually because:- A mutation updated the table but not the aggregate
- Direct writes in the Dashboard bypassed aggregate updates
- A bug in your update logic
Sequential Key Performance Issues
Symptom: All writes are slow and conflict with each other, even with namespaces. Cause: Using sequential keys like_creationTime causes all new items to be added to the same part of the tree.
Solutions:
- Avoid time-based keys for write-heavy workloads:
- Use a hash or randomized key component:
- Use time ranges with namespaces:
Memory or Performance Degradation
Symptom: Aggregate operations become slower over time or use more memory. Cause: The tree may have grown very large, ormaxNodeSize is too small for your dataset.
Solutions:
- Archive old data by using time-based namespaces and clearing old namespaces:
- Increase maxNodeSize if you have millions of items:
- Use pagination instead of loading all items at once:
Getting Help
If you’re still experiencing issues:- Check the Performance section for optimization strategies
- Review the Operations guide for data repair procedures
- File an issue on GitHub with:
- Your aggregate configuration
- Sample data patterns
- Error messages or symptoms
- Performance characteristics (writes/sec, data size, etc.)