# Best practices

Patterns and recommendations for building production-ready dcupl applications. These guides cover data modeling, performance optimization, and error handling strategies.

- [Data modeling](/learn/best-practices/data-modeling) — Structure your data models effectively with proper types, references, and indexing strategies.
- [Performance](/learn/best-practices/performance) — Optimize queries, updates, and memory usage for fast, efficient applications.
- [Error handling](/learn/best-practices/error-handling) — Handle errors gracefully with retry logic, fallbacks, and recovery strategies.

## 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.

## Related

- [Performance Guide](/sdk/advanced/performance) — Advanced performance optimization
- [Caching](/sdk/advanced/caching) — Caching strategies
- [Quality Validation](/sdk/advanced/quality-validation) — Data validation and quality checks
- [Common mistakes](/sdk/guides/common-mistakes) — Avoid typical pitfalls
