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

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.

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.

Comprehensive Guide to HTTP Protocol and Express.js for Web Developers

Comprehensive Guide to HTTP Protocol and Express.js for Web Developers

Explore the fundamentals of the HTTP protocol—including request methods, status codes, headers, and the stateless nature of HTTP. Learn practical usage of HTTP concepts through Node.js and Express.js examples, and discover how tools like Postman and browser DevTools help in testing and debugging APIs effectively.

The Hidden Magic Behind Browsing: How Your Data Travels the Internet

The Hidden Magic Behind Browsing: How Your Data Travels the Internet

Discover the complex journey of data from click to display, revealing the tech behind seamless web browsing.

Top AWS Services Explained for Beginners: EC2, S3, IAM & More

Top AWS Services Explained for Beginners: EC2, S3, IAM & More

Discover the most frequently used AWS services in this beginner-friendly overview. Learn how to navigate AWS, manage users with IAM, launch virtual servers with EC2, store data using S3, and handle containers with ECS and EKS. This video also covers essential services like CloudWatch, CloudTrail, RDS, and messaging with SQS and SNS.

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