Performance: Multi-tenant applications
MEDIUM IMPACT
This affects server response time and client rendering speed by how tenant data and UI are loaded and isolated.
import { json } from '@remix-run/node'; export async function loader({ params }) { const tenantId = params.tenantId; const tenantData = await getTenantData(tenantId); return json(tenantData); } // UI renders only tenant-specific data
export async function loader({ params }) { const allTenantsData = await getAllTenantsData(); return json(allTenantsData); } // UI renders all tenants and filters client-side
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Fetch all tenants and filter client-side | High (renders many nodes) | Multiple reflows due to large DOM | High paint cost from many elements | [X] Bad |
| Fetch only current tenant data server-side | Low (renders minimal nodes) | Single reflow | Low paint cost | [OK] Good |