skip to main |
skip to sidebar
SOA characteristics are defined below:
- Service are discoverable and dynamically bound
Service provider use service registry to register service and Service consumer will use Service Registry to find out proper service and consume it. For an example, financial provider gives facility to validate credit card information and register their service with the system registry. They also provide more information like charges to validate credit card information. Service consumer will find all the services which helps to validate the credit card information and choose provider who gave service at lowest price.
- Services are self contained and modular
Most important aspect of SOA is concept of modularity. A service supports a set of interfaces. These interfaces should be cohesive, meaning that they should all relate to each other in the context of a module.
- Services stress interoperability
The ability of system is to be consumed by different platforms and languages to communicate with each other. Services dependencies are loose-coupled means loose-coupled services have a few well known dependencies.
- Service have a network-addressable interface
The role of the network is central to the concept of SOA. A service must have a network-addressable interface. A consumer on a network must be able to invoke a service across the network. The network allows services to be reused by any consumer at any time. The ability for an application to assemble a set of reusable services on different machines is possible only if the services support a network interface.
- Service have coarse-gained interfaces
The concept of granularity applies to services in two ways. First, it is applied to the scope of the domain the entire service implements. Second, it is applied to the scope of the domain that each method within the interface implements. The levels of granularity are relative to each other. For instance, if a service implements all the functions of a banking system, then we consider it coarsegrained. If it supports just credit-card validation, we consider it fine-grained. In addition, if a method for inquiring about a customer returns all customer information, including address, this method would be coarser-grained than a method that does not return the customer’s address.
- Services are location transparent
Location transparency is a key characteristic of service-oriented architecture. Consumers of a service do not know a service’s location until they locate it in the registry. The lookup and dynamic binding to a service at runtime allows the service implementation to move from location to location without the client’s knowledge. The ability to move services improves service availability and performance. By employing a load balancer that forwards requests to multiple service instances without the service client’s knowledge, we can achieve greater availability and performance.
- Services are composable
A service’s composability is related to its modular structure. Modular structure enables services to be assembled into applications the developer had no notion of when designing the service. Using preexisting, tested services greatly enhances a system’s quality and improves its return on investment because of the ease of reuse. A service may be composed in three ways: application composition, service federations, and service orchestration. An application is typically an assembly of services, components, and application logic that binds these functions together for a specific purpose. Service federations are collections of services managed together in a larger service domain. For example, a checking account service, savings account service, and customer service may be composed into a larger banking-account service. Service orchestration is the execution of a single transaction that impacts one or more services in an organization. It is sometimes called a business process. It consists of multiple steps, each of which is a service invocation. If any of the service invocations fails, the entire transaction should be rolled back to the state that existed before execution of the transaction.
- Service-oriented architecture supports self-healing.
With the size and complexity of modern distributed applications, a system’s ability to recover from error is becoming more important. A self-healing system is one that has the ability to recover from errors without human intervention during execution.
To remove data from database table, we can use Truncate or Delete command on database table.
There are many difference in Truncate and Delete command:
1. Clause:
You can specify where clause to remove some data in Delete command. like:
Delete from Table1 where ID > 20
You can't specify where cluase with Truncate command. Truncate command will remove all the data from table.
2. Transaction:
Delete command is a part of transaction. So you need to commit your transaction to make changes permanent.
Truncate command is not participate in transaction. So you don't required to do anything with transaction.
3. Trigger:
Delete command will fire delete trigger of the table. Truncate command will not fire any trigger.
4. Log:
SQL server logs information regarding delete operation. So everytime log file increased when you will execute delete command. SQL server do not log any information regarding Truncate operation. So Truncate operation is faster than Delete operation.
5. Identity Value:
Truncate reset identity value if table have any identity column. Delete operation not reset any identity value.
Sometime we face problem of duplicate records in SQL server database. In this scenario, we need to remove duplicate rows.
There are many ways available to remove duplicate rows from the database like
- Using temporary table – In this you have to transfer data into temporary table which have identity column so you can identify record uniquely and remove duplicate rows. But it gives more loads on SQL if you have lots of data in your table.
- Using adding Identity column into existing database
All above options gives very heavy load to SQL server. You can remove duplicate rows using following method:
You just have to create in-memory table which just create schema of your table and add new row number column. Using row number column, you can remove duplicate rows.
With [Temp_Table_Name] as
(
Select RN = row_number() over (PARTITION by col1, col2, col3 order by col1, col2, col3), * from [Table_Name]
)
delete from [Temp_Table_Name] where RN > 1
The above script add new column of row number in your table. This is just in-memory change. You can remove duplicate rows which actually remove from your table.
Here I used Row_Number function with “Order by” and “Partition by”.
When you open SSRS reporting project in Business Intelligence studio, you can view different tool available in your toolbox (make sure your report file is open in IDE). Sometime you will get only Textbox control multiple times instead of different controls.
Come out from this problem, you have to remove some temporary files which load Toolbox. You can get these file on following location:
%userprofile%\Local Settings\Application Data\Microsoft\VisualStudio\9.0
You have to remove following files from the above path:
- toolbox.tbd
- toolbox_reset.tbd
- toolboxIndex.tbd
- toolboxIndex_reset.tbd
After removing files, you have to reset the toolbox. It will take time to reset the Toolbox. After reseting, you will get all the controls available in SSRS project.
For configuring windows authentication in WCF service, please refer my previous blog Windows Authentication in WCF
In some scenario, we need to find out the user name who calls WCF service method. You can find out current logged in user who called WCF service method using below code:
OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name
The above property will return logged in user name with domain name. For example, it returns “DOMAIN\USER”.
WCF stands for Windows Communication Foundation. WCF provides functionality to create service library. Now a day, everyone wants to implement their solution as a service so anybody else can consume it and will use it.
For example, online payment integration software gives functionality to integrate their API with your application like First Data Global gateway, PayPal etc…
WCF use to expose these services so any client can consume those services and use the service. Some services are not required any authorization to use it. But some services needs authentication before using it. We can develop security in many ways in WCF service. Common ways are defined below:
- Windows Authentication
- Form Authentication (Custom Authentication)
- Certificate base authentication
Here I talked about Windows authentication to secure your service. Windows authentication use logged on user for authentication.
Follow below steps to implement Windows authentication in your WCF service.
- Create new “WCF Service Application” project from File menu and selecting “New Project” option and select “Web” as a project type and “WCF Service Application” as a project template.
- Update SerivceModel section in web.config which is given below
- Also check authentication mode is Windows. If not then change it with “Windows”
- Open IIS and select virtual directory.
- In virtual directory property windows, Select “Directory Setting” tab and click on Edit button under “Anonymous access and authentication control”.
- Remove anonymous access and select “Integrated Windows Authentication”.
Snap of updated web.config file:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="WCFWindowsBasicHttpBinding.Service1Behavior" name="WCFWindowsBasicHttpBinding.Service1">
<endpoint address="" binding="basicHttpBinding"
bindingConfiguration="BasicHttpEndpointBinding"
name="BasicHttpEndpoint" contract="WCFWindowsBasicHttpBinding.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WCFWindowsBasicHttpBinding.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
We have mentioned security mode in binding section and bind that binding configuration with endpoint. Also remove the “mex” endpoint from the list of end points.
Now service is ready to use. You can consume the service in your client application. You have to pass user credential before calling WCF service. In client application, give following code before calling WCF service method:
Service1 client = new Service1();
client.Credentials = System.Net.CredentialCache.DefaultCredentials;
This will assign current user credential to service object. Now when you will call WCF service method, WCF will execute that method in context of that logged in user.
If user doesn’t have access on this method then WCF service will return with authentication failure exception.
You can download code from here.
SQL server analysis service uses three different storage modes for storing data into Cube.
- MOLAP – Multi-dimensional online analytical processing
- ROLAP – Relational online analytical processing
- HOLAP – Hybrid online analytical processing
What is MOLAP?
In MOLAP mode, Data will store in multi-dimensional cube. The storage is not relational database but its proprietary format.
Advantage:
- Excellent performance
- Can perform complex calculation – All calculation is pre-generated when cube is created.
Disadvantage:
- Limited data it can handle – All calculation are performed when cube is built. It is not possible to store large amount of data into cube itself.
What is ROLAP?
In this mode, Data is stored in relational database instead of cube itself.
Advantages:
- Can handle large amount of data
- Can leverage functionalities inherent in the relational database
Disadvantages:
- Performance can be slow
- Limited by SQL functionalities
What is HOLAP?
HOLAP attempts to combine ROLAP and MOLAP. When Data is very large then SSAS use ROLAP and when data is very limited then SSAS use MOLAP.