4.1 Video
Daily Video 1
- A packet is a small amount of data sent over a network. Each packet also includes the source and the destination information.
- A computer system is group of computing devices and programs working together for a joint purpose
- Computer network: group of interconnected computing devices capable of sending or receiving data, type of computer system
- Packet switching: message (file) is broken up into packets and sent in any order. The packets are reassembled by the recipient’s device
- Path between two computing devices on a computer network (sender and receiver) is a sequence of directly connected computing devices that begins at the sender and ends at the receiver
- Bandwidth: maximum amount of data that can be sent in a fixed amount of time on a computer network, typically measured in bits per second
- Computers need to connect to transmit data to make things easier
- We use packets to transmit data because we can take it and move it through the internet all at once it is too big Daily Video 2
- Protocol: agreed-upon set of rules that specify the behavior of a system
- OSI: Open Systems Interconnect, layers you have to go through to communicate (7 groups of protocol)
- TCP: Transmission Control Protocol, establishes a common standard
- IETF: Internet Engineering Task Force, manages the development of standards and technical discussions concerning the internet in an open and collaborative process
- How once device transfers information to another (Narrow Waist): Application -> Transport -> Internet <- Network Access
- Many different protocols, standards, data formats..etc used at “Application” and “Transport” layers
- Many different protocols and hardware used at the Network Access Layer
- They meet in the middle at the “Internet” layer where you use IP Addresses, it is the common link
- Network Access Layer: carry’s 0’s and 1’s between the 2 devices, most common protocol is Ethernet impliments in Network Interface Cards(NIC), general function of physical layer is to deliver packets from one NIC to another (“hop”), NIC has unique address with it called a Media Access Control Adress (MAC) used for local hops
- A packet contains data that is being transmitted and metadata containing information used for routing information
- Routing on the internet is usually dyanmic; not specified in advance
- Scalability of a system is the capacity for the system to change in size and scale to meet new demands
- Internet was designed to be scalable
4.2 Video
- The Internet has been engineered to be fault-tolerant, with abstractions for routing and transmitting data
- Redundancy is the inclusion of extra components that can be used to mitigate failure of a system if other components fail
- one way to accomplish network redundancy is by having more than one path between any to connected devices
- Redundancy within a system often requires additional resources but can provide the benefit of fault tolerance
-The redundancy of routing options between two points increases the reliability of the Internet and helps it scale to more devices and more people
4.3 Video
- Sequential computing is a computational model in which operations are performed in order one at a time
- Parallet computing is a computational model where the program is broken into multiple smaller sequential computing operations, some of which are performed simultaneously
- Distributed computing is a computational model in which multiple devices are used to run a program
- Comparing efficiency of solutions can be done by comparing the time it takes them to perform the same task
- A sequential solution takes as long as the sum of all its steps
- A parallel computing solution takes as long as its sequential tasks plus the longest of its parallel tasks
- The speedup of a parallel solution is measured in the time it took to complete the task sequentially divided by the time it took to complete the task when done in the parallel
Deployment Notes for MelodyMates on EC2
Server & Container Setup
- Cockpit: Terminal for managing the Amazon EC2 server.
- EC2 Server: Runs a Docker container named
melodymates
. - Port 8404: The container is accessible through this port.
Understanding Docker
- Container: A virtual computer running the backend server.
- Image: A blueprint for the virtual computer (container).
- NGINX: Routes requests on port 8404 to the correct container.
Docker Commands
# Stops and removes the container (not the image)
docker-compose down
# Creates a new Docker image (blueprint)
docker-compose build
# Runs the container on port 8404
docker-compose up
How Requests Work
- A request is sent to the DNS (e.g.,
melodymates.stu.nighthawkcodingsociety.com
). - The DNS routes it to the EC2 server.
- NGINX forwards the request to the correct container.
- The container processes the request and returns JSON data.
- NGINX sends the response back to the client.
Understanding URLs & PythonURI
- DNS: Converts an IP address into a human-readable domain name.
- PythonURI: A frontend variable referencing the server’s URL.
- URI (Endpoint): The specific URL used for API requests.
- Port Mapping: Requests flow from
8887
(local) →8404
(production).