Search This Blog

Q71-Q75

Q71. What is the difference between ienumerable and Ienumerator
Q72. What is the difference between AsQuerable and AsEnumerable
Q73. How to implement Role based Authorization?
Q74. What is serialization in C#?
Q75. What are web farms, web gardens and load balancers?
=====================================================================================
Q73. How to implement Role based Authorization?

Answer:

=====================================================================================
Q74. What is serialization in C#?

Answer:
Serialization is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file.
 Its main purpose is to save the state of an object in order to be able to recreate it when needed. The reverse process is called deserialization.

We have to provide the attribute [Serializable] on top of class which we want to serialize.

There could be multiple tricks to do the serialization:
1. JSON serialization. 
2. Binary/ XML serialization etc.

=====================================================================================
Q75. What are web farms, web gardens and load balancers?

Answer:
By default, each application pool runs with a single worker process (W3Wp.exe). When an application pool runs with multiple worker process, it is called web garden.

Advantage of Web Garden:
A Web garden share the requests which comes for that application pool and if one worker process fails to process a request then another worker process can continue to process that request.

Limitation of Web Garden:
There are some limitations with Web Garden. When you use session mode to “In Proc" with your application, it will not work properly as expected; since session will be handled by different worker process. For avoiding this issue; you should use session mode "Out Proc" having "Session State Server" or "SQL-Server Session State".




Web Farm
When a web application is hosted on multiple web servers and access based on the load on servers, it is called Web Farm.

In web farm, a single application is hosted on multiple IIS server and these IIS servers are connected with the VIP (Virtual IP) with load balancer. Load balancer IPs is exposed to external world for accessing your web application. Hence, when a request comes to server from client, it first hits the load balancer, and then based on the traffic on each server; load balancer distributes the request to the corresponding web server.

Advantage of Web Garden:
It provides high availability. If any of the web servers goes down then Load balancer redirects the incoming requests to other web servers in the web farm.

It provides high performance response for client requests.

Limitation of Web Farm:
There are some limitations with Web Farm; also. When you use session mode to “In Proc" with your application, it will not work properly as expected; since session will be handled by different web servers. For avoiding this issue; you should use session mode "Out Proc" having "Session State Server" or "SQL-Server Session State".




=====================================================================================

No comments:

Post a Comment