Monday, July 5, 2010

What is Cloud Computing?

clip_image001

Cloud computing is a technology that uses the internet and central remote servers to maintain data and applications. Cloud computing allows consumers and businesses to use applications without installation and access their personal files at any computer with internet access. This technology allows for much more efficient computing by centralizing storage, memory, processing and bandwidth.

A simple example of cloud computing is Yahoo email or Gmail etc. You don’t need software or a server to use them. All a consumer would need is just an internet connection and you can start sending emails. The server and email management software is all on the cloud (internet) and is totally managed by the cloud service provider Yahoo, Google etc.

The analogy is ‘If you only need milk, would you buy a cow?' All the users or consumers need is to get the benefits of using the software or hardware of the computer like sending emails etc. Just to get this benefit (milk) why should a consumer buy a (cow) software /hardware?

A cloud service has three distinct characteristics that differentiate it from traditional hosting. It is sold on demand, typically by the minute or the hour; it is elastic -- a user can have as much or as little of a service as they want at any given time; and the service is fully managed by the provider (the consumer needs nothing but a personal computer and Internet access). Significant innovations in virtualization and distributed computing, as well as improved access to high-speed Internet and a weak economy, have accelerated interest in cloud computing.

These services are broadly divided into three categories:

1. Infrastructure-as-a-Service (IaaS)

2. Platform-as-a-Service (PaaS)

3. Software-as-a-Service(SaaS)

clip_image003

1-Infrastructure-as-a-Service

Infrastructure-as-a-Service like Amazon Web Services provides virtual server instances with unique IP addresses and blocks of storage on demand. Customers use the provider's application program interface (API) to start, stop, access and configure their virtual servers and storage. In the enterprise, cloud computing allows a company to pay for only as much capacity as is needed, and bring more online as soon as required. Because this pay-for-what-you-use model resembles the way electricity, fuel and water are consumed; it's sometimes referred to as utility computing.

2- Platform-as-a-Service

Platform-as-a-service in the cloud is defined as a set of software and product development tools hosted on the provider's infrastructure. Developers create applications on the provider's platform over the Internet. PaaS providers may use APIs, website portals or gateway software installed on the customer's computer. Force.com, (an outgrowth of Salesforce.com) and GoogleApps are examples of PaaS. Developers need to know that currently, there are not standards for interoperability or data portability in the cloud. Some providers will not allow software created by their customers to be moved off the provider's platform.

3- Software-as-a-Service

In the software-as-a-service cloud model, the vendor supplies the hardware infrastructure, the software product and interacts with the user through a front-end portal. SaaS is a very broad market. Services can be anything from Web-based email to inventory control and database processing. Because the service provider hosts both the application and the data, the end user is free to use the service from anywhere.

For more info & to ask any queries plz use the post query option on the top

 

Thanks & Regards

|¯¯|)¯¯)
|__|\__\aju
___|¯¯|
(¯¯(|   |etla
¯¯¯¯¯

Wednesday, April 28, 2010

How N-Tier Architecture Application are made, using Stored Procedure in Database Layer

Hi All,
In this article i will be explaining how n-tier Architecture Applications are made. There are 3 Layers  typical in any application. They are
  1. Presentation Layer: Presentation layer is basically the front end forms which is used by the end users
  2. Business Logic Layer: This layer consists of business logic like transactional operations
  3. Database Layer :
    Consists of data and data related programming like triggers, stored procedures & functions for complex sql transactions

Making these three layers independent makes you the deal with these layers independently like any changes required in stored procedure logic can be done without disturbing other layers. Further application can be developed for other platform like from web to mobile application, without disturbing database layer and business logic layers
AppLayers

To demonstrate i will be making small application using ASP.NET with C# & SQL server where add the State names in the database using a web form. I have made a database with name myDB in SQL server with a table “States” shown below.

image

I have made a sql stored procedure for inserting the record in the database to make database layer bulky.
CREATE PROCEDURE DBO.USP_INSERT_INTO_States
(
@STATEID CHAR(5)
,@STATE VARCHAR(25)
)
AS BEGIN
INSERT INTO States(
[STATEID]
,[STATE]
)
VALUES
(
@STATEID
,@STATE
)
END

Now we will create a business layer, here business will be adding new state, this transaction in the database will be done using the stored procedure, so in next step we will be making class called StateBL for handling the State (table) related transaction and we will add business method AddNewState() for adding new state. This business layers normally made as a web service, in java EJB, .NET remoting in .NET for global access.  For now we will be making ASP.NET website and we will add business class to this website i.e. from website menu-> Add new item. This class will be our Business layer in our application, coding is given below

public class StateBL
{
    //declare the objects for database operation
    SqlCommand cmd;
    SqlConnection con;

   //represents the exception occurred during the sql transaction
    public Exception exception=null;
  
    // Initialize the connnection and command object in constructor
    public StateBL()
    {
       con=new SqlConnection("Data Source=RAJU-PC\\SQLEXPRESS;Initial Catalog=myDB;Integrated Security=True;");    
       cmd=new SqlCommand();
       cmd.CommandType=CommandType.StoredProcedure;
    }

    // Used for adding State
    public Boolean AddNewState(string StateID, String State)
    {
        try
        {
            cmd.CommandText="DBO.USP_INSERT_INTO_STATES";
            cmd.Parameters.AddWithValue("@STATEID",StateID);
            cmd.Parameters.AddWithValue("@STATEID",State);
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
            return true; //represents successful transaction
        }
        catch(Exception ex)
        {
            exception=ex;
            return false; //represents sql operation failed
        }
    }
}

Now we will create a web form i.e. our presentation layer to add record into the table through business layer

image

Coding for save button click is given below

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
    protected void btnSave_Click(object sender, EventArgs e)
    {
        StateBL objState = new StateBL();
        if (objState.AddNewState(txtStateID.Text, txtStateName.Text)) //check the return value of the AddNewState
        {
            //display the message on success
            lbMsg.Text = "State added successfully...";
        }
        else
        {
            //display the error message from exception object in the StateBL class
            lbMsg.Text = "Unable to add state, error:" + objState.exception.Message;
        }
    }
}

Here is the output of the program, first output is showing the error message due to connection string problem and second shows the successful addition of the record in the table.
image

image

Conclusion:
We have made three layers of the application
Database Layer: with data tables, stored procedure
Business Layers: having business class with business method for adding new state
Presentation Layer: we have a form for data entry

If i make business layer as web service and consider in future i need to develop the same application for mobile platform then what i need to develop, only the presentation for mobile platform. isn’t it?
AppLayers3

I hope you find this article helpful, if you liked it please do not forget to add your feedback below

download source code of above example

Thanks & Regards
l¯¯l)¯¯)
l__l\__\aju
.      l¯¯l
(¯¯(/_  /etla

Tuesday, March 23, 2010

Add Search Engine to your website

Hi All,

Now It very easy to add search engine to your website and custom search engine with specific sites for searching. To do this just goto http://www.google.com/cse/ and log in into your gmail account



Click on create custom search engine
Now enter the title & description for your search engine and specify the site you want to search. if you are adding it to your website specify your site name



select i have read & agree terms & conditions, then click on next



Then try search engine with some keywords. Click finish to create search engine that's it, now you can see your search engine in the list



Next we will see how to add this custom search to our website and customize look and feel to match our website design



Click on get code


just copy the code and paste in your webpage and test your page





Now here is my webpage with a search engine on it




For customizing the look & feel to match website design in the control panel click on look & feel and select design from choice or click customize


change the fonts, colors as per the your requirements



save and click on getcode and paste it in your webpage. You can also download CSS file and customize it as per your wish. Hope you find this useful

For more information or query you can visit my blog or join my groups and send your queries & feedback at
http://rjetla.blogspot.com/
http://groups.google.com/group/rjetla

Thanks & Regards

Raju Jetla


Recent Comments