Various versions of SharePoint provides different capabilities to create solutions on SharePoint and these technologies are continuously evolving. I am trying to put the journey here and then will compare between these technologies so that we can take a correct decision on which model should be selected and when.
The below diagram depicts the journey of SharePoint and how the solutions are evolving:
SharePoint Farm Solution
Apps for SharePoint
Solutions are small to large scale packages used to customize or enhance SharePoint sites. They are also called full trust solutions.
Sandbox solutions are similar to Farm Solution with a limited capabilities. They are called partial trust solution.
Apps For SharePoint are stand-alone applications that provide specific information or functionality to a SharePoint site.
SharePoint Farm solutions are hosted within the SharePoint Farm and they are executed within the main SharePoint worker process
Sandbox solutions are also hosted within the SharePoint Farm but they are executed in sandbox worker process (SPUCWorkerProcess.exe).
Apps run completely outside of the SharePoint server, and their custom code executes either within the context of the client browser or on
other servers that are not running SharePoint such as Web servers in the cloud.
Mostly a farm solutiona requires a Farm Administrator to do the deployment and mostly restarts the IIS on all the WFEs, which causes a disruption in the service.
Deployment of Sandbox solutions is a lot easier and straight forward and a site collection administrator uploads and activates a sandboxed
solution.Though after activating the sandboxed solution it can create some unwarrented effects on the site.
The apps are uploaded in either the public SharePoint app store or to an organization's private app catalog. Once they are made available in a SharePoint site a user can install them on the local SharePoint Site.
Farm solutions can be installed for any scope such as at Farm, Web App, Site Collection, Site level.
Sandbox solution scope is limited to Site Collections in which they are activated.
app are installed within the same scope of the SharePoint site or at the Tenancy Scope. The tenancy scope is just to make sure that all the tenant site can install the app at the site level.
Physical Files Location
The content of a farm solution goes into the config DB and on the file system depending on the solution content.
The Sandboxed solutions are stored in the content db of the site collection. No content goes in the file system.
The components for an app resides in multiple places:
Externally: Remote components are persisted in databases, servers, or cloud-based services, that are external to the SharePoint farm.
In SharePoint: SharePoint components, such as list templates, modules, workflows, site pages, Web Parts, and custom content types, are
persisted within the SharePoint content database.
In Farm Solutions the Server side object model can be used. The data acces is unrestricted.
In Sandbox Solutions the Server side object model can be used but it is restrictive in nature. The solution can only access content from
the site collection in which it was deployed.
Business logic in an app for SharePoint can access SharePoint data through one of the several client APIs included in SharePoint 2013 such
server object model can not be used in the Apps for SharePoint.
Integration with Other Apps
Limited options and need to use BCS (Business Connectivity Service), Web Services.
Similar to Farm Solutions.
Multiple options for the integration from Services to actually implementing a fully customized applications against different products SDK as this is technology independent. We can consider a server in the SharePoint farm, an external server such as a server in the cloud, a client computer, and a mobile device.
Hope this helps to take a good decision.. Feedback Welcome!!