Web Server
- Tools or programs that help keep the web application always up and running
- Just like a computer, a web server has a CPU, memory, and storage
- The web server is responsible for storing and serving the web application’s static assets, content, images, videos, and other files
- On hardware side web server is a computer that stores web server software and a website’s component files
- On software side web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form web pages to users, in response to their requests, which are forwarded by their computers’ HTTP clients
- Web server is a computer that runs websites
Difference between Web Server and Application Server
- Web server is a computer that runs websites
- Application server is a program that handles all application operations between users and an organization’s backend business applications or databases
- A web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form web pages to users, in response to their requests, which are forwarded by their computers’ HTTP clients
Communication Protocols
- A protocol which set a rule between client and server to communicate with each other
- can be implemented in hardware or software or combination of both
Models
Pull/Polling
- Client send request to server and wait for response
Long Polling
- Client send request to server and wait for response
- Number of requests too much
- Server will store the request in the queue
- Server will send response to the client after some time
- Server will awake the client after some time
- Server will always busy
Push
- In this model server will send response to the client without any request
- The server pushes new events to the client as they happen
- Reduces the server load
- Example: Facebook, Twitter likes
Socket
- Socket is a two way communication protocol
- Client and server can send and receive data at the same time
- Example: Chatting application
Server Sent Events
- Server Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server via HTTP connection
- Example: Stock market,Cricket score
Difference between Website and Web Application
- Website is static
- Web Application is dynamic
Client and Server
- Client is a computer that request data from the server
- Example: Browser,Instagram App
- Server is a computer that stores data and send data to the client
- Example: Instagram Server
Requirement for communication between client and server
- Fast
- Light Weight
- Language Independent
- Platform Independent
- Enable Communication over the n/w
REST
- REST stands for Representational State Transfer
- REST is an architectural style for developing applications that can be accessed over the network
- CREATE, READ, UPDATE, DELETE
SOA(Service Oriented Architecture)
- SOA is a style of architecture that promotes loose coupling and granular application to make the components of the software reusable
Advantages
- Selective scalability
- Different Tech Stacks
- Loose Coupling
- Agile(Independency)
Disadvantages
- High Latency
- High Complexity
- Complex uderstanding
- complex to secure
Microservices
- evolution of SOA
- Microservices is an architectural style that structures an application as a collection of services that are
- Highly maintainable and testable
- Loosely coupled
- Independently deployable
- Organized around business capabilities
- Owned by a small team
- different databases
Tier Architecture
- Tier is a logical partition of the application
- Frontend, Backend, Database different tiers
- First tier is the client tier, second tier is the application tier, and the third tier is the database tier
- Each tier is completely independent from the other tiers, except for the interface to the next tier
- Each tier can be managed or scaled independently
Authentication vs Authorization
- Authentication is the process of verifying who you are
- Authorization is the process of verifying what you have access to
Basic Authentication
- Basic authentication is a simple authentication scheme built into the HTTP protocol
- Each time username and password is sent to the server
- It is not secure
- It is not used in production
Token Based Authentication
- Token based authentication is stateless
- Token is generated by the server and sent to the client
- Token is stored in the client side
- Token is sent to the server for every request
- Token is valid for a certain period of time
- Token is not stored in the server side
- Token is stored in the client side
OAuth
- OAuth is an open standard for access delegation
- OAuth provides client applications a 'secure delegated access' to server resources on behalf of a resource owner
- Can be login with google,facebook,github etc