Topic 2: Client-Server Architecture

Topic 2: Client-Server Architecture

1. Introduction to the Client-Server Model

đź“Ś What is a Client?

• A user’s device (computer, phone, tablet) that requests data from a server.

• Examples: Web browsers, mobile apps.

đź“ŚWhat is a Server?

• A powerful computer that stores and delivers content or services.

• Examples: Web servers, API servers, database servers.

đź“ŚExample:

• A client is like a customer at a restaurant, and the server is like a waiter bringing food from the kitchen.

2. Differences Between Client and Server

FeatureClientServer
Who uses it?End-userHandles requests
ExampleWeb browserWebsite backend •
ProcessesDisplay UIManages logic, databases

đź“Ś Example

• You visit YouTube → The client sends a request.

• The YouTube server processes it and responds with videos.

3. HTTP Request/Response Cycle

đź“ŚHow It Works?

• Client sends a request (e.g., GET /index.html).

• Server processes the request.

• Server responds with data

• Client displays the content.

đź“Ś HTTP Methods

• GET → Retrieve data.

• POST → Send data (forms, logins).

• PUT → Update data.

• DELETE → Remove data.

📌Example:


• A restaurant order – You (client) order pizza (GET), the kitchen (server) prepares it, and you receive it.

4. Frontend vs Backend, Static vs Dynamic Websites

đź“Ś Frontend (Client-Side)

• Code that runs in the browser.

• Technologies: HTML, CSS, JavaScript.

đź“Ś Backend (Server-Side)

• Code that runs on the server.

• Technologies: Node.js, Python, PHP.

đź“ŚStatic vs Dynamic Websites

TypeStatic WebsitesDynamic Websites
ExampleSimple blogs, portfoliosFacebook, Amazon
Data ChangesFixed ContentUpdates dynamically
Backend needed?No ❌Yes✅

📌Example:


• A static website is like a printed book, while a dynamic website is like a news website that updates regularly.

5. Basics of Web Hosting

• Web hosting stores websites for online access.

• Examples: Shared Hosting, VPS, Cloud Hosting.

• Popular Providers: GoDaddy, Hostinger, AWS, Netlify.

đź“Ś Analogy:

• Hosting is like renting an apartment for your website.

Â