Skip to content

Understanding Backend Architecture: How Requests Travel and Why Backends Matter

What is a Backend Server?

A backend server is a computer listening on open network ports (such as 80 or 443) to handle HTTP, WebSocket, or gRPC requests from clients or frontends. It serves content like static files (images, JavaScript, HTML) or dynamic data (JSON) and processes incoming data submissions.

Tracing a Request: Browser to Backend Server

  • Domain Resolution via DNS: The browser begins by resolving the domain name through the DNS server, which contains records pointing subdomains to specific IP addresses. This is part of The Hidden Magic Behind Accessing Your Favorite Websites.
  • AWS EC2 Instance: The resolved IP points to an AWS EC2 instance where the backend server is hosted. For more on key AWS services, see Top AWS Services Explained for Beginners: EC2, S3, IAM & More.
  • Firewall and Security Groups: Incoming requests must pass AWS security groups that define allowed ports such as HTTP (80) and HTTPS (443). If these ports are blocked, requests never reach the server.
  • Reverse Proxy (NGINX): NGINX acts as a reverse proxy on the EC2 instance, listening on standard ports and forwarding requests to the node server running locally (e.g., on port 3001). This setup provides centralized management of SSL certificates and request routing.
  • Node Server: The actual backend application runs as a Node.js process, handling the request, performing necessary logic, and sending back responses. To understand more about how Node.js servers handle requests and HTTP nuances, refer to Comprehensive Guide to HTTP Protocol and Express.js for Web Developers.

Why Do We Need Backends?

Backends centralize data handling and processing. For example, when you "like" a post on Instagram:

  • Your action sends a request to the backend.
  • The backend identifies you and the post owner.
  • It updates the database to record the like.
  • It triggers notifications to the post owner. This centralized management is essential for consistent data integrity, user-specific customization, and synchronization.

Why Not Put Backend Logic in the Frontend?

  • Security Restrictions: Browsers run code in sandboxed environments restricting file system access and limiting what external APIs can be called due to CORS policies.
  • Limited Database Access: Browsers cannot maintain persistent database connections or run native database drivers, which require socket connections and connection pooling.
  • Performance Constraints: Frontend devices vary widely in computing power; complex business logic and heavy data processing could cause lag or crashes.
  • Connectivity and Resource Management: Backend servers efficiently handle thousands of requests with connection pooling and optimized resource usage.

How Frontends Work Differently

Frontends (like a Next.js app) serve HTML, CSS, and JavaScript files to browsers. The browser fetches these resources, applies styles, and executes JavaScript to manage user interactions locally. This means the browser runs the code, unlike a backend, which processes requests centrally. For a deeper dive into the browsing and data travel process, see The Hidden Magic Behind Browsing: How Your Data Travels the Internet.

Summary of Request Journey

  1. Browser requests domain.
  2. DNS resolves domain to IP.
  3. Request passes AWS firewall (security group).
  4. NGINX reverse proxy receives request.
  5. NGINX redirects request to Node.js backend on localhost.
  6. Backend processes data, interacts with databases, and sends response.
  7. Response reaches browser.

Understanding this flow clarifies the distinct roles of frontend and backend components, the need for backend servers, and the architectural decisions guiding their design and deployment. This knowledge forms a strong foundation for learning backend engineering principles and best practices. To explore architectural principles further, consider reading Understanding Hexagonal Architecture: Transforming MVC Applications.

Keep this summary

Save it to LunaNotes and it becomes a real note in your library — editable, searchable, and ready to turn into flashcards or a diagram. Free to start.

Save to LunaNotes

Or summarise for another video.

This summary and transcript were automatically generated using AI with the Free YouTube Transcript Summary Tool by LunaNotes.

Related summaries

HTTP Protocol Fundamentals: Statelessness, Methods, CORS, Caching, and Status Codes for Backend Developers

HTTP Protocol Fundamentals: Statelessness, Methods, CORS, Caching, and Status Codes for Backend Developers

This comprehensive guide explains core HTTP concepts every backend developer needs to know, covering stateless architecture, request/response headers, methods, status codes, CORS flow, caching strategies, content negotiation, and large data transfer. You'll learn why HTTP is stateless, how browsers handle cross-origin requests with preflight checks, and practical ways to optimize performance using caching and compression.

Modern Next.js 2025 Tutorial: Complete Full-Stack Framework Overview

Modern Next.js 2025 Tutorial: Complete Full-Stack Framework Overview

This comprehensive overview covers the latest Next.js features including Server Components, Server Actions, AI coding agent support, partial pre-rendering (PPR), and the new proxy system. Perfect for beginners and experienced developers looking to understand Next.js fundamentals like data fetching, caching with `use cache`, routing, authentication, and deployment options.

Master Backend Engineering: First Principles for Faster Onboarding in Any Language

Master Backend Engineering: First Principles for Faster Onboarding in Any Language

Learn how to apply first principles to backend development, enabling you to quickly navigate unfamiliar codebases and languages. This guide covers key strategies for senior-level pattern recognition, faster onboarding, and choosing the right tools, making you a more versatile and employable engineer.

Serialization and Deserialization Explained: How Clients & Servers Communicate Using JSON

Serialization and Deserialization Explained: How Clients & Servers Communicate Using JSON

Learn how serialization and deserialization enable seamless data exchange between front-end and back-end systems using common formats like JSON. This guide breaks down the client-server communication flow, OSI model basics, and why JSON is the industry standard for REST APIs.

The Hidden Magic Behind Accessing Your Favorite Websites

The Hidden Magic Behind Accessing Your Favorite Websites

Discover the complex technology and processes that power your internet experience.

Found this summary useful?

Take it with you. One click puts it in your own LunaNotes library.

Save to LunaNotes

Start taking better notes today with LunaNotes