Web Architecture Flashcards
What is a tier?
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.
Few Examples of Tier Components
DataBase, Caching, UI, Backend server, Messaging
What is a single Tier Application?
An application where all components(UI, Backend, Database) reside in the same machine.
E.g MS Word
What is a 2 tier application?
Client-Server Architecture.
Client: UI & Business logic
Server: Database( Hosted and controlled by business)
E.g To-Do List, Productivity or Planner App
What is a 3 Tier application?
UI, Business Logic & Database. All 3 lie on different machines.
Components of N Tier Architecture
- Cache
- Message Queues for Async Processing
- Load Balancers
- Search Servers for searching through a massive amount of data(ElasticSearch)
- Components involved in processing the massive amount of data
- Components running heterogeneous tech (Web Service/API)
What are the 2 main principles behind N-Tier Architecture?
- 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.
Different Layers of an application
- UI Layer
- Business Layer
- Service Layer
- Data Access Layer
Types of Client
- Thick Client(Contains both UI & Business Logic)
2. Thin Client( Just the UI)
What is Server-Side Rendering
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.
What is HTTP Pull based Communication?
- Request-Response communication
- Every request and response consume bandwidth and every hit costs business money and more load on the server.
- Excessive pulls by the clients have the potential to bring down the server.
What is HTTP Push Based Communication?
- The client sends the request only once, and after that server keeps pushing the new updates to the client.
- This is also known as callback
E.g User Notification
What is Ajax?
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
What is TTL for a connection?
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.
What is a Persistent Connection?
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)