Performance: Migrations
MEDIUM IMPACT
Migrations affect the initial page load speed and backend response time by managing database schema changes efficiently.
await connection.runMigrations(); // run only pending migrationsawait connection.synchronize(true); // auto-sync schema on every app start| Pattern | Backend Delay | User Request Impact | LCP Impact | Verdict |
|---|---|---|---|---|
| Full schema sync on startup | High (500ms+) | Blocks startup | High | [X] Bad |
| Incremental migrations on startup | Low (under 100ms) | No block on requests | Low | [OK] Good |
| Migrations during user requests | High | Blocks user input | High | [X] Bad |
| Migrations before requests | Low | No block on user input | Low | [OK] Good |