System Design · Senior · Question 24 of 75

When should you render at the edge, and when in a region near the database?

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.

Further reading

Problem with a question

System Design · Senior · question 24

Test yourself

Take the System Design · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz