Labels

Showing posts with label Diagrams. Show all posts
Showing posts with label Diagrams. Show all posts

Wednesday, February 6, 2008

Clustered Non-Clustered Indexes

Clustered Indexes

· Determine the physical order of data in a table.

· You can only have one clustered index for each table, as the data pages can only be physically stored in one way

· After a clustered index is created, data pages are physically contiguous, which can assist with the speed of queries.

· For a table with a clustered index, the leaf nodes are the data pages themselves.

· Good candidates - Columns that are

o Queried often in range queries (Between, <, >)

o Order large result sets,

o Used in aggregate functions, and

o Whose contents are distinct (primary or unique keys)

o Lastly, Choose a Smaller Clustered Index Key over a wider column, reducing the size of the index needed and improving I/O operations.

· Bad candidates - Columns that are

o Frequently updated columns and

o Non-unique columns


Non-Clustered Indexes

· It stores index pages separately from the physical data, with pointers to the physical data located in the index pages and nodes. In a way it contains poitner to the Clustered Index leaf pages

· Nonclustered index columns are stored in the order of the index key column values.

· You can have up to 249 nonclustered indexes on each table or indexed view.

· For nonclustered indexes, the leaf node level is the Index Key Coupled To A Bookmark.

· The nonclustered index bookmark points to the B-Tree structure of the table's clustered index (if one exists). If the base able is a heap, the nonclustered index bookmark points to the table row's Row-ID.

· Good candidates - Columns that are

o Used in Where clause

o Order smaller result sets on unique data

o involved in searchable arguments using operators such as =, <, >, IN, EXISTS, and LIKE.


To Index or not to Index?

· Indexes take up space, and should not be added 'just in case'. View Tools for testing the effectiveness of your indexes.

· Indexes can slow down data loads significantly, and may not make sense for tables that are used expressly for data Imports And Staging.

· If your table will not be queried and is used as an intermediate staging ground, leaving indexes off the table may be a better choice.

· The same goes for very small tables where, no matter what, the query optimizer always performs a table scan.

· Keep in mind that heaps become naturally fragmented over time and, if data updates are frequent enough, even small tables can begin to take up more space than necessary. There are those who believe that a clustered index should exist for every table in the database, period.

· One technique for reducing bulk load operations on a table is to remove the index during the load and add the index once the load is finished



Regards,
Arun..

Wednesday, December 12, 2007

MVC Architecture

MVC Framework:


What is a Model View Controller (MVC) Framework?

MVC is a framework methodology that divides an application's implementation into three component roles: models, views, and controllers.

  • "Models" in a MVC based application are the components of the application that are responsible for maintaining state. Often this state is persisted inside a database (for example: we might have a Product class that is used to represent order data from the Products table inside SQL).
  • "Views" in a MVC based application are the components responsible for displaying the application's user interface. Typically this UI is created off of the model data (for example: we might create an Product "Edit" view that surfaces textboxes, dropdowns and checkboxes based on the current state of a Product object).
  • "Controllers" in a MVC based application are the components responsible for handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI. In a MVC application the view is only about displaying information - it is the controller that handles and responds to user input and interaction.

One of the benefits of using a MVC methodology is that it helps enforce a clean separation of concerns between the models, views and controllers within an application. Maintaining a clean separation of concerns makes the testing of applications much easier, since the contract between different application components are more clearly defined and articulated.

The MVC pattern can also help enable red/green test driven development (TDD) - where you implement automated unit tests, which define and verify the requirements of new code, first before you actually write the code itself.


Thanks & Regards,

Arun Manglick || Tech Lead

Friday, September 28, 2007

Thread State Diagram

Thread State Diagram:

















Regards,
Arun..

Control Hierarchy

Below is the explanation of - How Control are loaded and initialized along with the Page life Cycle.

Note- This all happens before the 'Init' phase of the Page Life Cycle. i.e It happens in the 'Initialization' phase.

Imagine you have an ASP.NET Web page with the following HTML portion:













When this page is first visited, a class will be autogenerated that contains code to programmatically build up the control hierarchy. The control hierarchy for this example can be seen as below.














This control hierarchy is then converted to code that is similar to the following:






















When the control hierarchy is constructed, the properties that are explicitly set in the declarative syntax of the Web control are assigned in the code. (For example, the Button Web control has its Text property set to "Submit!" in the declarative syntax – Text="Submit!" – as well as in the autogenerated class—Button1.Text = "Submit!";.

Regards,
Arun Manglick

Friday, April 13, 2007

AppDomain Concept

Below is the way how Appdomain works:






A single process can run several application domains.











þ A single managed process (one which has loaded the CLR) can contain any number of AppDomains.

þ The simplest only contain one.

þ AppDomains:

o Are a finer-grained level of isolation between logical components inside the same process, for both reliability and security purposes.

o They are a good alternative to Process-Level Isolation because of the relative inexpensiveness of Creating, Managing, And Switching execution and due to the level of Resource Sharing among AppDomains in a process.

o AppDomains within a process are not entirely isolated. While they do generally load their own assemblies and have their own copies of static variables, for example, resource leaks from one AppDomain can affect another and HANDLE-thieving security holes are possible because AppDomains share a single per-process handletable. AppDomains can be shut down individually while still keeping the enclosing process alive.



Regards,
Arun....

Tuesday, April 10, 2007

HTTP PipeLine.

See the below three figures...





































1. The ASP.NET HTTP pipeline relies on IIS to receive the request.

2. When IIS receives an HTTP request, it examines the extension of the file.

3. If the file extension is associated with executable code, IIS invokes that code, in order to process the request.

4. Mappings from file extensions to pieces of executable code (.exe) are recorded in the IIS metabase.

5. When ASP.NET is installed, it adds entries to the metabase (associating various standard file extensions, including .aspx and .asmx), with a library called aspnet_isapi.dll.

6. When IIS receives an HTTP request for one of these files, it invokes the code in aspnet_isapi.dll, which in turn funnels the request into the HTTP pipeline.

7. Aspnet_isapi.dll uses a named pipe to forward the request from the IIS to an instance of the ASP.NET worker process, aspnet_wp.exe.

8. The aspnet_wp.exe worker process uses an instance of the HttpRuntime class to process the request.


Hope it is clear.....

Regards,
Arun..

Application cum Page Events ... Diagram

Below the diagrammatic representation of mixing Page-Events with Application-Events.
























This life cycle of the ASP.NET page starts with a call to the ProcessRequest() method. This method begins by initializing the page's control hierarchy.

The life cycle of Page ends by handing off the Web page's HTML markup to the Web server, which sends it back to the client that requested the page.

1

Application_Start

2

Application_BeginRequest

3

Application_AuthenticateRequest

4

Application_AuthorizeRequest

5

Application_ResolveRequestCache

6

Session_Start

7

Application_AcquireRequestState

8

Application_PreRequestHandlerExecute

Page Life Cycle occurs, and at the end generated HTML is sent to the server. This HTML is then rendered by the client/browser.

This is the place where the Page events mentioned at the right side of figure 2 occurs.

9

Application_PostRequestHandlerExecute

10

Application_ReleaseRequestState

11

Application_UpdateRequestCache

12

Application_EndRequest

13

Application_PreSendRequestHeaders

14

Application_PreSendRequestContent

Form Displays


Hope it clears the long awaited doubt...




Regards,
Arun....

How Authentication Flows... Diagrams

Reference -

http://technet2.microsoft.com/windowsserver/en/library/9e7e3daf-7500-4cb6-96b0-904ba3aec98d1033.mspx?mfr=true

http://docs.google.com/Doc?docid=df3bnbzf_240dqr5rr&hl=en


Forms Authentication:





















Windows Authentication:



















Hope it will clear the vision towards Authentication flow...

Regards,
Arun ......