APIs and client server - paper 2 Flashcards

(20 cards)

1
Q

what are APIs

A
  • a set of protocols that governs how two applications should interact with one another.
  • An API sets out the format of requests and responses between a client and a server and enables one application
    to make use of the services of another.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

limits of HTTP communication

A

The client must send a request to the server to receive data.

If too much time passes without activity after a socket connection is established,

The server closes (drops) the connection to save resources.

When this happens, the server often sends an error message (like a timeout).

Bandwidth overhead: HTTP headers add extra data, increasing bandwidth usage.

Latency: Each request-response cycle can cause delays, especially over slow networks.

Text-based: Less efficient for binary data compared to some other protocols.

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

web CRUD applications

A

NAME → HTTP request method → SQL command

Create → POST → INSERT
Retrieve → GET → SELECT
Update → PUT → UPDATE
Delete → DELETE → DELETE

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

what is REST

A

Representational State Transfer is a software architectural style for designing networked applications

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

examples of APIs

A

JSON - similar to python dictionary
XML - similar format to html files

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

advantages of JSON

A
  • more compact so requires less storage, so quicker to transmit and process
  • easier to read, write, and maintain
  • data clearly defined as objects
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

disadvantages of JSON

A
  • only works with a limited range of data types

Less secure: Can be vulnerable to injection if not properly handled.

Text-based: Larger in size compared to binary formats like Protocol Buffers.

Parsing errors: Small syntax mistakes (like missing commas) can break the whole file.

No support for comments: Can’t add explanations directly in the data.

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

advantages of XML

A

Human-readable and machine-readable: Easy to understand and process by both people and programs.

Platform-independent: Works across different systems and technologies.

Flexible structure: Can represent complex data types

Supports custom tags: Allows users to define their own tags for specific needs.

Widely supported: Many tools and languages have built-in XML support.

Facilitates data sharing: Great for exchanging data between different applications.

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

disadvantages of XML

A

expensive use of tags makes it hard to follow

Slower processing: More complex to parse than formats like JSON.

Higher bandwidth usage: Large file size means more data to transfer.

Harder to write manually: Tedious and error-prone without tools.

Not ideal for data storage: Inefficient for large datasets or frequent read/writes.

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

describe what thin- client computing is

A
  • processing is carried out on a server
  • Minimal local processing: Most of the computing is done on a central server, not the client device.

Relies on network connection: Needs a stable connection to access applications and data.

Lightweight hardware: Thin clients can be low-power devices (e.g., terminals, Chromebooks).

Centralised management: Easier to update, secure, and maintain systems from the server.

Common in businesses: Used in environments like schools, offices, and call centres.

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

how does the client - server model work

A
  • a client will send a request message to a server
  • which should respond with the data requested or a suitable message otherwise.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

example of a client - server model

A

Client (e.g. browser) sends a request for a web page.

The server receives the request and finds the needed page/data.

The server sends back a response with the web page content.

The browser displays (renders) the web page on the user’s screen.

This is how many websites work using the client-server model.

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

examples of server types

A

File server
Email server
FTP server
Proxy server
DHCP server
Print server
Database server

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

example of an API

A

WebSocket is a modern application layer
protocol that facilitates a persistent bi-directional communication channel between the client and the
server over a single line. This is known as full-duplex communication.

Persistent connection until the communication is terminated;
Reduced header information, increasing data transfer speed; and reducing load on server

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

Connecting a database to a browser with HTTP request methods

A

User interacts with browser: e.g., submits a form or clicks a button.

Browser sends HTTP request: Using methods like:

GET – to fetch data (e.g., view products).

POST – to send new data (e.g., submit a form).

PUT/PATCH – to update existing data.

DELETE – to remove data.

Server receives request: Backend processes the request using code (e.g., Python, Node.js, PHP).

Server interacts with database: Sends SQL queries to retrieve, insert, update, or delete data.

Server sends HTTP response: Returns data (usually in JSON) or confirmation to the browser.

Browser updates UI: Based on the server’s response (e.g., shows new content or success message)

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

advantages of thin client

A
  • Easy to set up, maintain and add
    terminals to a network with little installation required locally
  • Software and updates can be installed
    on the server and automatically distributed to each client terminal
  • More secure since data is all kept centrally in one place
17
Q

disadvantages of thin client

A
  • Reliant on the server, so if the server
    goes down, the terminals lose functionality
  • Requires a very powerful, and reliable
    server which is expensive
  • Server demand and bandwidth increased
  • Maintaining network connections for
    portable devices consumes more battery power than local data processing
18
Q

advantages of thick client

A
  • Robust and reliable, providing greater
    up-time
  • Can operate without a continuous
    connection to the server
  • Generally better for running more
    powerful software applications
19
Q

disadvantages of thick client

A
  • More expensive, higher specification
    client computers required
  • Installation of software required on
    each terminal separately and network administration time is increased
  • Integrity issues with distributed data
20
Q

how does thin client computing work

A
  • Client terminals load operating system from server at start up;
  • Applications installed on server and accessed remotely by terminals;
  • Client (dumb) terminals act as interfaces only;
  • All processing is done by the server