# Document model & indexes

A step of the [Cloud application](https://gradus.kazet.blog/tree/cloud-application) tree on Gradus, in the Data & storage area: DB, cache, queues.

Page: https://gradus.kazet.blog/tree/cloud-application/step/db-document-model

Model the first journey as collections and documents, decide what is embedded and what is referenced and declare the indexes the journey's queries need.

One option of Database: Document database. The others: Managed Postgres.

Usually comes after: [Document database](https://gradus.kazet.blog/tree/cloud-application/step/db-document-provision).

## Prompt for your AI assistant

```
Read docs/product/mvp.md. Design the document model for the first journey: the collections, what each document holds, the composite indexes the journey's queries need and what is embedded and what is referenced and why. Write it to docs/data-model.md, declare the indexes in the infrastructure code and add the model's types to the service.
```

Every step of the tree: https://gradus.kazet.blog/tree/cloud-application/llms.txt
