I attended a seminar on GridGaid for interfacing with Amazon Cloud. It was cool. The tool interfaces with the Cloud and performs,
Auto Scaling - Scale up/down based on the computing load
Data Grid - Split the storage across node
But it doesn't come free of cost. The enterprise edition of GridGain has these great feature and its pay per usage (On top of what we pay for Amazon). I asked the question about how to justify the pricing for the usage of GridGain on top of Cloud cost. The presenter explained that the open source version has lot more features like automatic on/off cloud, compute on the cloud etc., But the enterprise edition has more features which will be required by large organization that requires faster computing and data load power.
Thursday, November 12, 2009
Tuesday, November 10, 2009
ORACLE Analytics functions
In one of the projects i have worked on recently, we had a requirement to group the user information based on the latest updated user and display the results. The usage of native SQL like ORDER BY & GROUP BY was cumbersome and leads to a poor query performance.
Upon research we discovered that the ORACLE Analytic functions can do whatever the native SQL function does with a better performance.
The requirement was to filter the unique user id, user number from the user profile table with the latest user entry and the result should be group by User Number. For Ex; the query should return the Mohan4 & Mohan 3.
The result can be obtained by GROUP BY Clause, but the problem is we can only retrieve GROUP BY Columns. The non-group by columns will not be retrieved in the GROUP BY clause.
We utilized the ORACLE Analytics functions to overcome these difficulties with performance, Group by issue etc, So our query looked like,
(SELECT USER_NUMBER, USER_ID, LATEST_ENTRY, OPTIONS
FROM
(SELECT USRINF.*, ROW_NUMBER() OVER (PARTITION BY USER_NUMBER ORDER BY LATEST_ENTRY DESC) RANK
From DB_SCHEMA.USERINFO USRINF WHERE LATEST_ENTRY IS NOT NULL
ORDER BY LATEST_ENTRY DESC
)
WHERE
1=1
AND RANK=1
);
In the above query, the clause “PARTITION BY” groups the results based on the column name indicated next to it. In this case, it is acted on the column USER_NUMBER. The subquery in the above query
SELECT USRINF.*, ROW_NUMBER() OVER (PARTITION BY USER_NUMBER ORDER BY LATEST_ENTRY DESC) RANK
From DB_SCHEMA.USERINFO USRINF WHERE LATEST_ENTRY IS NOT NULL
ORDER BY LATEST_ENTRY DESC
Will display the result as
The outer query filters the unique first record from the result set described above ordered by descending of the Latest_Entry column. So the result set of the final query will be
Upon research we discovered that the ORACLE Analytic functions can do whatever the native SQL function does with a better performance.
The requirement was to filter the unique user id, user number from the user profile table with the latest user entry and the result should be group by User Number. For Ex; the query should return the Mohan4 & Mohan 3.
| UserId | User_Number | Latest_Entry | Options |
|---|---|---|---|
| Mohan1 | 1 | Nov-06-2009 | Y |
| Mohan2 | 1 | Nov-07-2009 | N |
| Mohan3 | 2 | Nov-09-2009 | Y |
| Mohan4 | 1 | Nov-10-2009 | N |
The result can be obtained by GROUP BY Clause, but the problem is we can only retrieve GROUP BY Columns. The non-group by columns will not be retrieved in the GROUP BY clause.
We utilized the ORACLE Analytics functions to overcome these difficulties with performance, Group by issue etc, So our query looked like,
(SELECT USER_NUMBER, USER_ID, LATEST_ENTRY, OPTIONS
FROM
(SELECT USRINF.*, ROW_NUMBER() OVER (PARTITION BY USER_NUMBER ORDER BY LATEST_ENTRY DESC) RANK
From DB_SCHEMA.USERINFO USRINF WHERE LATEST_ENTRY IS NOT NULL
ORDER BY LATEST_ENTRY DESC
)
WHERE
1=1
AND RANK=1
);
In the above query, the clause “PARTITION BY” groups the results based on the column name indicated next to it. In this case, it is acted on the column USER_NUMBER. The subquery in the above query
SELECT USRINF.*, ROW_NUMBER() OVER (PARTITION BY USER_NUMBER ORDER BY LATEST_ENTRY DESC) RANK
From DB_SCHEMA.USERINFO USRINF WHERE LATEST_ENTRY IS NOT NULL
ORDER BY LATEST_ENTRY DESC
Will display the result as
| UserId | User_Number | Latest_Entry | Options | ROW_NUMBER() |
|---|---|---|---|---|
| Mohan1 | 1 | Nov-06-2009 | Y | 3 |
| Mohan2 | 1 | Nov-07-2009 | N | 3 |
| Mohan3 | 2 | Nov-09-2009 | Y | 1 |
| Mohan4 | 1 | Nov-10-2009 | N | 3 |
The outer query filters the unique first record from the result set described above ordered by descending of the Latest_Entry column. So the result set of the final query will be
| UserId | User_Number | Latest_Entry | Options | ROW_NUMBER() |
|---|---|---|---|---|
| Mohan3 | 2 | Nov-09-2009 | Y | 1 |
| Mohan4 | 1 | Nov-10-2009 | N | 3 |
Monday, September 21, 2009
ORACLE 10g - Merge Into statement
In the traditional programming world, when we try to perform a function of update, we will check if the matching record exists in the system. If so, we would update the record. If the matching record does not available in the system, we would insert the row.
ORACLE's merge statment performs the update/insert through a single statment. Through the merge statement, the validation or check can be made before update/insert. For eg: The following merge statement will update the table EASTable when the userid matches with the input. If the user id is not present in the table, the input user information will be inserted.
MERGE INTO EASTable EAS
USING DUAL
ON ( EAS.USER_ID = USER_ID_INPUT)
WHEN MATCHED THEN
UPDATE SET EAS.IND1 = IND1_INPUT
EAS.IND2 = IND2_INPUT
WHEN NOT MATCHED THEN
INSERT
(EAS.USER_ID, EAS.IND1,EAS.IND2)
VALUES (USER_ID_INPUT,IND1_INPUT,IND2_INPUT);
COMMIT;
ORACLE's merge statment performs the update/insert through a single statment. Through the merge statement, the validation or check can be made before update/insert. For eg: The following merge statement will update the table EASTable when the userid matches with the input. If the user id is not present in the table, the input user information will be inserted.
MERGE INTO EASTable EAS
USING DUAL
ON ( EAS.USER_ID = USER_ID_INPUT)
WHEN MATCHED THEN
UPDATE SET EAS.IND1 = IND1_INPUT
EAS.IND2 = IND2_INPUT
WHEN NOT MATCHED THEN
INSERT
(EAS.USER_ID, EAS.IND1,EAS.IND2)
VALUES (USER_ID_INPUT,IND1_INPUT,IND2_INPUT);
COMMIT;
Monday, June 22, 2009
Enhance ASPX Page load performance
This morning i was reading a posting on the internet about, improving the ASPX page performance. The blogger recommends the usage of CSS Class in the HTML instead of inline HTML. Inline styles on the HTML's increases the HTTP response size and hence increases the page load time. Click here to read the post
To improve the page load time, we could consider the following options as well.
Compressing the JavaScript
Compressing the CSS
But the issue with the compression technique is the overhead in debugging.
To improve the page load time, we could consider the following options as well.
Compressing the JavaScript
Compressing the CSS
But the issue with the compression technique is the overhead in debugging.
Labels:
ASP.NET,
CSS,
HTML,
Page load performance improvement
Friday, June 19, 2009
System.data.oracleclient - Deprecated in .NET 4.0
The ADO.NET team had posted an article about the System.Data.OracleClient component. This component is available in .NET 4.0 but it is deprecated. So the existing and new applications will still compile with warnings for the first time.
It has been recommended to make use of microsoft's parter component to substitute the System.Data.OracleClient.
One of the options to consider is using "ORACLE ODP.NET". This component has some issues with respect to performance, errors etc.,
It has been recommended to make use of microsoft's parter component to substitute the System.Data.OracleClient.
One of the options to consider is using "ORACLE ODP.NET". This component has some issues with respect to performance, errors etc.,
Friday, June 12, 2009
Jquery Part 4 - AJAX method call through JQuery
The JQuery tool provides a very good, easy to use AJAX interface. I came across a scenario where this could be applied very well. Assume we have a web service that returns the XML data and we need to display the XML output in the web page when the user clicks a button without refresh. We make AJAX calls through JQuery to the server to invoke the web service as given below.

The above code has many components associated with it. $document.ready will determine whether the HTML is loaded completely and rendered. The next function $('#btn1').click will bind the click event to the function following that. So the scripts within the click function will execute when the user clicks the button btn1.
The next line indicates that we are making an ajax call to the web service url "
jqueryAjax.aspx/GetWebServiceResult". The type parameter indicates the request type GET/POST. The data parameter can be used to pass the input parameter to the server side method. In this example the server side method is GetWebServiceResult. So the method declaration will have a tag [WebMethod] on the method's declaration. This method expects an input parameter of type int and it will pass the parameter recieved from client into the web service. From the client side we will pass the value to this method through data parameter in JQuery.
The contentType and dataType parameter will indicate the type of data transferred between client and server.
When the button is clicked, the client side code will execute and invokes the server side method and pass the input parameter to fetch the result. The server side method in turn will invoke the web service and the result is passed in the object "msg". If the AJAX call is successful, the Success function is invoked. If the AJAX call is failed, the failure function will be invoked.
The BuildHTML method will parse the web service results and display in the HTML.
So it is EASY :), No More UpdatePanel, ScriptManager!!!

On the button click we need to load the web service data without a post back.
To do that we need to include the JQuery tool kit scripts in the project folder and set the reference to the scripts.
The above code has many components associated with it. $document.ready will determine whether the HTML is loaded completely and rendered. The next function $('#btn1').click will bind the click event to the function following that. So the scripts within the click function will execute when the user clicks the button btn1.The next line indicates that we are making an ajax call to the web service url "
jqueryAjax.aspx/GetWebServiceResult". The type parameter indicates the request type GET/POST. The data parameter can be used to pass the input parameter to the server side method. In this example the server side method is GetWebServiceResult. So the method declaration will have a tag [WebMethod] on the method's declaration. This method expects an input parameter of type int and it will pass the parameter recieved from client into the web service. From the client side we will pass the value to this method through data parameter in JQuery.
The contentType and dataType parameter will indicate the type of data transferred between client and server.
When the button is clicked, the client side code will execute and invokes the server side method and pass the input parameter to fetch the result. The server side method in turn will invoke the web service and the result is passed in the object "msg". If the AJAX call is successful, the Success function is invoked. If the AJAX call is failed, the failure function will be invoked.
The BuildHTML method will parse the web service results and display in the HTML.
So it is EASY :), No More UpdatePanel, ScriptManager!!!
Monday, June 1, 2009
WCF and RESTFul Service
I was attending few webminars and read materials over the past few weeks on the WCF fundamentals. One of the great feature with WCF is its ability to expose the services in RESTful format.
Subscribe to:
Posts (Atom)