Monday, 25 May 2015

Web Farm vs Web Garden

Web Farm :  

 This is the case, where you have only one web server and multiple clients requesting for the resources from the same server. But when there is huge numbers of  incoming traffic for your web sites, one standalone server is not sufficient to process the request.  You may need to use multiple server to host the application and divide the traffic among them.  This is called “Web Farm” . So when you are hosting your single web site on multiple web server over load balancer called “Web Farm”. Below diagram showing the over all representation of Web Farms.

In general web farm architecture, a single application is hosted on multiple IIS Server and those are connected with the VIP ( Virtual IP ) with Load Balancer. Load Balancer IP’s exposed to external worlds to access. So whenever some request will come to server from clients, it will first hit the Load Balancer, then based on the traffic on each server LB distributed the request to corresponding web server.  These web server may share same DB server or may be they can use replicated server in the back end.
So, In a single statement, When we host a web application over multiple web server to distributed the load among them  is called Web Farm.


Web Garden :

Before understand "Web Gardgen", Let us understand "worker process" & "Application Pool"

ASP.Net functionality inside IIS  runs under the scope of worker process. Worker Process is responsible for handling all kind of request, response, session data, cache data.  Application Pool is the container of worker process. Application pools is used to separate sets of IIS worker processes and enables a better security, reliability and availability for any web application.

Now, by default each and every Application pool contains a single worker process. Application which contains the multiple worker process called "Web Garden".

So, a Web application hosted on multiple server and access based on the load on servers is called Web Farms and When a single Application pool contain multiple Worker process is called web garden.


Advantages of Web Farm and Web Garden :

Advantages of Web Farm
  • It provides high availability. If any of the server in the farm goes down, Load balancer can redirects the requests to other servers.
  • Provides high performance response for client requests.
  • Provides Better scalability of the web application and reduce the failure of application.
  • Session and other resource can be stored in a centralized location to access by the all server.
Advantages of Web Garden:
  • provides better application availability by sharing request between multiple worker process.
  • Web garden use processor affinity where application can swapped out based on preference and tag setting.
  • Less consumption of physical space for web garden configuration.

Application Domain in .NET

An application domain is a logical isolation boundary created around .NET applications so that applications do not access or affect each other. It is a light-weight process having its own set of code, data, and configuration settings. Application domains are created by the runtime hosts, which are invoked by the common language runtime (CLR) to load the applications that need to be executed.

ASP.NET MVC and Framework

Asp.Net MVC is a lightweight and highly testable open source framework for building highly scalable and well designed web applications.

Asp.Net MVC- 1

  • Released on Mar 13, 2009
  • Runs on .Net 3.5 and with Visual Studio 2008 & Visual Studio 2008 SP1
  • MVC Pattern architecture with WebForm Engine
  • Html Helpers
  • Ajax helpers
  • Routing
  • Unit Testing

Asp.Net MVC - 2

  • Released on Mar 10, 2010
  • Runs on .Net 3.5, 4.0 and with Visual Studio 2008 & 2010
  • Strongly typed HTML helpers means lambda expression based Html Helpers
  • Templated Helpers
  • Support for Data Annotations Attribute
  • Client-side validation
  • UI helpers with automatic scaffolding & customizable templates
  • Attribute-based model validation on both client and server
  • Overriding the HTTP Method Verb including GET, PUT, POST, and DELETE
  • Areas for partitioning a large applications into modules
  • Asynchronous controllers

Asp.Net MVC - 3

  • Released on Jan 13, 2011
  • Runs on .Net 4.0 and with Visual Studio 2010
  • The Razor view engine
  • Improved Support for Data Annotations
  • Remote Validation
  • Compare Attribute
  • Sessionless Controller
  • Child Action Output Caching
  • Dependency Resolver
  • Entity Framework Code First support
  • Partial-page output caching
  • ViewBag dynamic property for passing data from controller to view
  • Global Action Filters
  • Better JavaScript support with unobtrusive JavaScript, jQuery Validation, and JSON binding
  • Use of NuGet to deliver software and manage dependencies throughout the platform
  • Good Intellisense support for Razor into Visual Studio

Asp.Net MVC - 4

  • Released on Aug 15, 2012
  • Runs on .Net 4.0, 4.5 and with Visual Studio 2010SP1 & Visual Studio 2012
  • ASP.NET Web API
  • Enhancements to default project templates
  • Mobile project template using jQuery Mobile
  • Display Modes
  • Task support for Asynchronous Controllers
  • Bundling and minification
  • Support for the Windows Azure SDK

Asp.Net MVC - 5

  • Released on 17 October 2013
  • Runs on .Net 4.5, 4.5.1 and with Visual Studio 2013
  • One Asp.Net
  • Asp.Net Identity
  • ASP.NET Scaffolding
  • Authentication filters - run prior to authorization filters in the ASP.NET MVC pipeline
  • Bootstrap in the MVC template
  • ASP.NET Web API2




Friday, 1 May 2015

Display All the TimeZone Information of a Local System Using ASP.NET

To display all the TimeZone information in the DropDownList write the aspx code as:
 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>          
        <asp:DropDownList ID="DropDownList1" runat="server" Height="44px" Width="184px">
        </asp:DropDownList>      
    </div>
    </form>
</body>
</html>



public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DropDownList1.DataSource = TimeZoneInfo.GetSystemTimeZones();
        DropDownList1.DataTextField = "DisplayName";
        DropDownList1.DataValueField = "Id";
        DropDownList1.DataBind();
    }
}

Output :