Web Architecture Flashcards

1
Q

What is a tier?

A

A tier is a logical separation of components in an application or service. The separation means the physical separation at the component level,
not the code level.

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

Few Examples of Tier Components

A

DataBase, Caching, UI, Backend server, Messaging

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

What is a single Tier Application?

A

An application where all components(UI, Backend, Database) reside in the same machine.
E.g MS Word

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

What is a 2 tier application?

A

Client-Server Architecture.
Client: UI & Business logic
Server: Database( Hosted and controlled by business)
E.g To-Do List, Productivity or Planner App

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

What is a 3 Tier application?

A

UI, Business Logic & Database. All 3 lie on different machines.

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

Components of N Tier Architecture

A
  1. Cache
  2. Message Queues for Async Processing
  3. Load Balancers
  4. Search Servers for searching through a massive amount of data(ElasticSearch)
  5. Components involved in processing the massive amount of data
  6. Components running heterogeneous tech (Web Service/API)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the 2 main principles behind N-Tier Architecture?

A
  1. Single Responsibility Principle(Giving just one responsibility to a component and letting it execute it with perfection.)
    2.Separation of Concerns
    Stored procs violate the single responsibility principle. A database is meant for persisting Data, not for holding business logic.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Different Layers of an application

A
  1. UI Layer
  2. Business Layer
  3. Service Layer
  4. Data Access Layer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Types of Client

A
  1. Thick Client(Contains both UI & Business Logic)

2. Thin Client( Just the UI)

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

What is Server-Side Rendering

A

Most of the time UI is rendered at the backend and the rendered data is sent to the client. This is called Server Side Rendering.

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

What is HTTP Pull based Communication?

A
  1. Request-Response communication
  2. Every request and response consume bandwidth and every hit costs business money and more load on the server.
  3. Excessive pulls by the clients have the potential to bring down the server.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is HTTP Push Based Communication?

A
  1. The client sends the request only once, and after that server keeps pushing the new updates to the client.
  2. This is also known as callback
    E.g User Notification
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Ajax?

A

It’s an HTTP Pull mechanism.
Asynchronous polling of data without human intervention and at regular intervals
Instead of requesting the data manually every time with a click of a button, AJAX enables us to fetch the updated data from the server by automatically sending the requests over and over at stipulated intervals.
Upon receiving the updates, a particular section of the web page is updated dynamically by thecallbackmethod.
E.g Cricbuzz

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

What is TTL for a connection?

A

In HTTP Pull, there is a TTL for every request(30-60 secs)
If the client doesn’t receive a response from the server within the TTL, the browser kills the connection & the client has to re-send the request hoping it would receive the data from the server before the TTL ends this time.

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

What is a Persistent Connection?

A

Client-Server Connection that remains open for future requests and responses, as opposed to HTTP Pull where the connection is closed as soon as a response is received for a request. (Single Communication)

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

But how is persistent connection remain open even after TTL?

A

With the help of heartbeat interceptors.
They send blank request-response to keep the connection open.
Persistent Connections are very resource-intensive.

17
Q

4 different types of HTTP Push Model

A
  1. Websockets
  2. Ajax long Polling
  3. HTML5 and SSE
  4. Streaming over HTTP
18
Q

What are web sockets?

A

(persistent bi-directional low latency data flow). operate on TCP, not on HTTP.The server & client both should support web sockets

19
Q

What is AJAX Long Polling?

A

Instead of immediately responding with a response, the server responds when it has updated data. The connection in long polling stays open a bit longer in comparison to polling.

20
Q

What is SSE(Server-Sent Events)?

A

Instead of the client polling the data, the server automatically pushes the data to the client whenever the update is available.
The updates are called Events
The servers can initiate data transmission towards the client once the client has established the connection with an initial request
ideal for Twitter feeds, Stock updates, etc.

21
Q

What is Streaming over HTTP?

A

Ideal when we need to stream a large chunk of data over HTTP by breaking it into smaller chunks.
Best for Streaming multimedia content, large images, etc.
To stream data, both the client & the server agree to conform to some streaming settings. This helps them figure when the stream begins & ends over an HTTP request-response model.

22
Q

Client-Side Rendering

A
Rendering the actual content/payload on the client (Converting the response from the server to HTML).
To render a page on the browser, the browser uses several components
1. Browser Engine
2. Rendering Engine
3.Javascript Interpreter
4. N/W and UI Storage
5. Data Storage
Best for Dynamic Content( AJAX)
23
Q

Server-Side Rendering

A

To avoid all this rendering time on the client, developers often render the UI on the server, generate HTML there & directly send the HTML page to the UI.
This ensures a faster rendering of UI.
Best for Static Content