# Data Prerequisites

The data that Asyncher must process obviously needs some more information to be able to synchronize it. In addition to having its attributes, the data **must have additional fields** that are needed to perform the synchronization.

{% hint style="info" %}
The choice of the names of the fields that I am about to list is totally free. [See the configuration here](https://asyncher.convertino.cloud/features/configuration).
{% endhint %}

***

### Client & Server Side

* **`unique: string`**: In general your data will need a field that uniquely identifies the data itself.

{% hint style="warning" %}
An incremental ID cannot be used as a unique key, because the data in the database on the server will have a different ID from the database on the client.
{% endhint %}

***

### Client Side

* **`is_new: boolean`**: The data arriving from the client is actually new and must be added to the server.
* **`updated: boolean`**: The data arriving from the client has been edited and must be updated on the server.
* **`deleted: boolean`**: The data has been deleted on the client and must also be deleted on the server.

{% hint style="info" %}
If you need not directly delete the data on the server but would like to have a trash bin or simply a history of all your data, see [auditing](https://asyncher.convertino.cloud/features/auditing).
{% endhint %}

These fields are managed directly by you. So if any of your data is edited you will have to set the `updated` attribute to `true` before synchronizing. As well as for `is_new` and `deleted`.

***

### Server side

The data on the database server doesn't need any particular fields. However, there are optional fields that can be [configured](https://asyncher.convertino.cloud/features/configuration).

***

### Example

Let's take an example. The data we want to synchronize has 3 fields `(id, name, surname)`. The data model on the server and client will be:

| Data model client side | Data model server side                                                        |
| ---------------------- | ----------------------------------------------------------------------------- |
| id                     | id                                                                            |
| name                   | name                                                                          |
| surname                | surname                                                                       |
| unique                 | unique                                                                        |
| is\_new                | [created\_at (optional)](https://asyncher.convertino.cloud/features/auditing) |
| updated                | [updated\_at (optional)](https://asyncher.convertino.cloud/features/auditing) |
| deleted                | [deleted\_at (optional)](https://asyncher.convertino.cloud/features/auditing) |
