Frontend School
DashboardProblemsLearnPracticeMock InterviewReportsStatsBuy Credits
DashboardProblemsLearnPracticeMock Interview
Frontend System Design Roadmap
  1. 1.HTTP/1.1 vs HTTP/2 vs HTTP/3 (QUIC)
  2. 2.TCP and TLS Handshakes: Connection Setup Costs
  3. 3.Browser Network Stack and Connection Pooling
  4. 4.GET vs POST and Idempotency in HTTP
  5. 5.The Critical Rendering Path (CRP)
  6. 6.DOM, CSSOM and the Render Tree
  7. 7.Layout, Paint and Compositing
  8. 8.Reflows and Repaints Explained
  9. 9.Event Loop: Call Stack, Task and Microtask Queues
  10. 10.Async JavaScript: Promises and async/await
  11. 11.Web Workers: Multi-threading in the Browser
  12. 12.Browser Storage: Cookies, Web Storage, IndexedDB
  13. 13.Client-Side Storage: Limits and Security Risks
  14. 14.Choosing the Right Client-Side Storage
  15. 15.HTTP Caching: Cache-Control, ETag, Last-Modified
  16. 16.Browser-Level Caching Mechanisms
  17. 17.Cache Invalidation for Frontend Apps
  18. 18.Structuring a Large Single-Page App
  19. 19.Component-Based Architecture Principles
  20. 20.Props, State and Component Lifecycle
  21. 21.Module Bundling Basics
  22. 22.Core Web Vitals: LCP, INP and CLS
  23. 23.FCP and Time to Interactive (TTI) Explained
  24. 24.Measuring Performance: Lighthouse and WebPageTest
  25. 25.Asset Compression and Minification Basics
  26. 26.What Is a CDN and How Does It Work?
  27. 27.CDN Benefits: Latency, Availability, Offload
  28. 28.CDN Cache Behavior and Invalidation
  29. 29.Global State vs Local Component State
  30. 30.State Patterns: Redux, Zustand and Context
  31. 31.Data Fetching: React Query and SWR
  32. 32.Immutable Data in Frontend State
  33. 33.SSR vs CSR: Rendering Trade-offs
  34. 34.Hydration and Time to First Byte (TTFB)
  35. 35.Static Site Generation (SSG) for Speed and SEO
  36. 36.Incremental Static Regeneration (ISR)
  37. 37.Micro-Frontends: Core Principles
  38. 38.Micro-Frontend Integration Strategies
  39. 39.Communication Between Micro-Frontends
  40. 40.Micro-Frontends: Pros and Cons for Large Teams
  41. 41.Real-Time: Polling, SSE and WebSockets
  42. 42.Real-Time Use Cases: Chat, Alerts, Live Data
  43. 43.Designing a Real-Time Data Flow
  44. 44.Scaling WebSocket Connections
  45. 45.Responsive Images: srcset, sizes and picture
  46. 46.Modern Image Formats: WebP, AVIF, JPEG XL
  47. 47.Lazy Loading Images and Videos
  48. 48.Video Streaming: HLS, DASH, Adaptive Bitrate
  49. 49.REST and GraphQL for Frontend Engineers
  50. 50.Batching, Throttling and Debouncing API Calls
  51. 51.Handling API Errors in the Frontend
  52. 52.Authentication Flows: OAuth and JWT
  53. 53.Global Error Boundaries in React
  54. 54.Error Reporting: Sentry and LogRocket
  55. 55.Graceful Degradation and Fallback UIs
  56. 56.Real User Monitoring (RUM)
  57. 57.CORS: Cross-Origin Resource Sharing
  58. 58.Preventing XSS (Cross-Site Scripting)
  59. 59.CSRF Protection for Frontend Apps
  60. 60.Content Security Policy (CSP)
  61. 61.Storing Auth Tokens: Cookies vs localStorage
  62. 62.PWA Manifest and Installability
  63. 63.Service Workers: Lifecycle and Caching Strategies
  64. 64.Offline Support and Background Sync
  65. 65.Push Notifications for Web Apps
  66. 66.Webpack vs Vite vs Parcel
  67. 67.Code Splitting, Tree Shaking, Asset Optimization
  68. 68.Module Resolution and Hot Module Replacement
  69. 69.Monorepo Tooling: Nx and Lerna
  70. 70.Atomic Design for Component Libraries
  71. 71.Theming and Customization in Design Systems
  72. 72.Accessibility in Component Libraries
  73. 73.Component Library Docs, Testing and Versioning
  74. 74.Publishing and Consuming a Component Library
  75. 75.Full-Text Search: Levenshtein and Fuzzy Matching
  76. 76.Indexing Large Datasets in the Browser
  77. 77.Search Performance: Debouncing and Web Workers
  78. 78.Integrating Backend Search Services
  79. 79.Choosing a Chart Library: D3, Chart.js, Recharts
  80. 80.Rendering Large Datasets: Canvas vs SVG
  81. 81.Interactive, Responsive Data Visualizations
  82. 82.Data Fetching and Aggregation for Dashboards
  83. 83.A/B Test Design and Rollout Strategies
  84. 84.Client-Side vs Server-Side A/B Testing
  85. 85.Feature Flags and Remote Configuration
  86. 86.Experiment Data Collection and Analytics
Frontend System Design Roadmap
33

Frontend System Design · Lesson 33 of 86 · 4 min

SSR vs CSR: Rendering Trade-offs

In an interview, you'll be asked to choose a rendering strategy. This is how you justify it.

How to Frame the Core Trade-off

The choice between Client-Side Rendering (CSR) and Server-Side Rendering (SSR) is about who does the work of turning data and components into HTML, and when.

In CSR, the server sends a nearly empty HTML file and a JavaScript bundle. The browser runs the JS, fetches data, and renders the page. The user sees a spinner.

In SSR, the server fetches the data and renders the full HTML for the page before sending it. The browser can display it immediately. The user sees content.

This is the fundamental trade-off: a slow first paint (CSR) versus a potentially slow first interaction (SSR). Every other consideration—SEO, server cost, code complexity—stems from this.

When to Justify SSR

Choose SSR when your primary goals are a fast initial paint and strong SEO. This is typical for content-driven sites: e-commerce product pages, blogs, news articles, and marketing landing pages.

The key benefit is a fast First Contentful Paint (FCP) and Largest Contentful Paint (LCP). The user sees meaningful content quickly because the browser receives a complete HTML document. Search engine crawlers also see this complete document, which is ideal for indexing.

The interview angle: When you propose SSR, immediately mention the metrics you aim to improve: LCP and FCP. State that for a public-facing page like a product description, getting content in front of the user and Google's crawler is the top priority.

This is the typical flow for an SSR request. Notice the work done on the server before any HTML is sent.

The trade-off is server load and complexity. Your server is now a Node.js process running React, not just a static file server. It uses more CPU and memory, increasing hosting costs.

The Hidden Cost of SSR: Hydration

The trap: Many candidates praise SSR for performance but ignore its biggest pitfall: Time to Interactive (TTI).

A user sees a fully rendered SSR page, tries to click a button, and nothing happens. The page looks ready, but the JavaScript that attaches event listeners hasn't finished downloading, parsing, and executing. This process is called hydration.

A large JS bundle can make the TTI significantly later than the FCP, creating a frustrating "rage click" scenario. You've optimized for the perception of speed but failed on the reality of usability.

When you recommend SSR, you must also propose a strategy to manage hydration cost. This shows you understand the full picture. Mention techniques like code-splitting your JS bundles, or using frameworks like Astro that promote partial hydration (shipping zero JS by default for static components).

When to Justify CSR

Choose CSR for applications that are highly interactive and don't rely on public SEO for discovery. Think admin dashboards, internal tools, or complex, stateful UIs like a design tool or a social media feed behind a login.

After the initial load, a CSR application (a Single-Page App or SPA) feels fast. Navigating between "pages" is just a client-side route change, often involving a quick API call for data and re-rendering a small part of the UI. There are no full-page reloads. This provides a fluid, app-like experience.

Development is also simpler. You have a clear separation: a static frontend application that consumes a backend API. This decouples your teams and your deployments. Server costs are lower because the server's main job is just serving static assets and JSON.

The trap: Don't defend CSR by saying "Google can crawl JavaScript now." While true, it's not guaranteed, it takes longer, and it's less reliable than providing plain HTML. If SEO is a business requirement, CSR is the wrong default choice for public-facing content.

What the Browser Receives

The difference is clearest when you see the initial HTML payload. An SSR server does the work of fetching data and building the HTML before sending a response.

Here is a conceptual Express server doing just that. The browser gets a fully-formed document.

// server.ts (conceptual SSR with Express)
import express from 'express';
import axios from 'axios';

const app = express();

app.get('/', async (req, res) => {
    // 1. Fetch data on the server
    const response = await axios.get('https://.../posts?_limit=3');
    const posts = response.data;

    // 2. Render HTML string on the server
    const postsHtml = posts.map(post => `
        <div>
            <h3>${post.title}</h3>
            <p>${post.body}</p>
        </div>
    `).join('');

    const fullPageHtml = `
        <!DOCTYPE html>
        <html>
        <head><title>SSR Example</title></head>
        <body>
            <h1>Latest Posts</h1>
            <div id="root">${postsHtml}</div>
            <script src="/client.js"></script> <!-- For hydration -->
        </body>
        </html>
    `;

    // 3. Send the complete HTML document
    res.send(fullPageHtml);
});

app.listen(3000);

In a CSR world, the div#root would be empty. The browser would have to run client.js to fetch the posts and generate the same markup.

Try it

You are designing a product detail page for an e-commerce site. In a document, outline which rendering strategy you'd choose. List the top 3 business and performance metrics you'd use to justify your decision and explain why each is important.

Next: We'll dig deeper into the concept of making server-rendered pages interactive in Hydration and Time to First Byte (TTFB).

Lock it in — apply this lesson under interview conditions.

Try a free mock interviewPractice system design problems
Previous

Immutable Data in Frontend State

Next

Hydration and Time to First Byte (TTFB)