Rise of Cloud Computing

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Web Tech Trends 2014

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Thursday, 14 November 2013

Sample C# Code To Send Email From Gmail and GoDaddy Server

Tested Sample C# Code To Send Mail From GoDaddy


public class Constant
{
     public const string SmptHostName = "relay-hosting.secureserver.net";
     public const int SmptPortName = 25;
}
public static void SendMailMessage_GoDaddy(EmailData emailDt)
        {
            try
            {
                if (emailDt != null)
                {
                    MailMessage mMailMessage = new MailMessage();
                    mMailMessage.From = new MailAddress(emailDt.SourceMailUserName, "EPackersAndMovers");
                    mMailMessage.To.Add(new MailAddress(emailDt.ToEmailId));
                    if (emailDt.BccEmailIds != null && (emailDt.BccEmailIds.Count > 0))
                    {
                        foreach (string str in emailDt.BccEmailIds)
                            mMailMessage.Bcc.Add(new MailAddress(str));
                    }
                    mMailMessage.Bcc.Add(new MailAddress("TestId@gmail.com"));
                    if (emailDt.CcEmailIds != null && (emailDt.CcEmailIds.Count > 0))
                    {
                        foreach (string str in emailDt.CcEmailIds)
                            mMailMessage.CC.Add(new MailAddress(str));
                    }
                    mMailMessage.Subject = emailDt.Subject;
                    string MessageFormat = Constant.MailMessageFormat;
                    mMailMessage.Body = MessageFormat.Replace("###_MESSAGEBODY_###", emailDt.MessageBody);
                    mMailMessage.IsBodyHtml = true;
                    mMailMessage.Priority = MailPriority.Normal;
                    SmtpClient mSmtpClient = new SmtpClient(Constant.SmptHostName, Constant.SmptPortName);
                    mSmtpClient.EnableSsl = false;
                    mSmtpClient.Send(mMailMessage);
                }
                else throw new Exception("emaildata  object is null while sending Mail messagem : SendMailMessage_GoDaddy()");
            }
            catch (Exception)
            {
                throw;
            }
        }



Tested Sample C# Code To Send Mail From Gmail


public static void SendMailMessage_Gmail(EmailData emailDt)
        {
            try
            {
                if (emailDt != null)
                {
                    MailMessage mMailMessage = new MailMessage();
                    mMailMessage.From = new MailAddress("TestId@gmail.com", "TestDisplayName");
                    mMailMessage.To.Add(new MailAddress(emailDt.ToEmailId));
                    if (emailDt.BccEmailIds != null && (emailDt.BccEmailIds.Count > 0))
                    {
                        foreach (string str in emailDt.BccEmailIds)
                            mMailMessage.Bcc.Add(new MailAddress(str));
                    }
                    mMailMessage.Bcc.Add(new MailAddress("TestBCCMail@gmail.com"));
                    if (emailDt.CcEmailIds != null && (emailDt.CcEmailIds.Count > 0))
                    {
                        foreach (string str in emailDt.CcEmailIds)
                            mMailMessage.CC.Add(new MailAddress(str));
                    }
                    mMailMessage.Subject = emailDt.Subject;
                    string MessageFormat = Constant.MailMessageFormat;
                    mMailMessage.Body = MessageFormat.Replace("###_MESSAGEBODY_###", emailDt.MessageBody);
                    mMailMessage.IsBodyHtml = true;
                    mMailMessage.Priority = MailPriority.Normal;
                    SmtpClient client = new SmtpClient("smtp.gmail.com", 587)
                    {
                        Credentials = new NetworkCredential("TestId@gmail.com", "Password123"),
                        EnableSsl = true
                    };
                    client.Send(mMailMessage);
                }
                else throw new Exception("emaildata  object is null while sending Mail messagem : SendMailMessage_GoDaddy()");
            }
            catch (Exception)
            {
                throw;
            }
        }

Comparison Multi-Tenant SaaS Applications and Web applications

Tenancy and Personalization

Effective SaaS applications, reaching into the Long Tail of market demand, will personalize the customer or partner experience.  SaaS applications enable teams to uniquely configure business events, processes, rules, or data per customer or partner.   When delivering a business capability as a SaaS application, decouple privileges, policies, and rules from application code, and enable the SaaS application to personalize the experience across:
  • Information access privileges
  • Information aggregation and composition
  • Social network access privileges
  • Business processes and rules
  • Service levels and Quality of Service
  • Security policies
  • Monetization rates

SaaS applications are personalized to meet the requirements of individual tenants.  When considering SaaS application isolation, resource optimization, and aggregation requirements, tenancy dimensions will be baked into your SaaS application.  Carefully consider whether the SaaS application will be personalized across people (e.g. organization, team, or individual), projects (e.g. joint venture, marketing campaign, benefits enrollment), or IT artifacts (e.g. application, API, service, or machine).  Figure 1 illustrates the tenancy dimensions.

Tenancy Dimensions
Figure 1: Tenancy Dimensions

Self-Service Agility and Resource Optimization Cost Savings

Efficiently scaling business revenue while minimizing operational expense requires rapidly onboarding new customers and partners via on-demand self-service.  The ideal SaaS application provides an on-demand self-service environment that facilitates:
  • Registering tenants (e.g. organizations, individuals, or apps)
  • Configuring business objects per tenant
    • Processes, rules, event notifications, and data elements
  • Integrating unique data sources
    • Master data sources, identity repository, APIs
  • Provisioning project workspaces
  • Creating and viewing analytics

SaaS offers a more affordable solution per tenant, while maintaining operating margin, and broadening solution reach into the long tail of market demand.  Organizations can stretch their capital or operational dollars and deliver solutions down market into small to medium-size businesses or to individual consumers.  IT business management techniques available to lower cost per tenant include reducing utilization charges, decreasing integration and configuration steps, or eliminating on-boarding activities.  Teams can reduce utilization charges by optimizing resource sharing and increasing tenant density.

Delivering Business Analytics based on Data Aggregation

Because SaaS applications share data models, process models, and common APIs, SaaS applications can readily drive social, community, and ecosystem business models.  With appropriate tenant consent, SaaS applications may remove personal identity information (PII) markers, aggregate data, and present trends.  With SaaS, your business has a pathway to expand revenue by delivering best practice insight based on marketplace analytics.

Wednesday, 13 November 2013

Sample Code For Transparent Data Encryption - TDE Sql Server 2008 and Above


  1. Create a master key for the database (must be in master database).
  2. Create a certificate that's protected by the master key. 
  3. Create a special key that's used to protect the database. This key is called the database encryption key (DEK) and you secure it using the certificate.
  4. Enable encryption.

 Sample Code given below demonstrates how to enable TDE on a sample database named Raptor_Cloud.
Listing 1: Code to Enable TDE on a Database
USEMASTER
GO

CREATEMASTERKEYENCRYPTIONBYPASSWORD='R@pt0r';
--DROP MASTER KEY

CREATECERTIFICATE RaptorCloudCertificate WITHSUBJECT='Raptor Cloud Certificate';

SELECT*FROM [sys].[symmetric_keys]
SELECT*FROMsys.certificates

GO

BACKUPCERTIFICATE RaptorCloudCertificate
TOFILE='\\ws-cgomes\Shared\RaptorCloudCertificate.bak'
WITHPRIVATEKEY (
FILE='\\ws-cgomes\Shared\RaptorCloudCertificate.pvk',
ENCRYPTIONBYPASSWORD='R@pt0r');

GO

USE Raptor_Cloud

GO

--DROP DATABASE ENCRYPTION KEY

CREATEDATABASEENCRYPTIONKEY
WITHALGORITHM=AES_256
ENCRYPTIONBYSERVERCERTIFICATE RaptorCloudCertificate



SELECT name,database_id
FROMsys.databases;

ALTERDATABASE Raptor_Cloud
SETENCRYPTIONON;

-- Command to know status of database encryption  

SELECT*FROMsys.dm_database_encryption_keys

-- Explaination of different encryption_state  
/*
0 = No database encryption key present, no encryption
1 = Unencrypted
2 = Encryption in progress
3 = Encrypted
4 = Key change in progress
5 = Decryption in progress
6 = Protection change in progress (The certificate or asymmetric key that is encrypting the database encryption key is being changed.
*/
GO

ALTERDATABASE Raptor_Cloud
SETENCRYPTIONOFF;

SELECT*FROMsys.dm_database_encryption_keys

GO

DROPCERTIFICATE RaptorCloudCertificate

GO

CREATECERTIFICATE RaptorCloudCertificate
FROMFILE=N'\\ws-cgomes\Shared\RaptorCloudCertificate.bak'
WITHPRIVATEKEY
(FILE=N'\\ws-cgomes\Shared\RaptorCloudCertificate.pvk'
,DECRYPTIONBYPASSWORD=N'R@pt0r'
);

GO


To Know status of encryption and certificates
SELECT*FROMsys.certificates

SELECT* FROMsys.dm_database_encryption_keys

Tuesday, 12 November 2013

Sample Code For Sql Server Cell Level Encryption

Sample Code below for Sql Server cell level encryption shows verified code

--drop table t_employees

--drop symmetric key sk_employees

-- Creates an asymmetric key encrypted by password 'Ivp@India'
CREATEASYMMETRICKEY Asym_Raptor
WITHALGORITHM=rsa_2048
ENCRYPTIONBYPASSWORD='Ivp@India'
-- Verify Asymmetric Key
select*from [sys].[asymmetric_keys]

-- create a symmetric key encrypted by asymmetric key to protect the employee sensitive data, in this case - the salary
createsymmetrickey sk_employees withalgorithm=aes_256ENCRYPTIONBYASYMMETRICKEY Asym_Raptor         --encryption by password = 'Kamal@1887';
-- Verify Key Created
select*from [sys].[symmetric_keys]

-- Create Sample Table
createtable t_employees(id intidentity(1,1), name varchar(300), salary varbinary(300));

-- open the key so that we can use it
--open symmetric key sk_employees decryption by password = 'Kamal@1887';
OPENSYMMETRICKEY sk_employees
DECRYPTIONBYASYMMETRICKEY Asym_Raptor
WITHPASSWORD='Ivp@India'

-- verify key was opened
select*fromsys.openkeys;

-- insert some data without using authenticator
insertinto t_employees values ('Alice Smith',encryptbykey(key_guid('sk_employees'),'$200000'));
insertinto t_employees values ('Bob Jones',encryptbykey(key_guid('sk_employees'),'$100000'));

-- see the result; salary is encrypted
select*from t_employees;

update t_employees set salary='$900000'where id=1


-- see decrypted result;
select id, name,convert(varchar(10),decryptbykey(salary))as salary from t_employees

-- Update Table Data
update t_employees set salary=encryptbykey(key_guid('sk_employees'),'$400000')where id=1

-- see decrypted result;
select id, name,convert(varchar(10),decryptbykey(salary))as salary from t_employees

-- close the key

closesymmetrickey sk_employees