Performance: CRUD operations with Sequelize
MEDIUM IMPACT
This concept affects server response time and database query efficiency, impacting how fast data changes reflect on the page.
const users = await User.findAll({ attributes: ['id', 'name'], limit: 50 });
const users = await User.findAll();| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Fetching all records without limit | N/A | N/A | N/A | [X] Bad |
| Fetching limited fields and records | N/A | N/A | N/A | [OK] Good |
| Updating without existence check | N/A | N/A | N/A | [X] Bad |
| Updating after existence check | N/A | N/A | N/A | [OK] Good |
| Deleting all records accidentally | N/A | N/A | N/A | [X] Bad |
| Deleting targeted record | N/A | N/A | N/A | [OK] Good |