Ektron 9.00
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, as 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 Presentation tier was added in Ektron Version 8.5.
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 using one outside of the well-known port range (0 to 1023).
Benefits of 3-Tier Architecture
Limitations of 3-Tier Architecture
Because the business logic executes on the Application tier, its website directory must be identical to the Presentation tier's.
Impact of 3-Tier Setup on a Developer
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.
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.
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">
Files Copied to the Presentation Tier
The following lists 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 ArchitectureBin
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 services 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 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 content item in Ektron.
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: While 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.
Prerequisite
3-tier architecture requires the Aliasing module files (
UrlAliasingModule.cs
andUrlAliasingBase.cs
in theApp_Code
/CSCode
folder), and the registration of that module in theweb.config
file. To verify the registration:
- In the Presentation website, open
siteroot/web.config
. See Also: Setting up 3-Tier Architecture- Go to the
<Modules>
tag.- Verify that the URL alias module is registered, as shown in the following code.
<modules runAllManagedModulesForAllRequests="true"> <add name="EkUrlAliasModule" type="UrlAliasingModule" preCondition="integratedMode" /> </modules>
To test the 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 Services to move files from the Application tier to the Presentation tier. However, see Limitations of 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"/>