Topic 9.4.10 - Client Server Model Flashcards
Explain how a Client Server model works
Clients (devices) send requests to servers
Servers reply with information, confirmation or error
Many different types of servers which all specialise in a certain task (file server, database server, email server)
What is an Application Programming Interface (API)
A name given to a set of protocols relating to how different applications communicate with each other.
They allow applications to make use of other applications
What is the Websocket Protocol
An example of an API
Operates in the application layer of TCP/IP
Used to provide a constant stream of information between 2 devices (web browser and a server)
Full-duplex: data can be transmitted in both directions at the same time
Allows fast transmission of data by reducing size of packet headers
Used in real time applications (video game, streaming, instant messaging)
What are the 4 CRUD commands and their SQL equivalent
Create - INSERT
Retrieve - SELECT
Update - UPDATE
Delete - DELETE
What are the 4 HTTP requests used by REST and their sql equivalent
POST - INSERT
GET - SELECT
PUT - UPDATE
DELETE - DELETE
What is the purpose of Representational State Transfer (REST)
Enables CRUD to be mapped to SQL functions
Allows Javascript to talk to a database server through HTTP
Client needs no knowledge of how the database server works
What happens when a clients wants to connect to a database
1) Client sends a HTTP request to the web server
2) REST API passes HTTP request to the database
3) REST API passes JSON / XML response back to web server
4) Web server sends the response back to the browser
5) Browser translates the JSON / XML response
Compare Java Script Object Notation (JSON) with XML
Easier for humans to read
More compact
Easier to create
Faster for computers to process