---
title: Conflict Handling
slug: best-practices/conflict-handling
docTags: 
createdAt: 2024-09-11T18:44:17.218Z
---

## Conflict Handling

In mesh networking, where multiple devices share and sync data, conflict handling is crucial for data consistency. Here are some best practices:

1. **Version Control with Metadata**: Each peer maintains a metadata database, storing version vectors to track updates and avoid conflicts during data merging.
2. **Deterministic Merging**: Ensure eventual consistency by adopting deterministic methods. Regardless of update order, all peers should converge on a single value.
3. **Meaningful Resolution**: Conflicting data should be merged predictably, representing the original inputs in a logical way.

For more information, see [Mesh Networking](https://docs.ditto.live/sync/concepts/mesh-networking-101).
