essay questions Flashcards
What is a multitier architecture project structure?
Is a client–server architecture in which presentation, logic processing, and data management functions are physically separated.
Describe the purpose of the different files and folders in a multitier architecture web project.
A multitier architecture project consists of three different tiers
1. The presentation tier → is the user interface and communication layer of the application, where the end user interacts with the application. Its main purpose is to display information to and collect information from the user. HTML, CSS, and JavaScript files: or files related to returning resource data as a REST API
- The business logic tier → In this tier, information collected in the presentation tier is processed. The business logic tier can—so add, delete, or modify data in the data tier. communicates with the data tier using API calls. API files + Server-side code files: This can be written in languages like PHP, Ruby, Python, or Java.
- The data tier → The data tier, sometimes called the database tier, data access tier, or back-end, is where the information processed by the application is stored and managed. This can be a relational database management system such as MySQL. Data is accessed by the business logic layer via API calls. Database file as MySQL + Object-Relational Mapping (ORM) files: Model files:
What are the benefits and drawbacks of a multitier architecture project structure?
Benefits: It has improved security and scalability and is easier to maintain.
Easy to manage: You can manage each tier separately, adding or modifying each tier without affecting the other tiers.
Improved scalability: Any tier can be scaled independently of the others as needed.
Improved security: Because the presentation tier and data tier can’t communicate directly, a well-designed business logic tier can function as a sort of internal firewall, preventing SQL injections and other malicious exploits.
Drawbacks: Increase in Effort / Increase in Complexity
What is frontend programming?
Frontend development is programming which focuses on the visual elements of a website or app that a user will interact with and sees (the client side).
What is backend programming?
Backend development focuses on the side of a website users can’t see (the server side).
Backend programming typically involves programming languages such as Java, Python, PHP, Ruby, and Node.js.
What is HTTP?
HTTP (Hypertext Transfer Protocol) is responsible for communication between web servers and clients. HTTP is a request-response protocol, meaning that it is used to request information from a server and receive a response. It is a protocol for transmitting hypermedia documents, such as HTML. It fetches resources such as HTML docs, images, videos, scripts, and more. Gives us rules about how messages should be sent around the internet. HTTP is stateless, meaning that each request/ response pair is independent & does not carry any context from previous requests.
HTTP is responsible for communication between web servers and clients. Every time you visit a webpage, submit a form, click a button, you make a request and get back a response.
What is the request-, response-cycle in HTTP?
HTTP involves a computer making a request for some information at a URL. The HyperText Transfer Protocol gives us rules about how messages should be sent around the Internet. The system that initiates a connection sends a “request”, and the system the answers sends a “response”.
1. User issues a URL into a browser
2. Browser sends a request message
3. Server maps out the URL to the file/program under the document directory
4. Servers sends back a response message
5. Browser formats the respons and displays it to the user
What are the four main parts of the HTTP Request
HTTP Request
When a client (like a web browser) want to retrieve information, it sends data to a server as a request. This request is made up of four main parts:
1.A Request line (HTTP method)
2. A URI HTTP (Uniform Resource Identifier) that specifies the resource being requested
3.An optional header; that provide additional information about the request
4.An optional body; we only send data to the server in the body when we are creating or modifying something
What are the 3 main parts of the HTTP Response
When a server or web application is finished processing a request, it sends a response back to the client. This response contains three main parts:
1.a status line
2.Headers, also sent as key/value pairs similar to the HTTP request
3.An optional body; almost all responses will contain additional data in the body.
What are status codes in HTTP?
An HTTP status code is a message a website’s server sends to the browser to indicate whether or not that request can be fulfilled.
When that all goes according to plan the server returns a 200 code.
what 5 types of codes there and when to use each one.
There are 5 ranges of status codes:
1xx: Informational
2xx: Success! - things are working as intended.
- 200: ok - 201: created - 202: accepted - 204 No content
3xx: Redirectional. 301 redirects when you permanently move a page. / 302 tells the browser that the requested page has been found,
4xx: Client error. 404 - not found - 400 - bad request
5xx: Server error. 500: Internal server error
What is a REST API?
A REST API is an API that conforms to the design principles of the REST, or representational state transfer architectural style.
Based on client-server communication (like HTTP) a REST API is a set of guidelines that govern the creation of web services using HTTP protocol. The four main components of a REST API are resources, HTTP methods, representations, and URIs.
communicate via HTTP requests to perform standard database functions like creating, reading, updating, and deleting records (also known as CRUD)
REST Architecture communicates between client and server.
1.Clients send HTTP request and wait for responses
2.Rest API receives request from clients and does whatever request need i.e create / update / delete user
3.Response - When the rest API has what it needs, it sends back the response to the clients. This would typically be in JSON or XML format
List the various HTTP-Methods (GET, POST, PUT, PATCH, and DELETE) and describe the purpose and uses of each one.
PATCH - UPDATE a existing part of a resource in a table
POST - CREATE a new resource in a database
PUT - UPDATE an entire resource that exists on the database
GET - retrieve data to be READ by the client/user- GET API should be idempotent, clients can make that same call repeatedly while producing the same result”
DELETE - DELETES a existing resource from database
What is JSON?
JSON stands for JavaScript Object Notation.
JSON is a file format that uses human-readable language to store and communicate data objects. It’s an easy-to-parse and lightweight data-interchange format.
The REST architecture allows API providers to deliver data in multiple formats, such as plain text, HTML, XML, and JSON.
Developers can use libraries or built-in functionality in their programming language to convert data to and from JSON format when communicating with the API.
What is a Client in web development?
A client is a piece of computer hardware or software that connects to and accesses the resources of a remote computer, or server. Clients are web browsers (like Chrome, Firefox, and Safari),