Intro to Backend Development
  • Introduction
  • SP25 Syllabus
  • Apply to Take the Course
  • Getting Started
  • Weekly Feedback Form
  • Ed Discussion
  • Intro to Backend SP25 Google Calendar
  • Cheat Sheets
    • Assignment Requirements
    • Assignment FAQs
    • Error FAQs 😢
    • Concept FAQs
    • Postman
    • Command Line
    • Virtual Environment
  • Chapters
    • 1. Routes
      • Pre-Class TODO's
      • Lecture
      • Assignment Handout
      • API Specification
    • 2. Databases
      • Pre-Class TODO's
      • Lecture
      • Demo
      • Assignment Handout
      • API Specification
    • 3. Relational Databases
      • Pre-Class TODO's
      • Lecture
      • Demo
      • Assignment Handout
      • API Specification
    • 4. Abstractions
      • Pre-Class TODO's
      • Lecture
      • Demo
      • Assignment Handout
      • API Specification
    • 5. Containerization
      • Pre-Class TODO's
      • Docker Installation
      • Lecture
      • Demo
      • Assignment Handout
    • 6. Deployment
      • Lecture
      • Demo
      • Assignment Handout
    • 7. Images
      • Demo
      • Assignment Handout
    • 8. Authentication
      • Lecture
      • Demo
      • Assignment Handout
    • (Work in Progress) OAuth
      • Pre-Class TODO's
      • Lecture
      • Demo
      • OAuth 2.0 vs OpenID
      • Flask / OpenID example
  • Additional Topics
    • Git and Github
    • HackOurCampus
  • Other AppDev Courses
    • Intro to iOS Development
    • Intro to Android Development
    • Intro to Digital Product Design
  • Deprecated
    • Previous Semester Syllabi
      • FA22 Syllabus
      • SP22 Syllabus
      • FA21 Syllabus
      • SP21 Syllabus
      • FA20 Syllabus
      • SP20 Syllabus
    • Deployment Pre-Class TODO's
    • PA6 Assignment Handout
    • Deployment Demo
    • Final Project (Spring 2019)
      • Final Project Award Winners
Powered by GitBook
On this page
  • Lecture Slides
  • Clients
  • Servers
  • Requests
  • Responses
  • The Whole Process

Was this helpful?

  1. Chapters
  2. 1. Routes

Lecture

Contributors: Alicia Wang, Conner Swenberg

PreviousPre-Class TODO'sNextAssignment Handout

Last updated 2 months ago

Was this helpful?

Lecture Slides

Clients

Clients are the computers we use everyday, including phones, tablets, laptops, desktops, and gaming consoles. Clients run code locally on their machine. Things like rendering images, reacting to button clicks and user input are all done as part of the frontend of an application. What makes an application truly “networked”, i.e. involving actions from other clients, is the backend of the application. These backends exist in the cloud, running on servers.

Servers

Servers are also computers, just like clients. Servers centralize information and run backend code to execute operations to data and communicate with clients. This is the Server-Client Model and it is how the internet is architected today. Independent machines (like a phone, computer, etc.) make requests to servers and use the data returned in responses.

Requests

Requests are the network calls transferred over the web. Let’s dissect a request made to http://www.google.com:

http: Hyper Text Transfer Protocol defines the protocol for the request and is reserved for port 80 on servers. HTTP requests can be made with one of many types of methods. A method indicates the type of request being sent and how to handle the request. The most common methods used are GET, POST, DELETE, PUT, PATCH and are all standardized by HTTP protocol. Methods indicate the purpose of the request. GET is for information retrieval, POST for information transmission, DELETE for deleting, PUT & PATCH both for updating. Requests can also contain metadata, optional information located in the body of the request. Metadata can be in many forms, the two most common are XML and JSON. A request body is likely populating in the case of creating or updating items in the database.

www: The subdomain we are trying to access.

google: The domain we are trying to access. A Domain Name Service (DNS) will map this domain to a specific server for you to communicate with.

Going to http://www.google.com makes a GET request to the google domain. Similarly we can send a POST request to http://www.google.com/login to login our user. In the case of logging in, our POST request’s body will likely contain email/password information to be authenticated on the server.

Responses

Servers respond the exact same way with their own network calls. They also obey HTTP protocol and have the ability to contain metadata in a response body. Responses also contain specific codes giving us a high-level understanding of how the request was handled. Some common examples are:

  • 200 → Successful

  • 404 → Not found

  • 500 → Internal server error (an uncaught exception)

The Whole Process

  1. A client makes a request for specific pieces of data that are sent out over the internet

  2. The request is received by a server

  3. The server runs internal processes to create, retrieve, update, or delete items

  4. The server returns response back to client over the internet

1MB
lecture1.pdf
pdf