Web Architecture Flashcards

1
Q

How can resources be represented?

A

text (plain, html, csv), image, audio, video, application

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

How can resources be identified?

A

With URIs (Uniform Resource Identifiers)

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

How can resources be interacted with?

A

Using network protocols like HTML

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

What does the bow-tie model represent?

A

The shape of the web
Sections such as LSCC core, IN, OUT, and disconnected components

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

What is the web?

A

A distibuted information system that provides acess to resources

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

What is hypertext?

A

A way to link information in a non-linear interactive way - cannot be represented conveniently on paper

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

What are 2 disadvantages of hypertext?

A

Disorienting - easy to lose sense of direction
Cognitive overhead - additional effort to maintain several trails at once

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

What is hypermedia?

A

Non-textual media

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

What are nodes, links, anchors, and endpoints?

A

Node - a point in the network e.g. a webpage
Link - a connection between nodes
Anchor - the clickable element that links pages
Endpoint - the destination of a link

<a>anchor</a>

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

What are embedded links?

A

Links that are encapsulated in a node, and form part of the document content

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

What are first class links?

A

Where links are separated from nodes allowing multiple link overlays/linkbases (links over same node), creating different connections without changing the node
Link bases can be tailored to reader
Has 2 endpoints

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

What are bidirectional links?

A

Links that can be traversed backwards as well as forwards

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

What are N-ary links?

A

Links involving more than 2 nodes, allowing relationships between multiple entities

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

What are generic links?

A

Links where, by using locspecs, all occurences of a word can be linked to the same endpoint

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

What are functional links?

A

Links that represent predefined relationships

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

What are typed links?

A

Links that define the nature or relationship of the link, such as “friend,” “parent,” or “employee”

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

What is REST?

A

Representational State Transfer
A web architecture style that uses stateless communication to manipulate resource representation

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

What does REST aim to do (2)?

A

Minimises latency and network communication
Maximises independence and scalability of components

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

What are the 4 components of REST?

A

Origin servers - the ultimate place you get a resource from
Gateways - for integrating legacy servers
Proxies - to filter & cache
User agents

User agent & origin server are end points that communicate using HTTP
If using gateway, origin server & gateway don’t communicate in HTTP

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

What are the5 constraints of REST?

A

Client-server - separation of concerns (client: user interface, server: data storage)
Stateless - no context stored on server, session state kept on client
Caching - response data labelled as cacheable or non-cacheable
Uniform interface between components - identify what next possible actions could be
Layered - system components have no knowledge of components they don’t directly interact with

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

What are the 3 advantages of client-server constraint?

A
  • Improves portability
  • Improves scalability (as server simplified)
  • Allows components to evolve separately
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What are the 3 advantages and 1 disadvantage of stateless constraint?

A

Advantages:
* Improves visibililty (of requests)
* Improves reliability
* Improves scalability

Disadvantage:
* Increases per-action overhead

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

What are the 2 advantages and 1 disadvantage of caching constraint?

A

Advantages:
* Eliminates some actions
* Reduces latency

Disadvantage:
* Reduces reliability

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

What are the 2 advantages and 1 disadvantage of uniform interface constraint?

A

Advantages:
* Improves visibility (of interactions)
* Implementations decoupled from services they provide

Disadvantage:
* Reduces efficiency

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

What are the 2 advantages and 1 disadvantage of layered constraint?

A

Advantages:
* Limits system complexity
* Improves scalability

Disadvantage:
* Adds latency & overhead

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

What are the 3 principles of identification?

A

Global - addresses should be unambiguous & human readable
Distinct identifiers - using same URI for different resources creates a URI collision
Avoid aliases - don’t use different URIs for same resource

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

How should documents be named?

A

Use logical names rather than physical addresses to avoid issues when documents are moves

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

URL vs URN

A

URL specifies location of resource on internet
URN uniquely identifies resource by name - not that good approach as can just use HTTP

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

What are IRIs (Internationalised Resource Identifiers)?

A

An extension to URIs, allowing Unicode characters

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

Why shouldn’t you change URIs?

A

Breaks pages linked to old URI -> 404

31
Q

What are the 5 principles of representation?

A

Separate content, presentation & interaction
Identify links to other resources
Links should be web-wide
W3C representation principles - follow a format to future proof
Links should be navigable

32
Q

Data vs metadata

A

Data is the actual information/content
Metadata is data that describes other data e.g. file size, creation date

33
Q

What are the 5 principles of interaction?

A

Reuse representation formats
Provide representations
Safe retrieval
References doesn’t imply dereference - just because you can retrieve a representation, doesn’t mean you must
Representations should be consistent

34
Q

What is a safe method?

A

One that doesn’t change the state of the resource

35
Q

What is an impotency method?

A

One that doesn’t change the result even when applied multiple times
Only POST isn’t impotent

36
Q

What to the HTTP responses (1xx - 5xx) represent?

A

1xx - informational message
2xx - success
3xx - redirection
4xx - client error
5xx - server error

37
Q

What are the 2 styles of content negotiation?

A

Sever-driven - server makes final choice of representation
Client-driven - clinet makes final choice of representation

38
Q

What are the 3 stages of server-driven content negotiation?

A

1) Client tells server what it is able to accept in request header
2) Server chooses appropriate representation to return to client based on “quality” (provided by client)
3) Server tells clients its choice in response header

39
Q

Name three properties that can be negotiated

A

Media type
Language
Encoding

40
Q

What are the 3 stages of client-side content negotiation?

A

1) Client requests resource representation
2) Server returns HTTP redirect status (“300 multiple choices”) with list of URIs
3) Client requests a representation of one of the URIs

41
Q

What is “Client Hints”?

A

A HTTP extension that allows browsers to state their capabilities & preferences

42
Q

How can you avoid the lost update problem?

A

When carrying out unsafe methods, check if the state of the resource has change since the GET method

43
Q

What 2 ways are there for validating if resources are the same?

A

Strong validation - checks if representations are byte-for-byte identical
Weak validation - checks if representations contain “the same content”

44
Q

What are ETags? What headers can be applied to them?

A

Entity tags are identifiers for resource versions

Headers:
* If-Match: <etag>, <etag>, ...
* If-None-Match: <etag>, <etag>, ...</etag></etag></etag></etag>

45
Q

What are cookies?

A

A way for web servers to persist state across HTTP requests (even though HTTP is supposed to be stateless)

46
Q

What are “Secure” and “HttpOnly” cookies?

A

Secure - indicates that cookies should only ever be sent over HTTPS
HttpOnly - cookies should not be visible from within the Document.cookie interface

47
Q

Discuss the physical limits on data transmission (3)

A

Sending a message at c (3e8) still takes 0.067s to go halfway round the world
Optical fibres are ~70% of c, coxial cables are >80% of c
Routers, switches, etc introducers delays

48
Q

How does TCP delay HTTP?

A

HTTP runs of top of TCP
TCP establishes connections with a three-way handshake (>=0.2s)

49
Q

What 2 methods reduced TCP delay for HTTP?

A

Keep-Alive - TCP connections reused for multiple HTTP requests
Pipelining - multiple requests made without waiting for responses

50
Q

What 4 improvements were made to adhere to data transfer capacity limits?

A

Multiplex requests - when client requests HTML document with multiple images, stylesheets & scripts, send a single connection for all resources
Prioritised requests - sends important content first
Compressed headers to reduce amount of data sent
Server push - when a client requests HTML doc with image, instead of waiting for them to request image, pre-emptively push resource

51
Q

What are tunnels in the context of proxies?

A

CONNECT method establishes tunnel between client & server
With tunnel establishes, proxy server no longer inspects/modifies data; just forwards

52
Q

How is data secured in HTTPS?

A

Using the TLS (Transport Layer Security) protocol

53
Q

What are the 4 cryptography principles?

A

Confidentiality - no unathorised reading
Integrity - no unauthorised modificaiton
Authenticaiton - proof of authorisation
Non-repudiation - data author can’t deny authorship

54
Q

How do digital signatures created (3 steps)?

A

Combines asymmetric encryption & cryptographic hash

1) Generate cryptographic hash of image
2) Encrypt hash with private key
3) Attach encrypted hash to message

55
Q

How are digital signatures verified (3 steps)?

A

1) Generate cryptographic hash of image
2) Decrypt hash with public key
3) Compare hashes

If hashes match, message has not been altered and signature is valid

56
Q

What is the Certificate Authority?

A

A trusted organisation that issues digital certificates

57
Q

How does the Diffie-Hellman Key Exchange work?

A

1) Prime number p and root module g are shared publically
2) A and B pick random large integers: a and b
3) A and B calculate g^amodp=PUa and g^bmodp=PUb respectively and send results publically
4) A calculates PUb^a
modp and B calculates PUa^b*modp

58
Q

Authentication vs authorisation

A

Authentication - verifying identity of user/system
Authorisation - granting access/permissions to resources

59
Q

What are the 6 steps in granting authorisation in OAuth?

A

1) Client requests authorisation from the authorisation server via the resource owner
2) Resource owner authenticates the request
3) Authorisation server sends an authorisation code to client via the resource owner
4) Client sends the authorisation code to the authorisation server
5) Authorisation server sends access token to client
6) Client accesses resource on resource server

60
Q

What is cross-site request forgery?

A

When a user (unintentionally) allows one origin to talk to a different origin
User clicks on a link/form while authenticated on a site allowing attacker to perform actions on site with user’s authentication

61
Q

How is cross-site request forgery prevented?

A

Same origin policy
Restricts web pages from making requests to different domains than the one that hosted it

62
Q

How is “same origin” determined?

A
  • URIs use same protocol
  • URIs have same host
  • URIs have same port
63
Q

What is the default port for HTTP?

A

80

64
Q

What blocking exceptions are there to same origin policy?

A

Embedded resources (media, stylesheets, scripts, etc)

65
Q

What is CORS (cross-origin resource sharing)?

A

Secuity feature that relaxes SOP, allowing certain origins to make requests to a domain different to the one that server the web page
Servers indicate which origin may make requests and restrict headers send & received

66
Q

What criteria must simple requests satisfy for CORS?

A

Only methods: GET, HEAD, POST
Only headers: Accept:, Accept-Language:, Content-Type:, Content-Language
Content-Type: text/plain, (application/…), (multipart/…)

67
Q

What is a CORS preflight?

A

Used for more complex requests (other methods, custom headers)
A preliminary HTTP request to check if actual request is allowed by the server before sending actual request

68
Q

What is SGML (Standard Generalised Markup Language)?

A

An old markup language (old version of HTML)
A language for defining markup languages

69
Q

What is XML (eXtensible Markup Language)?

A

A general purpose markup language
A W3C-defined subset of SGML
A language for defining domain-specific markup languages

70
Q

What is DTD (Document Type Definition)?

A

A formal definition of the grammar for an XML document
Tells document processor how to parse the document

71
Q

What are the 2 expressive limitations of DTD?

A

Limited by how precisely it can constrain data & element values:
* Can’t specify the range of values that attributes can take
* Can’t define a range for the content of non-markup elements

72
Q

What 2 schema language competitors does DTD have?

A

XML Schema
RELAX NG

73
Q

Doment well-formedness vs validity

A

Well-formedness - obeys syntax rules in XML spec
Validity - well-formed and structure is based on a defined schema (e.g. DTD)

74
Q
A