# Best Practices

Here are some best practices to manage performance tradeoffs between transactions and analytics using SingleStore Kai.

## Create Indexes

To improve query performance, SingleStore recommends creating indexes on the collections. Refer to [Understanding Keys and Indexes in SingleStore](https://docs.singlestore.com/cloud/create-a-database/understanding-keys-and-indexes-in-singlestore.md) for more information.

## Faster Transactions (But Lower Resilience)

SingleStore enables `retryWrites` by default, which provides higher resilience against network errors. Disabling the `retryWrites` setting will improve latency for write operations, but the application might need to manually handle errors due to transient network conditions.

```shell
"mongodb://<user>:<password>@svc-XXXX.svc.singlestore.com:27017/?retryWrites=false&authMechanism=PLAIN&tls=true&loadBalanced=true"
```

SingleStore recommends leaving `retryWrites` enabled for ingesting data.

***

Modified at: February 1, 2024

Source: [/cloud/reference/singlestore-kai/best-practices/](https://docs.singlestore.com/cloud/reference/singlestore-kai/best-practices/)

(An index of the documentation is available at /llms.txt)
