diff --git a/agent_docs/architecture.md b/agent_docs/architecture.md index d9eeb2640..85c2739d8 100644 --- a/agent_docs/architecture.md +++ b/agent_docs/architecture.md @@ -133,6 +133,10 @@ Note: Background tasks do **not** run in Vercel preview deployments (see - **Relationships**: Use ObjectId references with proper population - **Indexing**: Strategic indexes for query performance - **Migrations**: Versioned migrations for schema changes (see `packages/api/migrations/`) +- **No read-after-write**: Some deployments send reads + to replicas, which can lag the primary. Don't re-query a document you just + wrote; respond from what the write returned (`Model.create(...)`, + `findOneAndUpdate(..., { new: true })`). ## Security Requirements