SharePoint as a services platform

September 8, 2010

Introduction

Over the last two years, SharePoint has increasingly been established as an enterprise platform  in organizations worldwide. Now, with the advent of SharePoint 2010, organizations have the ability to develop, host and manage custom services (as in SOA services) within SharePoint.

This new capability in SharePoint 2010 is  part of Service Application Framework (SAF) .  SAF  allows out of the box services ( such as search and managed metadata), as well as, custom developed services to be hosted on the SharePoint infrastructure. In this post, we will take a deeper look at SAF, explore the benefits it offers and discuss examples of services that can take advantage SAF.

Note – While SAF is new in SharePoint 2010, the Excel Services capability in MOSS is similar in concept. Excel Services introduced the notion of moving the processing out to a different application pool ( possibly to different machine altogether )

Services  Platform

SOA done right can bring a number of benefits to an organization including software reuse, better alignment with business processes and lower cost and  agile development cycles. However, achieving these benefits requires building on top of a platform that provides a number of capabilities including:

1) Governance and Registry – Capability to catalog and publish access to the available services.

2) Load Balancing and High Availability – Capability to make the services fault tolerant and resilient to varying loads.

3) Administration -  Capability to centrally manage services including configuration, security, leverage backup and restore functionality.

4) Security – Capability to secure services and set the security context.

5) Tooling  – Capability to author business logic by orchestrating different services through mashups and workflows.

For more information on  SOA terms and concepts please refer  to OASIS Reference Model for Service Oriented  Architecture at  http://docs.oasisopen.org/soa-rm/v1.0/

 

Services Application Framework (SAF)

As stated earlier, the latest version of SharePoint introduces the notion of Service Application Framework (SAF). SAF allows creation of custom services that can be hosted within SharePoint. These services can then be consumed by applications within  SharePoint. In fact, SAF forms the basis for all the core SharePoint services including Search, Managed Metadata and Excel Services.

Let us take a detailed look at SAF Object Model.

The diagram below depicts the overall SAF object model. SPFarm and SPServer classes have been available in the previous versions as well – SPFarm represents a SharePoint server farm while SPServer represents a server within the farm. SAF adds a few new classes to the mix. SPService represents a service (such as the Search service ) that is registered within a SharePoint farm. SPServiceInstance represents an instance of the service installed on an application server ( think of a service that is installed on more than one application server within the SharePoint farm). SPServiceApplication and SPServiceApplicationProxy represent logical endpoints (logical because they abstract the notion of multiple services instances from the consumers of the service). The fact that service is broken into distinct Application and ApplicationProxy classes, is a key concept that allows  services to take advantage of a flexible deployment , auto load-balancing and fault-tolerance.

image

Now that we have seen the key classes in the SAF object model we are ready to look into the various pieces required for creating a custom service.  The diagram below depicts the different pieces involved. 

image

Let us start from the bottom of the stack and look at the SQL Server tier.  Services rely on SharePoint configuration database for storing any settings. Additionally, it is possible to provision  a custom database ( separate from the content DB) as a persistence store.  Next is the application server tier. This is where the all the components that make up the service are installed. For instance, executables, Windows services and class libraries etc.  A WCF contract is the easiest way to expose the service endpoint. While SAF does not preclude the use of non-WCF stacks, using WCF offers a number of advantages such as the built-in service context, load balancer etc. Finally, let us look at the Web Front End. As stated earlier, a custom service is typically consumed by SharePoint Web Front End (WFE) such as a WebPart. WFE is where you would typically install the ServiceApplication proxy. The proxy abstracts the fact that a service can be installed on multiple application servers. Service consumers invoke the service via the proxy. The proxy, in turn,  figures out which application server to go to, by leveraging the built-in load balancer.

More concretely, implementing a custom service involves following high level steps:

1) Define the WCF endpoint (address, contract and binding) where the custom service will be hosted within the SharePoint farm.

2) Implement  the business logic and package them in the form of class libraries, executables, windows services.

3) Implement the SAF classes

Let us assume that we are building a service called Custom Service. Let us further assume that this service utilizes the WCF as its  communication stack and is hosted in IIS (note again that we are not required to use WCF/IIS)

Building Custom Service will require that we implement the following SAF classes:

CustomService – This class inherits from the SPIisWebService and is used to register the service with the farm. As part of inheriting from SPIisWebService we are required to provide installation steps, links to ASPX pages that are surfaced within the SharePoint central administration.

CustomServiceInstance– This class inherits from the SPIisWebServiceInstance and is used to register the service with an application server.

CustomServiceApplication- This class inherits from the SPIisWebServiceApplication and is used to register a logical endpoint. This class also encapsulated all the configuration settings associated with a service. For instance,   as part of inheriting from SPIisWebServiceApplication , we are required to implement a properties such as VirtualPath that tells SharePoint the URI of the service endpoint.

CustomServiceApplicationProxy- This class inherits from the SPIisWebServiceApplicationProxy and represents a connection to CustomServiceApplication.

4) Determine if a custom persistence store is required or not. If a custom persistence store is needed, we can have it  created as part of  the service application provisioning step and include it in backup and restore operation.

For more information on steps involved in building a custom service, including sample code, please refer DTaylor’s excellent SAF blog at http://blogs.msdn.com/b/dtaylor/

SharePoint as a Services  Platform

Now, armed with an understanding of  SAF, we are ready to look at how SAF enables SharePoint to be leveraged as a services platform.

 

1) Administration – Once the service has been registered with the farm, it can be managed via the SharePoint Central Administration. The following diagram depicts the central administration screen to add a new service  and manage an existing service.

image

2) Governance and Registry – SharePoint provides a topology service that allows SharePoint administrators to discover published services available within a farm. Typically, it is used by administrators to connect to services from remote farms. The following diagram depicts the UI for publishing an existing service via the topology service.

image

 

3) Load Balancing and High Availability – SAF allows multiple service deployment topologies to meet high load and availability requirements. The following diagrams depicts two different topologies.

image 

This setup relies on a dedicated services farm (Farm 2)topology. Farm1 and Farm 3 subscribe to service offered by Farm 2. 

 

image

 

This setup depicts a single farm configuration. For load balancing purposes, the custom service is installed on three out of the four application servers in the farm. The service proxy is installed on both the WFEs.

 

 

4) Security – SharePoint supports claims-based authentication using Windows Identity Foundation (WIF). Custom services can take advantage of this capability to delegate user permissions to services. In other words, custom services can make authorization decisions based on delegated identity of the user involved( even if the communication is over multiple hops – across farms, for instance) 

5) Tooling – Tools such as SharePoint Designer,  Visio and third party tools such as Nyntex make it easy to create mashups by utilizing  OOB and custom services.

Custom Service Scenarios

Let us look at a couple of scenarios where developing custom services would be beneficial.

Integrate external applications into SharePoint

In this scenario, a customer has an existing proprietary .NET based task tracking application that they would like to  integrate into their SharePoint farm. In doing so, they are seeking to leverage the collaboration, maintenance and provisioning capabilities offered by SharePoint.

Using SAF they could package the backend code as a ServiceApplication that can be installed on one or more application servers. In addition, they would need to develop an application proxy that will be installed on WFEs.

The benefit of packaging the task tracking system as a custom SharePoint service is that the users can seamlessly use it in conjunction with other SharePoint capabilities such as authentication. In addition, the task tracking system is now managed within the unified governance model for the SharePoint farm and can thereby leverage its fault tolerance, backup and restore capabilities.

Externalize compute intensive processing

In this scenario, a customer requires elastic computing capability to handle high volumes of calculation requests. Rather than perform these calculations within the SharePoint infrastructure ( by adding application servers), it may make sense to take advantage of a cloud platform such as Windows Azure.

Using SAF, they could develop just the ServiceApplicationProxy that  simply forwards the incoming requests to Windows Azure. Note that ServiceApplication is not needed since the backend computation is happening within Windows Azure.

The benefit of abstracting the invocation of Windows Azure hosted calculations, as custom service is that customers can now seamlessly access it, not unlike how they would access the out of the box services such as search. So, for instance, consumers  can continue to use claims based scheme to invoke the service. Another benefit of this approach is that the configuration information, such as Windows Azure project details, can be maintained in the SharePoint configuration database.  

Summary

In this post, we have seen how SharePoint Service Framework (SAF) enables custom services to be developed, hosted and managed within SharePoint 2010. By taking advantage of this capability, organizations can develop new functionality and expose  existing software assets, as services that are managed within the SharePoint infrastructure. It is also expected that  ISVs will take advantage of this capability to expose their offerings as services within SharePoint.

17 Responses to “SharePoint as a services platform”


  1. […] For detailed discussion on building custom SharePoint Service Application that can act as conduit to the Windows Azure AppFabric Service Bus, please refer to my earlier blog post. […]

  2. Abigail Says:

    After going over a number of the blog posts on your
    site, I seriously appreciate your technique of writing a blog.

    I saved it to my bookmark site list and will be checking
    back soon. Take a look at my website too and tell me how you feel.

  3. create web pages Says:

    Wow! In the end I got a website from where I know how to actually take
    helpful data concerning my study and knowledge.


  4. Hi there, just became alert to your blog through Google,
    and found that it’s truly informative. I’m going
    to watch out for brussels. I’ll be grateful if you continue this in future. Lots of people will be benefited from your writing. Cheers!

  5. Alfonzo Says:

    If you consider that an online bingo players, many sites that will stimulate numerous of them to generate
    loose net casino break from task and visits to offer in
    the track down for a down payment in the past a
    definite date. One way to test yourself is to deal yourself hand after hand in
    front of a mirror and watch yourself as you react to the cards.

    The player guides Phen through 10 levels of dungeon gameplay, finding a whole host of weapons and other items
    as well.

  6. wso blackhat Says:

    I think the admin of this website is actually working hard
    in favor of his web site, since here every stuff is quality based stuff.


  7. Hello there, just became aware of your blog through Google,
    and found that it is truly informative. I am going to watch out for brussels.

    I will be grateful if you continue this in future. Numerous people will be
    benefited from your writing. Cheers!


  8. Aw, this was an exceptionally good post. Spending some time and actual effort to produce a good article… but what can I say… I put things off a lot and never manage to get nearly
    anything done.


  9. Wow! At last I got a webpage from where I be capable of really take helpful information
    concerning my study and knowledge.

  10. Julie Says:

    It’s hard to find educated people in this particular topic, however, you sound like you know what you’re
    talking about! Thanks


  11. I truly love your website.. Excellent colors & theme. Did you develop this website
    yourself? Please reply back as I’m looking to create my very own blog and would love to find out where you got this from or exactly what the theme is named. Appreciate it!


  12. I am regular reader, how are you everybody? This article posted at
    this web page is really good.

  13. yogurt Says:

    Magnificent goods from you, man. I’ve keep in mind your stuff prior to and you are just extremely fantastic.

    I actually like what you have obtained right here,
    really like what you’re saying and the way through which you say
    it. You are making it enjoyable and you continue to care for to keep it smart.

    I cant wait to read much more from you. That is really a tremendous site.

  14. Chanda Says:

    fantastic issues altogether, you simply gained a new reader.
    What could you recommend about your submit that you simply made some days
    in the past? Any positive?


  15. […] SharePoint as a services platform | Fleeting Thoughts – Sep 08, 2010 · Introduction. Over the last two years, SharePoint has increasingly been established as an enterprise platform in organizations worldwide. Now, with the …… […]


  16. […] SharePoint as a services platform | Fleeting Thoughts – Sep 08, 2010 · Introduction. Over the last two years, SharePoint has increasingly been established as an enterprise platform in organizations worldwide. Now, with the …… […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: