Topic 9.4.10 - Client Server Model Flashcards

1
Q

Explain how a Client Server model works

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an Application Programming Interface (API)

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Websocket Protocol

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 4 CRUD commands and their SQL equivalent

A

Create - INSERT
Retrieve - SELECT
Update - UPDATE
Delete - DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the 4 HTTP requests used by REST and their sql equivalent

A

POST - INSERT
GET - SELECT
PUT - UPDATE
DELETE - DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of Representational State Transfer (REST)

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What happens when a clients wants to connect to a database

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Compare Java Script Object Notation (JSON) with XML

A

Easier for humans to read
More compact
Easier to create
Faster for computers to process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly