Distributing resources with 3-tier architecture
Versions of Ektron previous to 8.5 featured 2-tier architecture, in which the Application and Presentation tiers resided on the same server. In 3-tier architecture, you can locate the Application tier in the client’s environment or an Ektron hosting environment. This represents a true separation of the Web server from the database. The Application tier does the bulk of the work, while the Presentation tier does basic processing.
IMPORTANT: You are not required to use 3-tier architecture—Ektron continues to run successfully on 2-tier architecture.
A 3-tier architecture lets you spread the processing of Ektron data among 3 tiers, shown in the following figure. Each tier should reside on its own server.
NOTE: You may run all 3 tiers on a single server for development purposes only.
The 3 tiers are Data, Application, and Presentation.
web.config
, unity.config)The Ektron Framework API uses the Microsoft Unity Framework to inject business logic implementations into our Framework API. When running in 3-Tier mode, the Framework API on the Presentation tier uses a WCF service client implementation, thereby routing Framework API calls through WCF services, while the actual logic is running on the Application server.
To minimize network requests the between Presentation and Application tiers, Ektron includes a caching tier.
NOTE: 3-tier architecture is different from MVC coding style, which consists of a data layer, business logic layer, and an API layer.
NOTE: To communicate between servers, you can choose any unused port. If you choose a port other than 80, Ektron recommends one outside the well-known port range (0 to 1023).
Because the business logic executes on the Application tier, its website directory must be identical to the Presentation tier's.
The Unity Framework provides the same developer experience, whether you use 2- or 3-tier architecture, by defining which container to use in the web.config
file. See also: Introduction to Unity, Creating a sample content block in 3-tier architecture.
NOTE: You do not need to know about the Unity Framework—it is mentioned here to help you understand how Ektron achieves 2-tier and 3-tier architecture.
Ektron has 3 main containers, which transmit data between tiers.
BusinessObjects.Content
)Framework.Services.Content.ContentServiceClient
) BusinessObjects.Caching.Content
) NOTE: Caching uses a provider model. By default, Web caching is implemented, but you can replace it with other caching options.
The following chart shows how the Framework API uses the containers.
IContentManager
interface.web.config
. In web.config
, if defaultContainer= “Default”
, the Presentation tier first looks in cache for the requested data object. If the data object is not there, the Presentation tier looks in the ChildContainer
property value, which is WCF by default.Prerequisites
- The IP address of your application tier server
- If the Ektron machine is running Windows 2012 server, you must install WCF HTTP Activation.
Installing WCF HTTP Activation
- Launch Server Manager from the task bar or Start menu.
- Choose the server on which you want to install WCF.
- From the task drop-down, scroll to Roles and Features.
- On the Add Roles and Features Wizard dialog, in the left panel, select Features.
- Expand .NET Framework 4.5 Features.
NOTE: If you have not installed .NET 4.5, go back to Server Roles and install it.
- Under WCF Services, check the HTTP-Activation box.
- Click Install.
NOTE: The 8.5 and higher installation includes a startersites\3TierMin\Content
folder that contains files needed for the Presentation tier.
C:\Program Files (x86)\Ektron\CMS400vxx\startersites\3TierMin\Content
folder.root/web.config
file.ek_ServicesPath
to point to the workarea/services
folder on your Application tier server.<appSettings>
<!-- This is the path to your CMS App Site.
It should always end in workarea/services/ -->
<add key="ek_ServicesPath" value="http://[YOUR_CMS_SERVER]
/workarea/services/" />
</appSettings>
web.config
file.<ektron.cacheProvider defaultProvider="webCache"> <providers> <add name="webCache" cacheTimeSeconds="300" type="Ektron.Cms.Providers.Caching.WebCacheProvider, Ektron.Cms.Providers" /> </providers> </ektron.cacheProvider>
framework defaultContainer
tag is Cache
, and the framework childContainer
tag is WCF
.<framework defaultContainer="
Cache"
childContainer="
WCF">
The following files are copied from the Application tier server to initialize the Presentation tier after you complete the set up. The files are located in the startersites\3TierMin\Content
folder.
App_Code
folder. Contains URL Aliasing module See also: Aliasing with 3-tier architecture.Bin
folder. Subset of full bin folder; contains binaries for Presentation tier onlyWorkarea
folder. Subset of full Workarea folder; Framework UI is required to run templated controls and PageBuilder controls on Presentation tierEktron.cms.framework.ui
. Contains default templates for templated server controlsEktron.cms.framework.unity
. Has mapping interfaces and implementationEktron.cms.framework.ui.unity
. Has mapping for templated control to servicesweb.config
<configsections>
tags. <sectionGroup>
settings define how the Presentation tier communicates with the Application tierek_ServicesPath
. Defines the path to the Application tier's Web servicesEktron Windows Service uses Windows Web Services to perform these activities:
• Schedules the future publication and removal of content.
• Transmits notifications that a sync should be started between the staging and production servers.
• In the 3-Tier feature, transfers data between servers. file<ui.unity configSource="ektron.cms.framework.ui.unity.config" /> <ui configSource="ektron.cms.framework.ui.config" />
<ektron.framework.services>
tag defines the container. <ektron.framework.services> <unity configSource="ektron.cms.framework.unity.config"/> <framework defaultContainer="Default" childContainer="WCF"/> </ektron.framework.services>
If defaultContainer=“Default”
, the Presentation tier first looks in cache for the requested data object. If the data object is not there, the Presentation tier looks in the ChildContainer
property value, which is WCF by default.
<pages>
tag. Controls used by PageBuilder and templated server controls.<modules>
section manages Aliasing. See also: Aliasing with 3-tier architecture.<system.webServer> <modules runAllManagedModulesForAllRequests="true"> <add name="EkUrlAliasModule" type="UrlAliasingModule" preCondition="integratedMode"/> </modules> </system.webServer>
This example illustrates how the same code can work in the Application and Presentation tiers. Ektron uses the Framework API to get a content item.
<asp:Label ID=”contentblock1” runat=”server”> </asp:Label>
NOTE: This example assumes that ID 30 is a valid Ektron content item.
long id = 30; if (!string.isNullorEmpty(Request.QueryString[“id”])) { long.TryParse(Request.QueryString[“id”].ToString(), out id); }
ContentManager contentManager = new ContentManager();
ContentData data = contentManager.GetItem(id); contentblock1.Text = data.Html;
Prerequisites
- A PageHost file in the Presentation tier used specifically to support 3-tier architecture. The file lets you view only; you cannot edit.
- A widget built using the Framework API (for example, the sample Content Block widget).
NOTE: A 3-Tier site contains many widgets. Only those built using the Framework API work on the Presentation tier.
- A wireframeThe architecture of a Web page containing columns, dropzones, and layout information. template (
content.pb.aspx
) that exists on the Application and Presentation tiers.
content.pb.aspx
wireframe template is applied.URL Aliasing works within 3-tier architecture. See also: Creating user-friendly URLs with aliasing.
NOTE: Aliasing code is stored in the App_Code/CSCode/UrlAliasingModule.cs
file.
3-tier architecture requires the Aliasing module files (UrlAliasingModule.cs
and UrlAliasingBase.cs
in the App_Code
/CSCode
folder), and the registration of that module in the web.config
file. To verify the registration:
siteroot/web.config
. See also: Setting up 3-tier architecture.<Modules>
tag. <modules runAllManagedModulesForAllRequests="true">
<add name="EkUrlAliasModule"
type="UrlAliasingModule"
preCondition="integratedMode" />
</modules>
To test URL aliasing, follow these steps.
You may use eSync to move files among tiers and sites, but eSync is not a prerequisite of 3-tier architecture.
You can use eSync to move changes from the development to the staging to the production sites. You also can use eSync to move changes from the Data to Application tier. Then, use Web servicesEktron Windows Service uses Windows Web Services to perform these activities: • Schedules the future publication and removal of content. • Transmits notifications that a sync should be started between the staging and production servers. • In the 3-Tier feature, transfers data between servers. to move files from the Application tier to the Presentation tier. However, see Limitations of 3-tier architecture.
If you use Microsoft Search Server 2010 with 3-tier architecture, you do not need to make any adjustments.
To use Solr search with 3-tier architecture, see Using Solr search with 3-tier architecture.
To use Microsoft FAST Search Server 2010 search with 3-tier architecture, see Using Solr search with 3-tier architecture.
If you are using Solr search for your presentation layer, follow these steps to prepare it for Solr.
<!-- Search--> <typeAlias alias="BusinessObjects.ICrawler" type="Ektron.Cms.Search.SearchServerCrawler, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISearchSettings" type="Ektron.Cms.Search.SearchSettings, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISynonyms" type="Ektron.Cms.Search.CmsSynonyms, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISuggestedResults" type="Ektron.Cms.Search.SuggestedResults, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchManager" type="Ektron.Cms.Search.SearchManager, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchPropertyRule" type="Ektron.Cms.Search.SearchPropertyRule, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchProvider" type="Ektron.Cms.Search.SS2010.SS2010SearchProvider, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISearchResultBuilder" type="Ektron.Cms.Search.SharePointSearchResultBuilder, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IIntegratedSearchMapping" type="Ektron.Cms.Search.IntegratedSearchMapping, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.IPropertyNameResolver" type="Ektron.Cms.Search.SharePointPropertyNameResolver, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IDocumentPromotionManager" type="Ektron.Cms.Search.DocumentPromotionManager, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IQueryProposition" type="Ektron.Cms.Search.SharepointQueryPropositionService, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IQueryPropositionManager" type="Ektron.Cms.Search.QueryPropositionManager, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.IRecordQueryStatisticsHelperService" type="Ektron.Cms.Search.SharepointRecordQueryStatisticsService, Ektron.Cms.Search"/>
<!-- Search--> <typeAlias alias="BusinessObjects.ICrawler" type="Ektron.Cms.Search.SolrCrawler, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISearchSettings" type="Ektron.Cms.Search.SearchSettings, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISynonyms" type="Ektron.Cms.Search.CmsSynonyms, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISuggestedResults" type="Ektron.Cms.Search.SuggestedResults, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchManager" type="Ektron.Cms.Search.SearchManager, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchPropertyRule" type="Ektron.Cms.Search.SearchPropertyRule, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchProvider" type="Ektron.Cms.Search.Solr.SolrSearchProvider, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISearchResultBuilder" type="Ektron.Cms.Search.Solr.SolrSearchResultBuilder, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IIntegratedSearchMapping" type="Ektron.Cms.Search.IntegratedSearchMapping, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.IPropertyNameResolver" type="Ektron.Cms.Search.Solr.SolrPropertyNameResolver, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IDocumentPromotionManager" type="Ektron.Cms.Search.DocumentPromotionManager, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IQueryProposition" type="Ektron.Cms.Search.Solr.SolrQueryPropositionService, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IQueryPropositionManager" type="Ektron.Cms.Search.QueryPropositionManager, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.IRecordQueryStatisticsHelperService" type="Ektron.Cms.Search.Solr.SolrRecordQueryStatisticsHelperService, Ektron.Cms.Search"/>
If you are using Microsoft FAST Search Server 2010 for your presentation layer, follow these steps to prepare it for FAST.
<!-- Search--> <typeAlias alias="BusinessObjects.ICrawler" type="Ektron.Cms.Search.SearchServerCrawler, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISearchSettings" type="Ektron.Cms.Search.SearchSettings, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISynonyms" type="Ektron.Cms.Search.CmsSynonyms, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISuggestedResults" type="Ektron.Cms.Search.SuggestedResults, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchManager" type="Ektron.Cms.Search.SearchManager, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchPropertyRule" type="Ektron.Cms.Search.SearchPropertyRule, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchProvider" type="Ektron.Cms.Search.SS2010.SS2010SearchProvider, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISearchResultBuilder" type="Ektron.Cms.Search.SharePointSearchResultBuilder, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IIntegratedSearchMapping" type="Ektron.Cms.Search.IntegratedSearchMapping, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.IPropertyNameResolver" type="Ektron.Cms.Search.SharePointPropertyNameResolver, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IDocumentPromotionManager" type="Ektron.Cms.Search.DocumentPromotionManager, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IQueryProposition" type="Ektron.Cms.Search.SharepointQueryPropositionService, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IQueryPropositionManager" type="Ektron.Cms.Search.QueryPropositionManager, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.IRecordQueryStatisticsHelperService" type="Ektron.Cms.Search.SharepointRecordQueryStatisticsService, Ektron.Cms.Search"/>
<!-- Search--> <typeAlias alias="BusinessObjects.ICrawler" type="Ektron.Cms.Search.SearchServerCrawler, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISearchSettings" type="Ektron.Cms.Search.SearchSettings, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISynonyms" type="Ektron.Cms.Search.CmsSynonyms, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISuggestedResults" type="Ektron.Cms.Search.SuggestedResults, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchManager" type="Ektron.Cms.Search.SearchManager, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchPropertyRule" type="Ektron.Cms.Search.SearchPropertyRule, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.ISearchProvider" type="Ektron.Cms.Search.FS2010.FS2010SearchProvider, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.ISearchResultBuilder" type="Ektron.Cms.Search.SharePointSearchResultBuilder, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IIntegratedSearchMapping" type="Ektron.Cms.Search.IntegratedSearchMapping, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.IPropertyNameResolver" type="Ektron.Cms.Search.SharePointPropertyNameResolver, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IDocumentPromotionManager" type="Ektron.Cms.Search.DocumentPromotionManager, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IQueryProposition" type="Ektron.Cms.Search.SharepointQueryPropositionService, Ektron.Cms.Search"/> <typeAlias alias="BusinessObjects.IQueryPropositionManager" type="Ektron.Cms.Search.QueryPropositionManager, Ektron.Cms.BusinessObjects"/> <typeAlias alias="BusinessObjects.IRecordQueryStatisticsHelperService" type="Ektron.Cms.Search.SharepointRecordQueryStatisticsService, Ektron.Cms.Search"/>