When to choose SHA or PHA.
- SHA: SharePoint Hosted App
- 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:
- Code outside Server
- Discoverability
- App Store Eco System
- Easy Installation
- 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:
- If you want to publish an Office App Store, then go with SHA
- If you have just HTML/JavaScript code, then go with SHA
When to choose PHA
The following are the reasons to go with PHA:
- If you have proprietary business logic, then go with PHA
- If you have custom services to be created, then go with PHA
- If you have custom event receivers, then go with PHA
- If you want to integrate an existing ASP.NET application, then go with PHA
- 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.