SHA Vs. PHA in SharePoint 2013

When to choose SHA or PHA.

  1. SHA: SharePoint Hosted App
  2. PHA: Provider Hosted App

Apps Overview

As we all know, Apps are the preferred programming model for SharePoint 2013. Microsoft introduced the App Model in SharePoint 2013.

Apps provide the following advantages:

  1. Code outside Server
  2. Discoverability
  3. App Store Eco System
  4. Easy Installation
  5. Easy Un-installation

Advantages of SHA

SharePoint Hosted Apps are those in which the code is hosted in the SharePoint server. Since the App contains the JavaScript Object Model (JSOM) the execution occurs in the client side.

A pure HTML/JavaScript based application can be built using this approach.

Advantages of PHA

Provider Hosted Apps are those in which the code is hosted outside the SharePoint server. Since the App can contain both JSOM and CSOM the execution happens in another server or in the client side.

Remote Event Receivers, Custom WCF Services, Protected Business Logic can be done using this approach.



Since PHA is hosted in an external server, there requires a server-to-server trust using certificates. The trust can be Low Trust or High Trust depending on your requirements. This certificate configuration would be an additional configuration overhead going with PHA.

When to choose SHA

The following are the reasons to go with SHA:

  1. If you want to publish an Office App Store, then go with SHA
  2. If you have just HTML/JavaScript code, then go with SHA

When to choose PHA

The following are the reasons to go with PHA:

  1. If you have proprietary business logic, then go with PHA
  2. If you have custom services to be created, then go with PHA
  3. If you have custom event receivers, then go with PHA
  4. If you want to integrate an existing ASP.NET application, then go with PHA
  5. If you have difficulty in finding JSOM resources, then go with PHA

We are not discussing Cloud Hosted Apps (CHAs) here since it has been deprecated.

References

http://msdn.microsoft.com/library/office/dn268593.aspx

Summary

This article explored SHA vs. PHA.