Best practices
Patterns and recommendations for building production-ready dcupl applications. These guides cover data modeling, performance optimization, error handling, per-customer data and serving data from exported files.
Data modeling
Structure your data models effectively with proper types, references, and indexing strategies.
Performance
Optimize queries, updates, and memory usage for fast, efficient applications.
Error handling
Handle errors gracefully with retry logic, fallbacks, and recovery strategies.
Per-customer data
Build a portal in which each customer sees only its own rows: your backend in front of a REST API instance.
Serve data from exported files
Keep a legacy source system off the internet: it exports snapshots one way, and dcupl serves only the files.
Quick tips
Note
Initialize Once. Call
init() once at startup, then stage changes with data.update() and apply them with dcupl.update(). Re-initialization is expensive. Note
Use Specific Types. Define properties with specific types like
int, float, boolean instead of storing everything as string. Note
Reuse Lists. Create lists once and reuse them with
query.clear(). Creating new lists has overhead. Note
Limit Reference Depth. Keep reference chains to 2-3 levels. Use derived properties for frequently-accessed deep data.