System Design · Senior · Question 24 of 75
When should you render at the edge, and when in a region near the database?
- ✓Correct answer: Edge for light logic, region for frequent DB queries
- 2Edge is always faster, regardless of where the data lives
- 3A region is always faster; the edge is only for static assets
Explanation
The edge is close to the user, but if a page makes five sequential DB queries across an ocean, each adds hundreds of milliseconds. Rendering near the data plus CDN caching often wins. The edge is good for redirects, A/B tests, cookie-based personalization and auth.