Skip to main content

Command Palette

Search for a command to run...

AWS Solution Architect Notes

Updated
•4 min read•View as Markdown

(Client-Server Architecture)

I. Defining Client and Server

A machine is generally called a "device" until its role in the network is decided.

  • Client: The machine that raises a request for a service.

  • Server: The machine that listens to the client's request, processes it, and sends a response back to the client.

◦ Example: Google’s machine that processes the search query and sends the results.

◦ Analogy: The doctor who performs the treatment.

  • Multiple Roles: A single machine can act as a Client (e.g., browsing a website) and a Server (e.g., hosting an SSH or web service that others access) depending on the task being performed.

II. Communication Mediums (Networks)

A medium is required for the client and server to communicate.

  • Network: The medium that allows machines to listen to each other's requests and send responses.

  • LAN (Local Area Network): Used if the client and server are physically close, often connected via the same router, and can communicate directly.

  • Public Network / Internet: Used when devices are in different networks and need to communicate publicly. The Internet is the inter-connection of multiple networks.

III. Addressing and Naming

  • IP Address (Internet Protocol Address): A unique ID given to every machine that is part of a network. It helps determine what the machine is, which network it belongs to, and how to communicate with it.

◦ Example: The loopback address (127.0.0.1) is used to access services locally on the same machine.

  • Host Name: A human-readable name given to a machine (e.g., DB Server).

  • Host Name Resolution: When a host name is used, it must be resolved back to its IP address for communication. This can be done via DNS or locally using the /etc/hosts file.

IV. Application Development Environment Stages

Before an application can provide service to clients in the Production Environment, it must pass through several stages.

  1. Pre-Development: The application or software is designed.

  2. Development Environment: Improvements are made, and developers check if the application delivers the intended services (using Development Servers).

  3. Testing / Quality Assurance (QA): Testers check if the application works as designed (using Test Servers). If it fails, it returns to the Development stage for changes.

  4. Production Environment: The final environment used to host the application and provide service to the end-users.

V. Client-Server Architecture Types (Tiers)

The architecture is categorized based on the number of client and server layers involved.

  1. One-Tier Architecture (1-Tier)
  • Structure: The Client layer and Server layer are restricted to a single machine.

  • Access: Services are only accessible locally on that machine (often using the loopback address, 127.0.0.1).

  • Limitation: It cannot provide service to users on a network, so it has limited use when serving external clients.

  1. Two-Tier Architecture (2-Tier)
  • Structure: Consists of two layers: the Client Layer and the Server Layer.

  • Server Deployment: The Application and the Database are deployed together on a single physical machine.

  • Communication: Clients typically access this server directly over a Public Network.

  • Major Limitations (Not Suitable for Production):

◦ Performance Degradation: As the number of users (clients) increases, the Application and Database fight for the same shared hardware resources (CPU, Memory). This leads to high resource utilization, server hangs, latency issues, application crashes, and downtime.

◦ Security Risk: If a hacker or attacker gains access to the single server, all data (application and database) is compromised.

  1. Three-Tier Architecture (3-Tier)
  • Structure: Consists of three core layers: Client Layer, Application/Business Logic Layer, and Database Layer.

  • Server Deployment: The Database and Application are separated onto different servers (Database Server and Application Server).

  • Communication:

◦ The Application Server and Database Server communicate internally using a Private Network.

◦ Clients access the Application Server using the Public Network.

  • Benefits:

◦ Resource Separation: Hardware resources are separate for the Application and the Database, preventing resource fighting and improving performance.

◦ Improved Security (Initial Separation): If one layer is compromised, the data loss is contained (e.g., only the application data, not the database).

  1. Three-Tier Architecture with Enhanced Security (Recommended 3-Tier)

To fix the inherent security problem of exposing the Application Server directly to the Public Network, a third server component is added between the Client and the Application Layer.

  • New Component: A Web Server (e.g., Apache) is placed in between the clients and the Application Server.

  • Web Server Role: It receives client requests and redirects them to the Application Server, then takes the response back to the client.

  • Security Enhancement: This Web Server acts as an additional security layer, preventing clients (or hackers) from directly accessing and attacking the Application Server.

VI. Scaling and High Availability (N-Tier Architecture)

To ensure better performance, fault tolerance, and to avoid downtime, especially with a large number of clients (high load), multiple nodes must be used.

  • Load Balancer: A new layer is added to manage multiple application nodes. The Load Balancer (LB) receives traffic from the clients and distributes the load across the multiple Web/Application Servers.

  • N-Tier Example (5 Layers): If a Load Balancer is introduced alongside the Application, Web, Database, and Client layers, the system becomes a 5-layer architecture.

  • Outcome: This design provides high availability and fault tolerance.

Learning Cloud

Part 1 of 1

Here I will record my cloud learning journey.